@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

body {
  font-family: 'Poppins', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar for Webkit Browsers */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #1e1e1e;
}
::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #4a4a4a;
}

/* ── Theme Color System ──────────────────────────────────── */
/*
  Dark:  #121212 base — neutral charcoal, not blue-tinted
  Light: #fafafa base — warm off-white

  Tailwind slate classes are remapped per theme below.
  Accent colors (cyan, blue, green, red, yellow) are unchanged.
*/

/* ── Sidebar theme variables ─────────────────────────────── */
.app-sidebar {
  --sb-bg: #111111;
  --sb-border: rgba(255, 255, 255, 0.06);
  --sb-text: #94a3b8;          /* slate-400 */
  --sb-text-strong: #e2e8f0;   /* slate-200 */
  --sb-text-muted: #64748b;    /* slate-500 */
  --sb-active-text: #ffffff;
  --sb-active-bg: rgba(255, 255, 255, 0.10);
  --sb-hover-bg: rgba(255, 255, 255, 0.05);
  --sb-popover-bg: #1a1a1a;
}
[data-theme="light"] .app-sidebar {
  --sb-bg: #ffffff;
  --sb-border: rgba(0, 0, 0, 0.08);
  --sb-text: #475569;          /* slate-600 */
  --sb-text-strong: #1e293b;   /* slate-800 */
  --sb-text-muted: #94a3b8;    /* slate-400 */
  --sb-active-text: #0f172a;
  --sb-active-bg: rgba(0, 0, 0, 0.05);
  --sb-hover-bg: rgba(0, 0, 0, 0.04);
  --sb-popover-bg: #ffffff;
}

/* ── Dark Theme (default) ───────────────────────────────── */
html, body { background-color: #121212; color: #e8e8e8; }

[data-theme="dark"] { background-color: #121212; color: #e8e8e8; }
[data-theme="dark"] body { background-color: #121212; }

[data-theme="dark"] ::-webkit-scrollbar-track { background: #1e1e1e; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3a3a3a; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #4a4a4a; }

/* Backgrounds */
[data-theme="dark"] .bg-slate-900   { background-color: #121212 !important; }
[data-theme="dark"] .bg-slate-800   { background-color: #1e1e1e !important; }
[data-theme="dark"] .bg-slate-700   { background-color: #2a2a2a !important; }
[data-theme="dark"] .bg-slate-600   { background-color: #383838 !important; }

/* Opacity variants */
[data-theme="dark"] .bg-slate-900\/50 { background-color: rgb(18 18 18 / 0.5) !important; }
[data-theme="dark"] .bg-slate-800\/50 { background-color: rgb(30 30 30 / 0.5) !important; }
[data-theme="dark"] .bg-slate-800\/95 { background-color: rgb(30 30 30 / 0.95) !important; }
[data-theme="dark"] .bg-slate-700\/80 { background-color: rgb(42 42 42 / 0.8) !important; }

/* Text */
[data-theme="dark"] .text-white     { color: #f5f5f5 !important; }
[data-theme="dark"] .text-slate-200 { color: #e0e0e0 !important; }
[data-theme="dark"] .text-slate-300 { color: #bdbdbd !important; }
[data-theme="dark"] .text-slate-400 { color: #9e9e9e !important; }
[data-theme="dark"] .text-slate-500 { color: #757575 !important; }

/* Borders */
[data-theme="dark"] .border-slate-700 { border-color: #333333 !important; }
[data-theme="dark"] .border-slate-600 { border-color: #424242 !important; }

/* Form inputs — borderless filled look (border shows only on focus) */
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background-color: #2a2a2a !important;
  color: #e0e0e0 !important;
  border-color: transparent !important;
}
[data-theme="dark"] input:focus, [data-theme="dark"] select:focus, [data-theme="dark"] textarea:focus {
  border-color: #7cacf8 !important;
}

/* ── Light Theme ─────────────────────────────────────────── */
[data-theme="light"] { background-color: #fafafa; color: #121212; }
[data-theme="light"] body { background-color: #fafafa; }

[data-theme="light"] ::-webkit-scrollbar-track { background: #f0f0f0; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c2c2c2; }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: #a0a0a0; }

/* Backgrounds */
[data-theme="light"] .bg-slate-900   { background-color: #fafafa !important; }
[data-theme="light"] .bg-slate-800   { background-color: #ffffff !important; }
[data-theme="light"] .bg-slate-700   { background-color: #f0f0f0 !important; }
[data-theme="light"] .bg-slate-600   { background-color: #e0e0e0 !important; }

/* Opacity variants */
[data-theme="light"] .bg-slate-900\/50 { background-color: rgb(255 255 255 / 0.95) !important; }
[data-theme="light"] .bg-slate-800\/50 { background-color: rgb(255 255 255 / 0.95) !important; }
[data-theme="light"] .bg-slate-800\/95 { background-color: rgb(255 255 255 / 0.95) !important; }
[data-theme="light"] .bg-slate-700\/80 { background-color: rgb(240 240 240 / 0.8) !important; }

/* Text */
[data-theme="light"] .text-white     { color: #121212 !important; }
[data-theme="light"] .text-slate-200 { color: #212121 !important; }
[data-theme="light"] .text-slate-300 { color: #424242 !important; }
[data-theme="light"] .text-slate-400 { color: #616161 !important; }
[data-theme="light"] .text-slate-500 { color: #757575 !important; }

/* Borders */
[data-theme="light"] .border-slate-700 { border-color: #e0e0e0 !important; }
[data-theme="light"] .border-slate-600 { border-color: #bdbdbd !important; }

/* Form inputs — borderless filled look (border shows only on focus) */
[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea {
  background-color: #f5f5f5 !important;
  color: #121212 !important;
  border-color: transparent !important;
}
[data-theme="light"] input:focus, [data-theme="light"] select:focus, [data-theme="light"] textarea:focus {
  border-color: #7cacf8 !important;
}

/* ── Global UI consistency ───────────────────────────────── */

/* 1. Bordered panels need no background fill — border provides structure */
:not(input):not(select):not(textarea):not(button):not(.modal-panel).bg-slate-800.border,
:not(input):not(select):not(textarea):not(button):not(.modal-panel).bg-slate-700.border {
  background-color: transparent !important;
}

/* Modals always keep their background */
.modal-panel { background-color: #1e1e1e !important; }
[data-theme="light"] .modal-panel { background-color: #ffffff !important; }

/* 2. Remove divide lines — use spacing/padding for separation instead */
.divide-y > * + *,
.divide-x > * + * { border-color: transparent !important; }

/* 3. Table rows: subtle separator only on hover, no divide lines */
tbody tr + tr { border-top: none !important; }
tbody tr:hover { background-color: rgba(124, 172, 248, 0.04) !important; }

/* Cards: kill /50 opacity — let theme CSS set the right solid color */
.bg-slate-800\/50  { background-color: #1e1e1e !important; } /* overridden by light theme below */
.bg-slate-900\/50  { background-color: #1e1e1e !important; }
.bg-slate-900\/30  { background-color: #1e1e1e !important; }
.bg-slate-900\/70  { background-color: #1e1e1e !important; }
.bg-slate-900\/80  { background-color: #1e1e1e !important; }

[data-theme="light"] .bg-slate-800\/50 { background-color: #ffffff !important; }
[data-theme="light"] .bg-slate-900\/50 { background-color: #ffffff !important; }
[data-theme="light"] .bg-slate-900\/30 { background-color: #f5f5f5 !important; }
[data-theme="light"] .bg-slate-900\/70 { background-color: #e8e8e8 !important; }
[data-theme="light"] .bg-slate-900\/80 { background-color: #e8e8e8 !important; }

/* Standardise border-radius */
.rounded-md { border-radius: 0.75rem !important; }  /* → rounded-xl (12px) */
.rounded-lg { border-radius: 0.75rem !important; }  /* → rounded-xl (12px) */

/* Modal */
.rounded-lg[role="dialog"],
[class*="modal"] .rounded-lg { border-radius: 1rem !important; }

/* ── Semibold & Bold text follow theme ───────────────────── */
[data-theme="dark"] .font-semibold,
[data-theme="dark"] .font-bold { color: #f5f5f5; }
[data-theme="light"] .font-semibold:not([class*="text-"]),
[data-theme="light"] .font-bold:not([class*="text-"]) { color: #121212; }

/* Keep text white on primary/colored buttons and status elements in light mode */
[data-theme="light"] button.bg-cyan-600,
[data-theme="light"] button.bg-green-600,
[data-theme="light"] button.bg-red-600,
[data-theme="light"] button.bg-blue-600,
[data-theme="light"] button.bg-indigo-600,
[data-theme="light"] button.bg-amber-600,
[data-theme="light"] button[class*="bg-cyan-"],
[data-theme="light"] button[class*="bg-green-"],
[data-theme="light"] button[class*="bg-red-"],
[data-theme="light"] button[class*="bg-blue-"],
[data-theme="light"] button[class*="bg-indigo-"],
[data-theme="light"] button[class*="bg-emerald-"],
[data-theme="light"] .bg-cyan-600 button,
[data-theme="light"] .bg-green-600 button,
[data-theme="light"] .bg-red-600 button,
[data-theme="light"] .bg-emerald-600,
[data-theme="light"] .bg-green-600,
[data-theme="light"] .bg-red-600,
[data-theme="light"] .bg-cyan-600 {
  color: #ffffff !important;
}


/* Animations */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.animate-fade-in {
  animation: fade-in 0.3s ease-in-out forwards;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
    animation: fade-in-up 0.5s ease-out forwards;
}

/* Public landing page. Scoped colors stay legible in either app theme. */
.landing-page {
  --landing-bg: #fafafa;
  --landing-surface: #ffffff;
  --landing-text: #17212b;
  --landing-muted: #475569;
  --landing-border: #dce5e9;
  --landing-soft: #e7f6f8;
  --landing-accent: #0e7490;
  min-height: 100vh;
  background: var(--landing-bg);
  color: var(--landing-text);
}
[data-theme="dark"] .landing-page {
  --landing-bg: #121212;
  --landing-surface: #1e1e1e;
  --landing-text: #f5f5f5;
  --landing-muted: #bdbdbd;
  --landing-border: #3b4249;
  --landing-soft: #123840;
  --landing-accent: #67e8f9;
}
.landing-page button, .landing-page a { -webkit-tap-highlight-color: transparent; }
.landing-page :is(a, button):focus-visible { outline: 3px solid #0e7490; outline-offset: 3px; }
.landing-nav {
  width: min(1160px, 100%);
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}
.landing-nav img { display: block; width: 104px; height: auto; }
.landing-sign-in {
  color: var(--landing-text);
  font-size: 14px;
  font-weight: 700;
  padding: 9px 4px;
}
.landing-sign-in:hover, .landing-footer a:hover { text-decoration: underline; }
.landing-hero { text-align: center; padding: 64px 20px 88px; }
.landing-eyebrow {
  display: inline-block;
  border: 1px solid #95d5de;
  border-radius: 100px;
  background: var(--landing-soft);
  color: #155e75;
  padding: 7px 12px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}
[data-theme="dark"] .landing-eyebrow { color: #a5f3fc; border-color: #236273; }
.landing-hero h1 {
  max-width: 750px;
  margin: 22px auto 0;
  color: var(--landing-text);
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  line-height: 1.12;
  letter-spacing: -.045em;
  font-weight: 700;
}
.landing-hero h1 span { color: #0e7490; }
[data-theme="dark"] .landing-hero h1 span { color: #84c5ec; }
.landing-hero > p:not(.landing-reassurance) {
  max-width: 570px;
  margin: 22px auto 0;
  color: var(--landing-muted);
  font-size: 18px;
  line-height: 1.65;
}
.landing-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }
.landing-actions :is(a, button) {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .15s, transform .15s;
}
.landing-actions :is(a, button):active { transform: scale(.98); }
.landing-primary, [data-theme="light"] .landing-primary {
  background: #0e7490;
  color: #ffffff !important;
}
.landing-primary:hover { background: #155e75; }
.landing-secondary {
  background: var(--landing-surface);
  color: var(--landing-text);
  border: 1px solid var(--landing-border);
}
.landing-secondary:hover { background: var(--landing-soft); }
.landing-reassurance {
  margin: 14px auto 0;
  color: var(--landing-muted);
  font-size: 13px;
  line-height: 1.5;
}
.landing-preview {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px;
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 48px;
  border: 1px solid var(--landing-border);
  border-radius: 28px;
  background: var(--landing-surface);
}
.landing-preview-copy .landing-eyebrow { margin-bottom: 18px; }
.landing-preview-copy h2 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.2;
  letter-spacing: -.04em;
  font-weight: 700;
}
.landing-preview-copy > p { color: var(--landing-muted); line-height: 1.7; margin-top: 15px; }
.landing-preview-points { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; font-size: 14px; font-weight: 600; }
.landing-app-preview {
  overflow: hidden;
  border-radius: 17px;
  border: 1px solid var(--landing-border);
  background: var(--landing-bg);
  box-shadow: 0 22px 50px rgba(15, 23, 42, .12);
  text-align: left;
  font-family: inherit;
}
.landing-app-top {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--landing-border);
  padding: 12px 18px;
  color: var(--landing-muted);
  font-size: 11px;
}
.landing-app-brand { color: #0e7490; font-size: 18px; font-weight: 700; letter-spacing: -.05em; }
.landing-app-avatar {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #cceef2;
  color: #155e75;
  font-weight: 700;
}
.landing-app-content { padding: 22px; }
.landing-app-heading { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.landing-app-heading strong { font-size: 17px; }
.landing-app-heading span { color: var(--landing-muted); font-size: 11px; }
.landing-app-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 12px; }
.landing-app-stack { display: flex; flex-direction: column; gap: 12px; }
.landing-app-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border: 1px solid var(--landing-border);
  border-radius: 12px;
  background: var(--landing-surface);
  padding: 14px;
}
.landing-app-card-label { color: #0e7490; font-size: 9px; font-weight: 700; letter-spacing: .1em; }
[data-theme="dark"] .landing-app-card-label { color: #67e8f9; }
.landing-app-card strong { font-size: 12px; line-height: 1.4; }
.landing-app-card small { color: var(--landing-muted); font-size: 10px; }
.landing-app-progress { height: 6px; margin-top: 4px; border-radius: 20px; background: var(--landing-soft); }
.landing-app-progress span { display: block; width: 67%; height: 100%; border-radius: inherit; background: #0e7490; }
.landing-app-task { display: flex; align-items: center; gap: 7px; color: var(--landing-muted); font-size: 10px; }
.landing-app-task span { color: #0e7490; font-size: 14px; }
.landing-features { padding: 72px 20px 52px; text-align: center; }
.landing-features > p { color: var(--landing-muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.landing-features > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 18px; }
.landing-features > div > span { padding: 9px 14px; border: 1px solid var(--landing-border); border-radius: 100px; color: var(--landing-text); background: var(--landing-surface); font-size: 13px; font-weight: 600; }
.landing-footer { padding: 24px; color: var(--landing-muted); text-align: center; font-size: 14px; }
.landing-footer a { color: #0e7490; font-weight: 700; }
[data-theme="dark"] .landing-footer a { color: #67e8f9; }
@media (max-width: 720px) {
  .landing-hero { padding: 35px 20px 66px; }
  .landing-preview { grid-template-columns: 1fr; gap: 28px; padding: 26px; }
}
@media (max-width: 390px) {
  .landing-nav { padding: 12px 20px; }
  .landing-nav img { width: 88px; }
  .landing-hero { padding: 22px 20px 54px; }
  .landing-hero h1 { margin-top: 14px; font-size: 2.15rem; }
  .landing-hero > p:not(.landing-reassurance) { margin-top: 14px; font-size: 15px; line-height: 1.5; }
  .landing-actions { margin-top: 22px; }
  .landing-actions :is(a, button) { width: 100%; min-height: 46px; padding: 10px 18px; font-size: 14px; }
  .landing-preview { width: calc(100% - 28px); padding: 20px; }
  .landing-app-content { padding: 12px; }
  .landing-app-grid { gap: 7px; }
  .landing-app-card { padding: 9px; }
}
