/* GLOBAL STYLES */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #667eea;
  --success: #4caf50;
  --warning: #ff9800;
  --danger: #f44336;
  --bg: #f5f5f5;
  --card-bg: #fff;
  --text-primary: #212121;
  --text-secondary: #757575;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
}

.powered-by {
  text-align: center;
  color: #9a9a9a;
  font-size: 12px;
  padding: 16px 0;
  margin-top: 20px;
}

/* LOGIN PAGE */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
  width: 100%;
}

.login-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
}

.brand {
  font-size: 28px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 8px;
  color: var(--primary);
}

.subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 30px;
  font-size: 14px;
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-card label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.login-card input {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s;
}

.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  background: #f0f4ff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.forgot-link {
  text-align: center;
  font-size: 13px;
  margin-top: 12px;
}

.forgot-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.forgot-link a:hover {
  text-decoration: underline;
}

.error-msg {
  background: #ffebee;
  color: #c62828;
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  border-left: 4px solid var(--danger);
}

.success-msg {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  border-left: 4px solid var(--success);
}

/* MODAL */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-content h2 {
  margin-bottom: 8px;
  color: var(--primary);
}

.modal-content p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 16px;
}

.modal-content input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 12px;
}

/* BUTTONS */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}

.btn-primary:hover {
  background: #5568d3;
  box-shadow: var(--shadow);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary.full-width {
  width: 100%;
}

.btn-secondary {
  background: var(--border);
  color: var(--text-primary);
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #d0d0d0;
}

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: #d32f2f;
}

.btn-success {
  background: var(--success);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

/* CARDS */
.card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

/* MAIN APP LAYOUT */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  background: var(--primary);
  color: white;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: center;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header h1 {
  font-size: 20px;
  margin: 0;
}

.btn-logout {
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.3);
}

.app-content {
  flex: 1;
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.tab-nav {
  display: flex;
  gap: 0;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;
}

.tab-nav-item {
  flex: 1;
  padding: 12px 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  text-align: center;
}

.tab-nav-item.active {
  color: var(--primary);
  border-bottom: 3px solid var(--primary);
}

.tab-content {
  display: none;
  padding-bottom: 120px;
  animation: fadeIn 0.2s;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* DASHBOARD COMPONENTS */
.meta-card {
  background: linear-gradient(135deg, var(--primary), #5568d3);
  color: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 12px;
}

.meta-label {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.meta-value {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 12px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: white;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-percent {
  font-size: 12px;
  opacity: 0.9;
}

.total-card {
  background: linear-gradient(135deg, var(--success), #45a049);
  color: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 12px;
}

.total-label {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.total-value {
  font-size: 32px;
  font-weight: bold;
}

/* PLATFORM SELECTOR */
.platform-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.platform-btn {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 2px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 80px;
}

.platform-btn:hover {
  border-color: var(--primary);
  background: #f0f4ff;
}

.platform-btn.selected {
  border-color: var(--primary);
  background: #e8eef7;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.platform-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.platform-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

/* INFO BOXES */
.info-box {
  background: #e3f2fd;
  border-left: 4px solid var(--primary);
  padding: 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 12px;
}

.info-box.warning {
  background: #fff3e0;
  border-left-color: var(--warning);
}

.premium-locked {
  background: #f3e5f5;
  border-left: 4px solid #9c27b0;
  padding: 16px;
  border-radius: 4px;
  text-align: center;
  margin: 30px 0;
}

.premium-locked h3 {
  color: #9c27b0;
  margin-bottom: 8px;
}

.premium-locked p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 12px;
}

.btn-upgrade {
  background: #9c27b0;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

.btn-upgrade:hover {
  background: #7b1fa2;
}

/* DELIVERY LIST */
.delivery-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px;
  background: var(--bg);
  border-radius: 6px;
  border-left: 4px solid var(--primary);
  margin-bottom: 8px;
}

.delivery-info {
  flex: 1;
}

.delivery-platform {
  font-weight: 600;
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 4px;
}

.delivery-value {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 2px;
}

.delivery-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.delivery-actions {
  display: flex;
  gap: 6px;
}

.btn-edit, .btn-delete {
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.btn-edit {
  background: var(--primary);
  color: white;
}

.btn-delete {
  background: var(--danger);
  color: white;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
}

/* RESPONSIVE */
@media (max-width: 480px) {
  .login-card {
    padding: 24px 16px;
    max-width: 100%;
  }

  .app-header {
    padding: 12px;
  }

  .app-header h1 {
    font-size: 18px;
  }

  .platform-selector {
    grid-template-columns: repeat(2, 1fr);
  }

  .meta-value, .total-value {
    font-size: 24px;
  }
}
