/* FlowState champagne liquid glass theme. Loaded after the page layout styles. */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Instrument+Serif&display=swap');

:root {
  color-scheme: light;
  --bg: #f1eee7;
  --surface: #fcfaf5;
  --surface-2: #ede8dd;
  --text: #25241f;
  --text-2: #49463d;
  --text-3: #625c51;
  --border: #473d2c25;
  --border-2: #473d2c49;
  --accent: #6d502d;
  --accent-2: #51391e;
  --accent-soft: #604521;
  --accent-glow: #95714b27;
  --green: #286c53;
  --amber: #835825;
  --red: #a04440;
  --blue: #3a6070;
  --row-divider: #473d2c18;
  --row-hover: #71572c0c;
  --nav-hover: #71572c14;
  --nav-hover-txt: var(--text);
  --tag-bg: #71572c10;
  --glass: linear-gradient(145deg, #ffffffd4, #f9f5ebad);
  --chrome: #fbf9f3dc;
  --field: #ffffffad;
  --edge: #ffffffcb;
  --shadow: 0 12px 35px #56462c14, inset 0 1px 0 #ffffffda;
  --veil: radial-gradient(ellipse at 94% 0%, #dacbb4 0, transparent 52%),
    radial-gradient(ellipse at 5% 100%, #e8e5dd 0, transparent 54%),
    radial-gradient(ellipse at 70% 80%, #eae0d0 0, transparent 55%);
  --radius: 18px;
  --radius-sm: 12px;
  --champagne: #d5be97;
  --on-champagne: #292118;
  --display-font: 'Instrument Sans', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
}

html[data-theme="dark"], body.auth-page {
  color-scheme: dark;
  --bg: #151513;
  --surface: #22221f;
  --surface-2: #2c2b27;
  --text: #f6f1e8;
  --text-2: #dfd9ce;
  --text-3: #bdb7aa;
  --muted: var(--text-3);
  --muted-light: #b7afa1;
  --border: #eee2cb26;
  --border-2: #eee2cb45;
  --accent: #d8c3a0;
  --accent-2: #eee0c8;
  --accent-soft: #e6d0aa;
  --accent-light: var(--accent-soft);
  --accent-dark: var(--accent-2);
  --accent-glow: #d6b88328;
  --green: #a7c8b1;
  --amber: #debf8a;
  --red: #e9a7a1;
  --blue: #b1cbd2;
  --row-divider: #fff6e614;
  --row-hover: #fff6e60c;
  --nav-hover: #fff6e612;
  --nav-hover-txt: var(--text);
  --tag-bg: #fff2dc16;
  --glass: linear-gradient(145deg, #2b2a25eb, #20201dcc);
  --chrome: #1c1c19dc;
  --field: #0e0e0d60;
  --edge: #f5e8d02e;
  --shadow: 0 12px 35px #0a09083b, inset 0 1px 0 #fff5e512;
  --veil: radial-gradient(ellipse at 86% 0%, #3b3326 0, transparent 51%),
    radial-gradient(ellipse at 1% 100%, #252a29 0, transparent 55%),
    radial-gradient(ellipse at 80% 96%, #282522 0, transparent 62%);
}

body[data-role] {
  --accent: #6d502d;
  --accent-2: #51391e;
  --accent-soft: #604521;
  --accent-glow: #95714b27;
}

html[data-theme="dark"] body[data-role] {
  --accent: #d8c3a0;
  --accent-2: #eee0c8;
  --accent-soft: #e6d0aa;
  --accent-glow: #d6b88328;
}

body {
  color: var(--text);
  background: var(--veil), var(--bg);
  background-attachment: fixed;
}

body, button, input, textarea, select {
  font-family: 'Instrument Sans', system-ui, sans-serif;
}

h1, h2, h3, .logo-name, .logo-text, .page-title, .stat-value, .score-num,
.chart-title, .section-title, .modal-title, .timer-display, [style*="Syne"] {
  font-family: var(--display-font) !important;
  letter-spacing: -.035em;
}

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sidebar, .topbar, .bottom-nav, .more-menu {
  background: var(--chrome);
  border-color: var(--edge);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  backdrop-filter: blur(22px) saturate(135%);
}

.sidebar { box-shadow: 1px 0 25px #17141018; }
.sidebar-logo { padding-block: 21px; }
.sidebar-section { padding-top: 16px; }
.sidebar-label { font-weight: 700; letter-spacing: .1em; }

.logo-icon, .logo-mark {
  background: linear-gradient(145deg, #f2e5ce 2%, #c7b08d 55%, #a09079);
  color: #2a2218;
  border: 1px solid #ffffff92;
  border-radius: 13px;
  box-shadow: 0 4px 15px #0a09082b, inset 0 1px 0 #ffffffbd;
}

.logo-name span, .logo-text span { color: var(--accent-soft); }
.avatar { background: #d8c3a0; color: #2c2318; }
.nav-item { min-height: 40px; border-radius: 11px; font-weight: 600; }
.nav-item.active, .bottom-nav-item.active {
  color: var(--accent-soft);
  background: var(--accent-glow);
  border-color: var(--edge);
  box-shadow: inset 0 1px 0 var(--edge);
}
.nav-item.active svg { stroke-width: 2.2; }
.nav-badge { background: var(--accent-glow); color: var(--accent-soft); }

.topbar { box-shadow: 0 2px 18px #1714100b; }
.page-title { font-size: 20px; font-weight: 700; }
.icon-btn, .theme-toggle, .hamburger {
  border: 1px solid var(--edge);
  background: var(--field);
  border-radius: 12px;
  color: var(--text-2);
}
.icon-btn:hover, .theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.new-task-shortcut, .new-task-shortcut:hover {
  background: var(--champagne);
  color: var(--on-champagne);
  border-color: #f0dfb998;
}
.mobile-search-toggle { display: none; }
.topbar-search-wrap { position: relative; width: clamp(160px, 19vw, 280px); }
.topbar-search-wrap .search-input { width: 100%; max-width: none; }
#global-search-results { box-shadow: var(--shadow); }

.stat-card, .chart-card, .kanban-col, .kanban-card, .goal-card,
.habit-row, .notif-item, .session-row, .crm-mini-stat, .crm-table-shell, .role-banner-card {
  background: var(--glass);
  border-color: var(--edge);
  box-shadow: var(--shadow);
}

.stat-card, .chart-card, .goal-card { border-radius: var(--radius); }
.stat-card { padding: 17px 19px; }
.stat-card::before {
  background: linear-gradient(90deg, transparent, var(--stat-accent, var(--accent)), transparent);
  height: 1px;
  opacity: .75;
}
.stat-card.green { --stat-accent: var(--green); }
.stat-card.red { --stat-accent: var(--red); }
.stat-card.amber { --stat-accent: var(--amber); }
.stat-card.blue { --stat-accent: var(--blue); }
.stat-label { color: var(--text-3); font-size: 11px; font-weight: 700; margin-bottom: 7px; }
.stat-value { font-size: clamp(28px, 3.2vw, 38px); font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--text-3); }
.chart-title, .section-title { color: var(--text); font-size: 17px; }

.dashboard-hero {
  grid-template-columns: minmax(0, 1fr) minmax(240px, .58fr);
  gap: 12px;
  margin-bottom: 14px;
  align-items: stretch;
}
.dashboard-hero:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.dashboard-hero > * { min-width: 0; }
.role-banner-card { padding: 12px 15px; border-radius: 17px; }
.role-banner-icon { font-size: 18px; }
.role-banner-title { color: var(--text) !important; }
.dashboard-hero .role-banner-card { background: var(--glass) !important; border-color: var(--edge) !important; }
.role-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
#stat-tasks-pending { color: var(--red) !important; }
.stat-value.accent, .score-num { color: var(--accent-soft); }
.daily-productivity { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 18px; align-items: center; }
.daily-productivity-score { text-align: center; }
.daily-productivity-details { min-width: 0; }
.role-banner-desc { color: var(--text-3); }
.widget-manager-card { padding: 13px 15px; border-radius: 17px; }
.widget-manager-card.collapsed .widget-manager-summary,
.widget-manager-card.collapsed .widget-manager-instructions { display: none; }
.widget-manager-head { gap: 10px; }
.widget-manager-head .section-title { font-size: 15px; }
.widget-manager-toggle { white-space: nowrap; }
.workspace-scope-card { padding: 12px 16px; }
.workspace-scope-card .section-header { margin-bottom: 0; }
.workspace-scope-card .section-title { font-size: 15px; }
.workspace-scope-card .form-row { grid-template-columns: minmax(110px, 160px) minmax(150px, 220px); }

.fs-greeting {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 120px;
  margin-bottom: 14px;
  padding: 22px 28px;
  color: #f9f2e6;
  border: 1px solid #e7cfa74d;
  border-radius: 20px;
  box-shadow: 0 12px 28px #16110b32, inset 0 1px 0 #f8e8cc35;
  background:
    radial-gradient(ellipse at 96% -25%, #a6895b96, transparent 64%),
    linear-gradient(115deg, #23221e, #322e26 65%, #423a2c);
}

.fs-greeting::after {
  content: '';
  position: absolute;
  z-index: -1;
  right: -42px;
  top: -140px;
  width: 315px;
  height: 275px;
  border: 1px solid #f4dfb989;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0d6ac56, transparent 65%, #e1c59726);
  box-shadow: inset 0 0 32px #f1d3a22e, 0 14px 50px #110f0b36;
  transform: rotate(-34deg);
  pointer-events: none;
}

.fs-greeting h2,
.auth-page h1 {
  font-family: var(--serif) !important;
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.03;
}

.fs-greeting h2 {
  max-width: 85%;
  font-size: clamp(34px, 3.5vw, 53px);
  overflow-wrap: anywhere;
}

.btn, .crm-action-btn, .crm-tabbtn { border-radius: 11px; font-weight: 700; }
.btn-primary, body.auth-page .btn:not(.btn-secondary) {
  background: linear-gradient(135deg, #f0e2c8, var(--champagne));
  color: var(--on-champagne);
  border: 1px solid #f4e3c58e;
  box-shadow: 0 4px 16px #100d092c, inset 0 1px 0 #ffffffb5;
}
.btn-primary:hover, body.auth-page .btn:not(.btn-secondary):hover {
  background: #ead8b7;
  color: var(--on-champagne);
}
.btn-secondary { background: var(--field); border-color: var(--edge); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-danger { color: var(--red); }
.btn:disabled, .btn-primary:disabled { opacity: .52; cursor: not-allowed; transform: none; }

.form-input, .form-select, .form-textarea, .filter-select, .search-input,
.auth-page input:not([type="hidden"]):not([type="checkbox"]), .auth-page select {
  background: var(--field);
  border: 1px solid var(--border-2);
  border-radius: 11px;
  color: var(--text);
}
.form-input:focus, .form-select:focus, .form-textarea:focus, .search-input:focus,
.auth-page input:focus, .auth-page select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: 1; }
select option { color: var(--text); background: var(--surface); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
.form-label, .data-table th { color: var(--text-2); }
.data-table th { letter-spacing: .045em; }
.badge, .tag, .chip { border-radius: 999px; }
.kanban-col { border-radius: 18px; }
.kanban-card { border-radius: 13px; background: var(--surface); }
.modal-overlay { background: #12110f9e; backdrop-filter: blur(6px); }
.modal, .confirm-modal { background: var(--surface); border-color: var(--edge); box-shadow: var(--shadow); }

#fs-toasts {
  position: fixed;
  z-index: 10000;
  bottom: 24px;
  right: 24px;
  width: min(350px, calc(100% - 48px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.fs-toast {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-inline-start: 3px solid var(--toast-accent);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 14px;
  padding: 13px 16px;
  overflow-wrap: anywhere;
  animation: glass-enter .18s ease-out;
}

body.auth-page {
  min-height: 100vh;
  padding: 28px 16px;
  background:
    radial-gradient(ellipse at 20% 18%, #544733 0, transparent 52%),
    radial-gradient(ellipse at 85% 78%, #323633 0, transparent 44%),
    #151514;
  background-attachment: fixed;
}
body.auth-page::before {
  content: '';
  position: fixed;
  inset: auto;
  top: 12%;
  left: 50%;
  width: min(820px, 100vw);
  height: min(510px, 65vh);
  border: 1px solid #ebd3ae58;
  border-radius: 54% 46% 52% 48%;
  background: linear-gradient(153deg, #c9ad8370, #69584200 40%, #c8c5b83c);
  box-shadow: inset 0 0 50px #e9cc9a35, 0 25px 90px #0a090854;
  transform: translateX(-50%) rotate(-25deg);
  pointer-events: none;
}
body.auth-page::after { display: none; }
body.auth-page .card {
  position: relative;
  z-index: 1;
  max-width: 460px;
  padding: clamp(24px, 6vw, 42px);
  border: 1px solid var(--edge);
  border-radius: 23px;
  background: linear-gradient(155deg, #312e26e8, #22211eea 63%, #232522de);
  box-shadow: 0 26px 85px #09080686, inset 0 1px 0 #ffffff27;
  -webkit-backdrop-filter: blur(24px) saturate(130%);
  backdrop-filter: blur(24px) saturate(130%);
  animation: glass-enter .24s ease-out;
}
.auth-page .logo { margin-bottom: 25px; }
.auth-page h1 { font-size: clamp(38px, 7.5vw, 55px); color: var(--text); }
.auth-page .subtitle, .auth-page .footer-note { color: var(--text-3); }
.auth-page label { color: var(--text-2); }
.auth-page a, .auth-page .forgot-link { color: var(--accent-soft); }
.auth-page .btn-primary { min-height: 48px; border-radius: 12px; font-family: 'Instrument Sans', system-ui, sans-serif; }
.auth-page .btn-primary[style*="background"] { color: var(--text); }
.auth-page .error-msg, .auth-page .alert-error { background: #502a27; border-color: #edafa770; color: #f9d0ca; }
.auth-page .info-card, .auth-page .alert-info { background: #353128; border-color: var(--edge); color: var(--text-2); }
.auth-page .info-card :is(strong, p), .auth-page .notice-msg { color: var(--text-2); }

@keyframes glass-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .topbar { gap: 7px; padding-inline: 10px; }
  .page-title { font-size: 16px; }
  .topbar-actions { gap: 5px; }
  .mobile-search-toggle { display: inline-flex; flex-shrink: 0; }
  .topbar-search-wrap { display: none; }
  .topbar-search-wrap.mobile-search-open {
    display: block;
    width: auto;
    position: absolute;
    inset: calc(100% + 7px) 10px auto;
    min-width: 0;
    max-width: none;
    padding: 6px;
    border: 1px solid var(--edge);
    background: var(--surface);
    border-radius: 14px;
    box-shadow: var(--shadow);
  }
  .topbar-search-wrap .search-input { display: block; }
  #global-search-results { max-height: min(55vh, 360px); overflow-y: auto; }
  .topbar-company { min-width: 0 !important; max-width: 100px !important; }
  .topbar-company select { min-width: 0; }
  .dashboard-hero { grid-template-columns: minmax(0, 1fr); }
  .role-banner-card { padding: 10px 12px; }
  .role-banner-icon { position: static; transform: none; }
  .role-banner-copy, .role-banner-title { display: block; }
  .widget-manager-card { padding: 11px 13px; }
  .workspace-scope-card .section-header { display: grid; }
  .workspace-scope-card .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .workspace-scope-card .form-select { width: 100%; }
  .fs-greeting { min-height: 98px; padding: 18px; }
  .fs-greeting::after { right: -162px; }
  .stat-card { padding: 14px; }
  .daily-productivity { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .daily-productivity-score > :first-child { width: 68px !important; height: 68px !important; font-size: 21px !important; }
  .daily-productivity-details .chart-title { font-size: 15px; }
  .role-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottom-nav { border: 1px solid var(--edge); box-shadow: var(--shadow); }
  .bottom-nav-item.active { color: var(--accent-soft); }
  #fs-toasts { bottom: calc(86px + env(safe-area-inset-bottom)); right: 12px; width: min(350px, calc(100% - 24px)); }
}

@media (max-width: 359px) {
  .topbar-actions { gap: 4px; }
  .topbar-actions :is(.icon-btn, .theme-toggle, .avatar) { width: 32px !important; height: 32px !important; }
  .topbar-company { max-width: 72px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
