/* ============================================================
   CSS VARIABLES & THEME
   ============================================================ */
:root {
  /* Dark theme (default) */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a24;
  --bg-elevated: #22222e;
  
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  
  --accent-primary: #6366f1;
  --accent-primary-glow: rgba(99, 102, 241, 0.3);
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  
  --status-pending-bg: rgba(251, 191, 36, 0.15);
  --status-pending-text: #fbbf24;
  --status-inprogress-bg: rgba(59, 130, 246, 0.15);
  --status-inprogress-text: #60a5fa;
  --status-closedwon-bg: rgba(34, 197, 94, 0.15);
  --status-closedwon-text: #4ade80;
  --status-closedlost-bg: rgba(239, 68, 68, 0.15);
  --status-closedlost-text: #f87171;
  
  --success-color: #4ade80;
  --error-color: #f87171;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px var(--accent-primary-glow);
}

/* Light theme */
[data-theme="light"] {
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f0f5;
  --bg-elevated: #e8e8ed;
  
  --text-primary: #1a1a1f;
  --text-secondary: #555560;
  --text-muted: #8e8e9a;
  
  --accent-primary: #5b5eeb;
  --accent-primary-glow: rgba(91, 94, 235, 0.2);
  --accent-secondary: #7c5ce8;
  --accent-gradient: linear-gradient(135deg, #5b5eeb 0%, #7c5ce8 100%);
  
  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.12);
  
  --status-pending-bg: rgba(234, 179, 8, 0.15);
  --status-pending-text: #b45309;
  --status-inprogress-bg: rgba(59, 130, 246, 0.12);
  --status-inprogress-text: #1d4ed8;
  --status-closedwon-bg: rgba(34, 197, 94, 0.12);
  --status-closedwon-text: #15803d;
  --status-closedlost-bg: rgba(239, 68, 68, 0.12);
  --status-closedlost-text: #b91c1c;
  
  --success-color: #16a34a;
  --error-color: #dc2626;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 40px var(--accent-primary-glow);
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   BASE LAYOUT
   ============================================================ */
* {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  overflow-wrap: anywhere;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(env(safe-area-inset-bottom) + 80px);
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px;
}

.app-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
  position: relative;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-actions {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

.is-hidden {
  display: none !important;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

.signout-btn {
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.signout-btn:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm), var(--shadow-glow);
}

@media (max-width: 768px) {
  .header-actions {
    gap: 8px;
  }

  .signout-btn {
    height: 38px;
    padding: 0 12px;
    font-size: 12px;
  }
}

h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

.login-card {
  background: var(--bg-secondary);
  padding: 40px 32px;
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 380px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: loginFadeUp 0.4s ease;
}

.login-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: var(--accent-gradient);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-glow);
}

.login-title {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-primary);
}

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

.login-input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: var(--transition-fast);
}

.login-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.login-input::placeholder {
  color: var(--text-muted);
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent-gradient);
  color: white;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transition: var(--transition-smooth);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 60px var(--accent-primary-glow);
}

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

.login-status {
  margin-top: 16px;
  font-size: 13px;
  text-align: center;
  color: var(--text-secondary);
  min-height: 18px;
}

.login-status.is-error {
  color: var(--error-color);
}

.login-status.is-muted {
  color: var(--text-secondary);
}

@keyframes loginFadeUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   TOP-LEVEL PAGE PILLS
   ============================================================ */
.page-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  margin: 0 0 14px;
}

.page-pill {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.page-pill:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.page-pill.active {
  color: white;
  background: var(--accent-gradient);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   TABS (TOP - DESKTOP)
   ============================================================ */
.tabs {
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 6px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  gap: 4px;
}

.tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.tab svg {
  opacity: 0.7;
  transition: var(--transition-fast);
}

.tab:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.tab:hover svg {
  opacity: 1;
}

.tab.active {
  background: var(--accent-gradient);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-sm), var(--shadow-glow);
}

.tab.active svg {
  opacity: 1;
}

/* ============================================================
   CARD BASE
   ============================================================ */
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

/* ============================================================
   SEGMENTED CONTROL
   ============================================================ */
.segmented {
  display: flex;
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  gap: 4px;
}

.segmented-item {
  flex: 1;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.segmented-item svg {
  opacity: 0.7;
}

.segmented-item:hover {
  color: var(--text-primary);
}

.segmented-item.active {
  background: var(--accent-gradient);
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.segmented-item.active svg {
  opacity: 1;
}

/* ============================================================
   FORM FIELDS
   ============================================================ */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 14px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-fast);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-muted);
}

.field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0a0b0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.row {
  display: flex;
  gap: 12px;
}

.row .field {
  flex: 1;
}

.field-with-add .field-inline {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.field-with-add .field-inline select {
  flex: 1;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-icon {
  width: 46px;
  min-width: 46px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 22px;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-full);
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 60px var(--accent-primary-glow);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  box-shadow: none;
  cursor: default;
  transform: none;
}

.btn-secondary {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
}

.btn-save {
  flex: 2;
  padding: 12px 16px;
  border-radius: var(--radius-full);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-sm), var(--shadow-glow);
  transition: var(--transition-smooth);
}

.btn-save:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), 0 0 40px var(--accent-primary-glow);
}

/* ============================================================
   STATUS MESSAGES
   ============================================================ */
.status-msg {
  margin-top: 12px;
  font-size: 13px;
  min-height: 18px;
  text-align: center;
}

.status-success {
  color: var(--success-color);
}

.status-error {
  color: var(--error-color);
}

/* ============================================================
   PILLS
   ============================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pill svg {
  opacity: 0.8;
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.pill-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-full);
  padding: 8px 14px;
  border: 1px solid var(--accent-primary);
  background: transparent;
  color: var(--accent-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.pill-button:hover {
  background: var(--accent-primary);
  color: white;
}

/* ============================================================
   LISTS
   ============================================================ */
.list-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ============================================================
   ITEM CARDS (Transaction / Client)
   ============================================================ */
.item-card {
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.item-card:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.item-sub {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.item-notes {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

/* ============================================================
   STATUS PILLS
   ============================================================ */
.status-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending-text);
}

.status-inprogress {
  background: var(--status-inprogress-bg);
  color: var(--status-inprogress-text);
}

.status-closedwon {
  background: var(--status-closedwon-bg);
  color: var(--status-closedwon-text);
}

.status-closedlost {
  background: var(--status-closedlost-bg);
  color: var(--status-closedlost-text);
}

/* ============================================================
   CLIENT ROW
   ============================================================ */
.client-row {
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.client-row:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============================================================
   TALENT LIST
   ============================================================ */
.talent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.talent-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.talent-row:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.talent-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  margin-right: 14px;
  flex-shrink: 0;
}

.talent-main {
  flex: 1;
}

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

.talent-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.talent-chevron {
  font-size: 20px;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.talent-row:hover .talent-chevron {
  color: var(--accent-primary);
  transform: translateX(4px);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 9999;
}

.modal-box {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: 28px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: modalSlideUp 0.3s ease;
  overflow-y: auto;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-primary);
}

.modal-subtext {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

.modal-subtext-xs {
  font-size: 11px;
}

.modal-field {
  margin-bottom: 14px;
}

.modal-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.modal-field input,
.modal-field select,
.modal-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 14px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-fast);
}

.modal-field input:focus,
.modal-field select:focus,
.modal-field textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.modal-field input:disabled,
.modal-field select:disabled,
.modal-field textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0a0b0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.modal-field textarea {
  resize: vertical;
  min-height: 70px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.modal-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 10px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-table td {
  font-size: 13px;
  padding: 10px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.modal-table tbody tr {
  transition: var(--transition-fast);
}

.modal-table tbody tr:hover {
  background: var(--bg-tertiary);
}

.modal-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ============================================================
   SUMMARY CHIPS
   ============================================================ */
.summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.summary-chip {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  font-size: 13px;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* ============================================================
   TALENT MODAL (Layout B3)
   ============================================================ */
.talent-modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.talent-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  margin: 0 auto 14px;
  background: var(--accent-gradient);
  box-shadow: var(--shadow-glow);
}

.talent-modal-name {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.talent-stats-row {
  display: flex;
  gap: 12px;
  margin: 20px 0 16px;
}

.talent-stat-card {
  flex: 1;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border-color);
  text-align: center;
}

.stat-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================================
   RECENT ACTIVITY
   ============================================================ */
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-tertiary);
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.recent-col {
  display: flex;
  flex-direction: column;
}

.recent-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.recent-client {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.recent-category {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  margin-bottom: 2px;
}

.recent-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

.recent-status {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 500;
  margin-left: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ============================================================
   SKELETON LOADERS
   ============================================================ */
.skeleton-row {
  display: flex;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  margin-bottom: 10px;
}

.skeleton-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  margin-right: 14px;
  position: relative;
  overflow: hidden;
}

.skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
}

.skeleton-line-lg {
  width: 70%;
}

.skeleton-line-sm {
  width: 45%;
}

.skeleton-avatar::after,
.skeleton-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ============================================================
   DATABASE VIEW
   ============================================================ */
.database-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.database-title {
  margin: 0;
  font-size: 20px;
}

.database-subtitle {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.db-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.db-item-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  padding: 14px;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
}

.db-item-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-tertiary);
}

.db-item-card::after {
  content: ">";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 12px;
}

.db-item-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.db-item-subtitle {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
}

.db-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.database-modules {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.database-modules .segmented-item[disabled] {
  opacity: 1;
  cursor: default;
}

.database-modules .segmented-item[aria-disabled="true"] {
  opacity: 0.5;
}

.db-summary-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.db-summary-chips .summary-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.db-filters {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: var(--bg-tertiary);
  margin-bottom: 14px;
}

.db-filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  opacity: 0.85;
}

.db-filters-toggle::before {
  content: "+";
  font-weight: 700;
  line-height: 1;
}

.db-filters-toggle[aria-expanded="true"]::before {
  content: "-";
}

.db-filters.is-collapsed {
  display: none;
}

.db-field-wide {
  margin-bottom: 12px;
}

.db-filter-actions {
  display: flex;
  gap: 8px;
}

.db-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-sm);
  margin-top: 10px;
}

.db-table {
  min-width: 760px;
}

.db-table th,
.db-table td {
  white-space: nowrap;
}

.db-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 10px;
}

.db-page-info {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================================
   BOTTOM NAV (MOBILE)
   ============================================================ */
.bottom-nav {
  display: none;
}

#floating-submit {
  display: none;
}

@media (max-width: 768px) {
  #top-tabs {
    display: none !important;
  }

  .page-pills {
    width: 100%;
    display: flex;
  }

  .page-pill {
    flex: 1;
    text-align: center;
  }

  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 10001;
    backdrop-filter: blur(20px);
  }

  .bottom-nav button {
    background: none;
    border: none;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 10px 14px;
  }

  .bottom-nav button svg {
    opacity: 0.6;
    transition: var(--transition-fast);
  }

  .bottom-nav button.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.12);
    border-radius: var(--radius-md);
    transform: translateY(-2px);
  }

  .bottom-nav button.active svg {
    opacity: 1;
  }

  #floating-submit {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 14px 18px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    z-index: 10000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition-smooth);
  }

  #floating-submit:disabled {
    opacity: 0.7;
    pointer-events: none;
    transform: none;
  }

  #floating-submit:hover {
    transform: translateY(-2px);
  }

  .app {
    max-width: 100%;
    padding: 16px;
    padding-bottom: 140px;
  }

  .card {
    padding: 20px;
    padding-bottom: 100px;
  }

  .btn-primary {
    display: none !important;
  }

  .db-summary-chips {
    grid-template-columns: 1fr;
  }

  .db-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .db-page-info {
    text-align: center;
  }
}

/* ============================================================
   RESPONSIVE TWEAKS
   ============================================================ */
@media (max-width: 480px) {
  .app { 
    padding: 12px; 
  }
  
  .card { 
    padding: 18px;
    border-radius: var(--radius-lg);
  }

  .item-title { 
    font-size: 14px; 
  }
  
  .item-sub { 
    font-size: 12px; 
  }

  .talent-name { 
    font-size: 14px; 
  }
  
  .talent-subtitle { 
    font-size: 11px; 
  }

  .modal-box {
    max-height: 85vh;
    padding: 20px;
    border-radius: var(--radius-lg);
  }
  
  .row {
    flex-direction: column;
    gap: 0;
  }
  
  h1 {
    font-size: 24px;
  }
}

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  @page { margin: 10mm; }

  body,
  .app,
  .card,
  .db-table-wrap,
  .db-filters,
  .db-summary-chips,
  .summary-chip {
    background: #fff !important;
    color: #000 !important;
  }

  [data-action="db-back-to-list"] {
    display: none;
  }
  .db-detail-header .pill {
    display: inline-flex !important;
  }

  #db-filters-toggle,
  #db-filters-panel,
  .db-pagination,
  #bottom-nav,
  #floating-submit,
  .app-header,
  .page-pills,
  #top-tabs,
  #signout-btn,
  #theme-toggle,
  #database-status {
    display: none !important;
  }

  .db-table {
    min-width: auto;
    width: 100%;
  }

  .db-table th,
  .db-table td {
    color: #000 !important;
    border-color: #ccc !important;
  }

  .db-table th {
    background: #f5f5f5 !important;
  }

  .summary-chip {
    border: 1px solid #ccc !important;
  }

  .db-rsvp-detail-view {
    display: block !important;
  }

  .card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .db-table-wrap {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
  .app { max-width: none !important; }
  .db-table tr { break-inside: avoid; page-break-inside: avoid; }
  thead { display: table-header-group; }
}
