/* ═══════════════════════════════════════════════════════════════
   GUHAN ASTRO CRM — Premium visual refinement (CSS only)
   Uses design-tokens.css — does not change layout or workflows.
═══════════════════════════════════════════════════════════════ */

/* ── Base & calm background ───────────────────────────────── */
body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  font-weight: var(--weight-medium);
  background: var(--bg);
  background-image: none;
  -webkit-font-smoothing: antialiased;
}

:root {
  background-image: none;
}

body.dark-theme {
  background-image: none;
}

/* ── Typography hierarchy ─────────────────────────────────── */
.ht h1,
.header-title {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  letter-spacing: 0.12em;
}

.stitle {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.35;
  background: linear-gradient(90deg, var(--primary-muted) 0%, rgba(21, 101, 192, 0.04) 55%, transparent 100%);
  border-left: 3px solid var(--accent-teal);
  border-bottom: none;
  padding: 11px 14px 11px 12px;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-sm);
}

/* Full-width header band when title is first in a section card */
.sec > .stitle:first-child {
  margin-top: calc(-1 * var(--space-5));
  margin-left: calc(-1 * var(--space-5));
  margin-right: calc(-1 * var(--space-5));
  margin-bottom: var(--space-4);
  padding: 12px 16px 12px 14px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-left-width: 4px;
}

body.dark-theme .stitle {
  color: var(--accent-gold-soft);
  background: linear-gradient(90deg, rgba(201, 150, 42, 0.14) 0%, rgba(201, 150, 42, 0.03) 55%, transparent 100%);
  border-left-color: var(--accent-gold);
}

@media (max-width: 768px) {
  .sec > .stitle:first-child {
    margin-top: -10px;
    margin-left: -12px;
    margin-right: -12px;
  }
  .stitle {
    font-size: 14px;
    padding: 10px 12px 10px 11px;
  }
}

.field label {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-mid);
  margin-bottom: var(--space-1);
}

body.dark-theme .field label {
  font-size: var(--text-xs);
  color: var(--text-dim);
}

.cname {
  font-weight: var(--weight-semibold);
  font-size: 17px;
}

.cnav-lbl,
.slbl {
  font-family: var(--font-ui);
}

/* ── Header — executive, less glow ────────────────────────── */
.header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  padding: var(--space-3) var(--space-5);
  box-shadow: var(--shadow-sm);
}

.header::after {
  display: none;
}

.header-title {
  font-size: 20px;
  letter-spacing: 0.2em;
  color: var(--header-accent);
  background: none;
  -webkit-text-fill-color: currentColor;
  filter: none;
}

body.dark-theme .header-title {
  background: none;
  -webkit-text-fill-color: currentColor;
  filter: none;
}

.header-logo-wrap {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.header-motto,
.header-powered,
.header-system {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.72);
}

.logo-img {
  animation: none;
  border-color: rgba(255, 255, 255, 0.2);
}

/* ── Premium buttons — restrained ───────────────────────────── */
.btn-premium-gold,
.btn-upgrade-header {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, #f0e6d0 0%, #c4a574 100%);
  border: 1px solid rgba(154, 123, 79, 0.45);
  color: #1e2434;
  box-shadow: var(--shadow-sm);
  text-shadow: none;
}

.btn-premium-gold:hover,
.btn-upgrade-header:hover {
  box-shadow: var(--shadow-md);
  filter: brightness(1.03);
}

body.dark-theme .btn-premium-gold,
body.dark-theme .btn-upgrade-header {
  background: linear-gradient(180deg, #5c3d10 0%, #2d1f08 100%);
  border-color: rgba(201, 150, 42, 0.35);
  color: #f0eeea;
}

.header .btn-premium-gold,
.header .theme-toggle.btn-premium-gold {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--header-text);
  text-shadow: none;
}

.header .btn-premium-gold:hover,
.header .theme-toggle.btn-premium-gold:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.theme-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-shadow: none;
  font-family: var(--font-ui);
}

.btn-gold {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  color: #fff;
  border: 1px solid rgba(13, 71, 161, 0.35);
  box-shadow: 0 2px 8px rgba(21, 101, 192, 0.22);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--primary), #1976d2);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(21, 101, 192, 0.32);
}

:root .btn-gold {
  color: #fff;
}

body.dark-theme .btn-gold {
  background: linear-gradient(135deg, #5c3d10, #8a6618);
  border-color: rgba(201, 150, 42, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

body.dark-theme .btn-gold:hover {
  background: linear-gradient(135deg, #8a6618, #c9962a);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-blue {
  background: var(--primary-muted);
  border-color: var(--primary-border);
  color: var(--primary);
}

/* ── Sidebar & client list ──────────────────────────────────── */
.sidebar {
  background: var(--card);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.sb-search {
  padding: var(--space-3);
  flex: 0 0 auto;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  max-height: min(320px, 45vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sb-nav {
  flex: 0 0 auto;
  flex-shrink: 0;
}

.cl {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 7px;
  padding-bottom: 24px;
}

.si {
  border-radius: var(--radius-sm);
  font-size: var(--text-body);
}

.si:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.snum {
  color: var(--primary);
  font-weight: var(--weight-semibold);
}

.cc {
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  padding: var(--space-3);
}

.cc.active {
  background: var(--primary-muted);
  border-color: var(--primary-border);
  box-shadow: inset 3px 0 0 var(--accent-teal);
}

.cc.active .cname {
  color: var(--text);
  font-weight: var(--weight-bold);
}

body.dark-theme .cc.active {
  background: var(--primary-muted);
  border-color: var(--primary-border);
  box-shadow: inset 3px 0 0 var(--accent-gold);
}

.cid {
  color: var(--text-mid);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
}

body.dark-theme .cid {
  color: #e8c96d;
  -webkit-text-fill-color: currentColor;
  animation: none;
  transition: none;
  filter: none;
}

/* ── Main content & cards ─────────────────────────────────── */
.main {
  padding: var(--space-5) var(--space-6);
}

.sec {
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}

body.dark-theme .sec {
  box-shadow: var(--shadow-sm);
}

.client-nav-bar {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-5);
}

.cnav-item:hover:not(.cnav-active) {
  background: var(--card2);
}

.cnav-active {
  background: linear-gradient(
    165deg,
    rgba(21, 101, 192, 0.14) 0%,
    rgba(38, 166, 154, 0.08) 100%
  );
  border-bottom: 3px solid var(--accent-teal);
  box-shadow: inset 0 -1px 0 rgba(38, 166, 154, 0.15);
}

:root .cnav-active {
  background: linear-gradient(165deg, #1565c0 0%, #1976d2 55%, #1e88e5 100%);
  border-bottom-color: var(--accent-teal);
}

.cnav-active .cnav-lbl {
  color: var(--primary);
  font-weight: var(--weight-semibold);
}

:root .cnav-active .cnav-lbl {
  color: #ffffff;
}

body.dark-theme .cnav-active {
  background: var(--primary-muted);
  border-bottom-color: var(--accent-gold);
}

body.dark-theme .cnav-active .cnav-lbl {
  color: var(--accent-gold-soft);
}

.cnav-active .cnav-icon {
  transform: scale(1.05);
}

.tabs {
  border-radius: var(--radius-md);
  padding: var(--space-1);
}

.tab.active {
  background: rgba(21, 101, 192, 0.1);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

:root .tab.active {
  background: linear-gradient(135deg, #1565c0, #1976d2);
  color: #ffffff;
  border-color: transparent;
  box-shadow: inset 0 -2px 0 var(--accent-teal);
}

body.dark-theme .tab.active {
  background: var(--primary-muted);
  color: var(--accent-gold-soft);
  border-color: var(--primary-border);
}

body.dark-theme :root .tab.active {
  background: linear-gradient(135deg, rgba(92, 61, 16, 0.85), rgba(138, 102, 24, 0.95));
  color: var(--accent-gold-soft);
}

/* ── Form fields ────────────────────────────────────────────── */
.field input,
.field select,
.field textarea {
  background: var(--inp-bg);
  border: 1.5px solid var(--inp-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: var(--weight-semibold);
  box-shadow: inset 0 1px 2px rgba(28, 36, 52, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s;
}

body.dark-theme .field input,
body.dark-theme .field select,
body.dark-theme .field textarea {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.22);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  background: var(--bg-elevated);
  box-shadow: var(--focus-ring), inset 0 1px 2px rgba(28, 36, 52, 0.03);
}

body.dark-theme .field input:focus,
body.dark-theme .field select:focus,
body.dark-theme .field textarea:focus {
  background: var(--inp-bg);
  box-shadow: var(--focus-ring), inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

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

/* Sidebar search matches form field crispness */
.si {
  background: var(--inp-bg);
  border: 1.5px solid var(--inp-border);
  box-shadow: inset 0 1px 2px rgba(28, 36, 52, 0.05);
}

.si:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.idbadge {
  font-size: 18px;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, rgba(21, 101, 192, 0.12), rgba(232, 238, 246, 0.95));
  border: 1px solid rgba(21, 101, 192, 0.32);
  color: var(--primary);
  font-weight: var(--weight-bold);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 0;
}

body.dark-theme .idbadge {
  color: #f0cc70;
  background: rgba(201, 150, 42, 0.14);
  border-color: rgba(201, 150, 42, 0.42);
  -webkit-text-fill-color: currentColor;
  animation: none;
  filter: none;
}

body.dark-theme .sidebar .cid,
body.dark-theme .sidebar .cc .cid {
  color: #e8c96d;
  -webkit-text-fill-color: currentColor;
  background: none;
  background-image: none;
  animation: none;
  transition: none;
  filter: none;
  text-shadow: none;
  opacity: 1;
}

body.dark-theme .sidebar .cc.active .cid {
  color: #ffe97a;
}

body.dark-theme .sidebar .cc {
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

/* ── Tables & data ──────────────────────────────────────────── */
:root .ptable {
  background: var(--card);
}

:root .ptable th {
  background: var(--card2);
  color: var(--primary);
  font-family: var(--font-ui);
  font-weight: var(--weight-semibold);
}

:root .ptable td {
  color: var(--text) !important;
  font-weight: var(--weight-regular);
}

:root .ptable tr:nth-child(even) td {
  background: var(--bg);
}

:root .ptable tr:hover td {
  background: var(--primary-muted);
}

:root .welcome h2 {
  color: var(--primary);
  font-weight: var(--weight-semibold);
}

:root .welcome p {
  color: var(--text-dim);
  font-weight: var(--weight-regular);
}

:root .idbadge {
  color: var(--primary);
  border-color: rgba(21, 101, 192, 0.32);
}

/* ── Modals & toast ─────────────────────────────────────────── */
.toast {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
  color: var(--primary);
}

.moverlay {
  background: rgba(28, 36, 52, 0.55);
  backdrop-filter: blur(6px);
}

.modal {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.modal h3 {
  color: var(--primary);
  font-weight: var(--weight-semibold);
}

/* ── Premium marketing modal — calmer ─────────────────────── */
.premium-modal-overlay {
  background: rgba(28, 36, 52, 0.5);
}

.premium-marketing-modal {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.premium-marketing-modal::before {
  display: none;
}

.premium-marketing-modal h3 {
  color: var(--primary);
}

/* ── Booking hub titles ─────────────────────────────────────── */
.book-hub-title {
  color: var(--primary);
  letter-spacing: 0.08em;
}

body.dark-theme .book-hub-title {
  color: var(--accent-gold-soft);
}
