/* ============================
   FreelanceOS UI Kit (2026-ready)
   HTML5 + CSS only (optional JS for toggles)
   ============================ */

/* --- CSS Reset (lightweight) --- */
*, *::before, *::after { box-sizing: border-box; }
html:focus-within { scroll-behavior: smooth; }
body { margin: 0; }
img, svg, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(59,130,246,.9); outline-offset: 2px; }

/* --- Theme tokens --- */
:root{
  /* Let UA style form controls appropriately */
  color-scheme: light dark; /* MDN best practice for UA controls */ 
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;

  --shadow-sm: 0 2px 10px rgba(15, 23, 42, .08);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, .12);

  --gap-1: 8px;
  --gap-2: 12px;
  --gap-3: 16px;
  --gap-4: 20px;
  --gap-5: 28px;

  --container: 1200px;

  /* Light theme */
  --bg: #F4F7FB; /* slightly warmer, good contrast with surface */
  --surface: #FFFFFF;
  --surface-2: #F1F5FB; /* subtle elevation tone */
  --text: #0B1220; /* strong, high-contrast text */
  --muted: #475569; /* readable muted tone */
  --muted-2: #6B7280; /* secondary muted */
  --border: rgba(11,18,32,.10);

  --primary: #1E40AF; /* Indigo 800 - clear CTA color */
  --primary-600: #1E3A8A;
  --success: #15803D; /* green-600 */
  --warning: #B45309; /* amber-700 for visibility */
  --danger: #B91C1C; /* stronger danger color */

  --chip: rgba(30,64,175,.10);
  --ring: rgba(30,64,175,.24);

  --sidebar: #0b1220;
  --sidebar-text: rgba(255,255,255,.90);
  --sidebar-muted: rgba(255,255,255,.62);
  --sidebar-hover: rgba(255,255,255,.08);

  --glass: rgba(255,255,255,.72);
  --glass-border: rgba(255,255,255,.40);
}

/* Dark theme (auto via prefers-color-scheme) */
@media (prefers-color-scheme: dark){
  :root{
    --bg: #071024; /* deep navy background */
    --surface: #071428; /* surface slightly lighter than background */
    --surface-2: #0b2038; /* elevated surface */
    --text: rgba(255,255,255,.94);
    --muted: rgba(255,255,255,.72);
    --muted-2: rgba(255,255,255,.58);
    --border: rgba(255,255,255,.08);

    --sidebar: #061021;
    --glass: rgba(255,255,255,.03);
    --glass-border: rgba(255,255,255,.06);
  }
}

/* Manual theme override (optional JS sets data-theme on <html>) */
html[data-theme="light"]{
  color-scheme: light;
}
html[data-theme="dark"]{
  color-scheme: dark;
  --bg: #070b14;
  --surface: #0b1220;
  --surface-2: #0f1a2e;
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.72);
  --muted-2: rgba(255,255,255,.58);
  --border: rgba(255,255,255,.12);
  --sidebar: #070b14;
  --glass: rgba(11,18,32,.72);
  --glass-border: rgba(255,255,255,.10);
}

body{
  font-family: 'Inter', var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* Professional landing tweaks */
h1, h2, h3 { color: var(--text); margin-top:0; }
h1 { font-size: 2.1rem; letter-spacing: -0.02em; }
h2 { font-size: 1.4rem; }
.muted { color: var(--muted); }

.home-hero{ display:flex; gap:24px; align-items:center; background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.45)); padding:34px; border-radius:16px; }
.hero-copy{ max-width: 720px; }
.hero-image{ width:320px; height:200px; border-radius:12px; background: linear-gradient(135deg, rgba(30,64,175,.12), rgba(16,185,129,.06)); display:flex; align-items:center; justify-content:center; color:var(--muted); font-weight:700; }

/* Public header (landing) */
.public-header{ background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,.35)); border-bottom: 1px solid rgba(11,18,32,.04); position: sticky; top:0; z-index:90; backdrop-filter: blur(8px); }
.public-header .public-header-inner{ display:flex; align-items:center; justify-content:space-between; gap:18px; padding:14px 12px; max-width:var(--container); margin:0 auto; }
.brand-link{ display:flex; align-items:center; gap:12px; text-decoration:none; color:var(--text); }
.brand-mark{ border-radius:10px; background:transparent; }
.brand-title{ font-weight:800; font-size:1rem; }
.brand-sub{ font-size:.85rem; color:var(--muted); }
.nav-toggle{ display:none; background:transparent; border:0; font-size:18px; color:var(--muted); padding:8px; border-radius:8px; }
.public-nav{ display:flex; gap:14px; align-items:center; }
.public-nav a{ color:var(--muted); padding:8px 10px; border-radius:8px; }
.public-nav a:hover{ color:var(--text); background:var(--surface-2); }
.hero-cta{ display:inline-block; padding:12px 18px; border-radius:10px; background:var(--primary); color:#fff; font-weight:700; box-shadow: 0 8px 24px rgba(14,54,105,.06); }

/* Mobile header collapse */
@media (max-width:880px){
  .nav-toggle{ display:inline-flex; }
  .public-nav{ display:none; position:absolute; left:12px; right:12px; top:64px; background:var(--surface); padding:12px; border-radius:10px; box-shadow:var(--shadow-md); flex-direction:column; }
  body.nav-open .public-nav{ display:flex; }
  .home-hero{ flex-direction:column-reverse; gap:18px; }
  .hero-image{ width:100%; height:220px; }
}

/* Hero refinements */
.home-hero{ padding:28px; }
.hero-copy h1{ font-size:2.2rem; line-height:1.05; margin:0; }
.hero-ctas{ display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
.hero-features{ list-style:none; padding:0; display:flex; gap:12px; flex-wrap:wrap; margin:0; }
.hero-features li{ color:var(--muted); }

/* Plan selected state (polished) */
.plan-card.selected{ border-color: var(--primary); box-shadow: 0 18px 40px rgba(14,54,105,.08); transform: translateY(-6px); }

/* Testimonials */
.testimonial { padding:12px; border-radius:10px; background:var(--surface); border:1px solid var(--border); }
.testimonial .author { font-weight:700; margin-top:8px; }

/* Layout tweaks */
.home-grid { gap:28px; }
.home-features .feature-card { min-height:78px; }
/* Two-column layout for landing pages */
.home-grid{
  display:grid;
  grid-template-columns: 1fr 320px;
  gap:28px;
  align-items:start;
}
.home-grid > div{ min-width:0; }
aside{ max-width:320px; }

/* Buttons and form controls */
.btn{ display:inline-block; padding:10px 14px; border-radius:10px; background:transparent; border:1px solid var(--border); color:var(--text); text-decoration:none; cursor:pointer }
.btn.primary{ background:var(--primary); color:#fff; border-color:transparent }
.hero-cta{ font-weight:800 }

.lead-form{ display:inline-flex; gap:8px; align-items:center; }
.lead-form input[type="email"]{ padding:8px 10px; border-radius:8px; border:1px solid var(--border); background:var(--surface); }
.lead-form button{ padding:8px 10px; border-radius:8px; border:0; background:var(--primary); color:#fff; cursor:pointer }

/* Feature cards inside landing */
.home-features{ display:grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap:12px; margin-top:12px }
.feature-card{ padding:12px; border-radius:12px; background:var(--surface); border:1px solid var(--border); box-shadow:var(--shadow-sm); }

/* Sticky aside adjustments */
/* Align sidebar sticky offset with topbar height (68px) so menu doesn't drop */
aside > div{ position:sticky; top:68px }

@media (max-width:900px){
  .home-grid{ grid-template-columns: 1fr; }
  aside > div{ position:static }
}

/* Form controls (landing + admin-like forms) */
.form-group{ display:block; margin-bottom:12px; }
.form-label{ display:block; margin-bottom:8px; font-weight:700; color:var(--text); }
.form-control{ width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:var(--surface); color:var(--text); font-size:0.95rem; transition: border-color .12s, box-shadow .12s, transform .08s; }
.form-control:focus{ outline:0; border-color:var(--primary); box-shadow: 0 6px 24px rgba(11,54,150,.06); transform: translateY(-1px); }
.form-control[type="file"]{ padding:8px 10px; }
.form-actions{ display:flex; gap:12px; justify-content:flex-end; align-items:center; }
.form-help{ font-size:0.88rem; color:var(--muted); }

/* Smaller inputs inline */
.form-inline{ display:flex; gap:8px; align-items:center; }
.form-inline .form-control{ flex:1 }
/* Plan cards */
.plan-grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap:16px; margin-top:12px; }
.plan-card{ background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:18px; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s, border-color .12s; display:flex;flex-direction:column; gap:12px; }
.plan-card:hover{ transform: translateY(-6px); box-shadow: 0 20px 40px rgba(11,18,32,.08); border-color: rgba(30,64,175,.12); }
.plan-card.selected{ border:2px solid var(--primary); box-shadow: 0 22px 40px rgba(30,64,175,.08); }
.plan-card .title{ font-weight:800; font-size:1rem; }
.plan-card .price{ font-size:1.6rem; font-weight:900; color:var(--text); }
.plan-card .meta{ color:var(--muted); font-size:.95rem; }
.plan-card .features{ margin-top:8px; padding-left:16px; color:var(--muted); }
.plan-badge{ display:inline-block; padding:6px 10px; border-radius:999px; background:var(--chip); color:var(--primary); font-weight:700; font-size:.78rem; }
.plan-actions{ margin-top:auto; display:flex; gap:8px; align-items:center; }
.plan-actions .choose{ background:transparent; border:1px solid var(--border); padding:8px 10px; border-radius:8px; }
.plan-actions .choose.primary{ background:var(--primary); color:#fff; border-color:transparent; }

@media (max-width:600px){
  .plan-card{ padding:14px; }
}

.feature-card{ transition: transform .18s ease, box-shadow .18s ease; }
.feature-card:hover{ transform: translateY(-6px); box-shadow: 0 12px 30px rgba(11,18,32,.08); }

.cta{ transition: transform .12s ease, box-shadow .12s ease; }
.cta:hover{ transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.site-links a{ color: var(--muted); margin-left:12px; }

/* Tighten layout for landing page */
.container{ padding-left:12px; padding-right:12px; }


/* --- Utilities --- */
.container{ max-width: var(--container); margin: 0 auto; padding: 0 var(--gap-4); }
.muted{ color: var(--muted); }
.small{ font-size: .92rem; color: var(--muted); }
.kbd{
  font-family: var(--mono);
  font-size: .85rem;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 10px;
  background: var(--surface-2);
}
.divider{ height: 1px; background: var(--border); margin: var(--gap-4) 0; }

/* --- Skip link (accessibility) --- */
.skip-link{
  position: absolute;
  left: -999px;
  top: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  z-index: 9999;
}
.skip-link:focus{ left: 10px; }

/* --- App Shell Layout (Grid) --- */
.app{
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: 68px 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  gap: 0;
}

/* Topbar */
.topbar{
  grid-area: topbar;
  position: sticky;
  top: 0;
  z-index: 50;
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  display: flex;
  align-items: center;
  gap: var(--gap-3);

  background: var(--glass);
    line-height: 1.6;
    font-size: 16px; /* base readable size */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  backdrop-filter: blur(10px);
}
.brand{
  display: none;
  .small{ font-size: .95rem; color: var(--muted); }
  align-items: center;
  gap: 10px;
  .card-title{ font-weight: 800; letter-spacing: -.01em; font-size: 1.02rem; }
  .card-sub{ color: var(--muted); font-size: .95rem; margin-top: 4px; }
  letter-spacing: .2px;
}
.brand-badge{
  width: 34px; height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--chip);
    font-size: .95rem; /* fallback replaced below for older browsers */
  border: 1px solid var(--border);
    font-weight: 600;
}

  .avatar{ width:36px; height:36px; border-radius:10px; object-fit:cover; }
.search{
  flex: 1;
    border-radius: 8px;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}
.search input{
  border: 0; outline: 0;
  width: 100%;
  background: transparent;
  color: var(--text);
}
.icon{
  width: 18px; height: 18px;
  color: var(--muted);
}

/* Topbar inner layout and profile */
.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: var(--gap-3);
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0;
}
.topbar-left{ display:flex; align-items:center; gap:12px; }
.topbar-menu{ display:none; }
.topbar-right{ display:flex; align-items:center; gap:12px; }
.profile{ display:flex; align-items:center; gap:8px; }
.avatar{ width:36px; height:36px; border-radius:6px; object-fit:cover; }
.profile-name{ font-size:.95rem; display:none; }

/* Sidebar footer */
.sidebar-footer{
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-footer .plan .row .small{ color: var(--sidebar-muted); }

/* Site footer */
.site-footer{ border-top:1px solid var(--border); background:var(--surface); padding:12px 16px; }
.site-footer-inner{
  display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; align-items:center; max-width:var(--container); margin:0 auto;
}
.site-copyright{ font-size:.9rem; color:var(--muted); }
.site-links{ display:flex; gap:12px; align-items:center; }

@media (min-width: 900px){
  .profile-name{ display:inline-block; }
}

/* Profile dropdown (details/summary) */
.profile-menu{ position: relative; }
.profile-menu summary{ list-style: none; cursor: pointer; }
.profile-menu summary::-webkit-details-marker{ display: none; }
.profile-button{ display:flex; align-items:center; gap:8px; border:0; background:transparent; padding:6px 8px; border-radius:8px; }
.profile-menu[open] .profile-button{ box-shadow: var(--shadow-sm); background: var(--surface-2); }
.profile-dropdown{ position: absolute; right: 0; margin-top: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-width: 160px; padding: 6px; box-shadow: var(--shadow-md); display: none; z-index: 60; }
.profile-menu[open] .profile-dropdown{ display: block; }
.dropdown-item{ display:block; padding: 8px 12px; color: var(--text); border-radius: 8px; }
.dropdown-item:hover{ background: var(--surface-2); }

/* Notifications dropdown (mirrors profile-dropdown behavior) */
.notifications{ position: relative; }
.notifications summary{ list-style: none; cursor: pointer; }
.notifications summary::-webkit-details-marker{ display: none; }
.notifications > summary{ display:inline-flex; align-items:center; gap:6px; padding:6px 8px; border-radius:8px; }
.notifications[open] > summary{ box-shadow: var(--shadow-sm); background: var(--surface-2); }
.notifications-dropdown{ position: absolute; right: 0; margin-top: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-width: 260px; padding: 6px; box-shadow: var(--shadow-md); display: none; z-index: 70; }
.notifications[open] .notifications-dropdown{ display: block; }

/* Ensure topbar allows dropdowns to overflow (avoid clipping) */
.topbar, .topbar-inner, .topbar-right{ overflow: visible; }

@media (max-width: 900px){
  .profile-dropdown{ right: 8px; left: auto; }
}

.top-actions{
  display: flex;
  align-items: center;
  gap: 10px;
}
.pill{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.avatar{
  width: 30px; height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(37,99,235,.25), rgba(16,185,129,.22));
  border: 1px solid var(--border);
}

/* Sidebar (navigation drawer style) */
.sidebar{
  grid-area: sidebar;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 16px;
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 14px;
}
.sidebar-logo{
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: .2px;
}
.sidebar-logo .mark{
  width: 36px; height: 36px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.12);
}
.sidebar small{ color: var(--sidebar-muted); }

/* Sidebar title and workspace inline styling */
.sidebar-title{ display:flex; align-items:center; gap:8px; }
.sidebar-title .app-name{ font-weight:900; font-size:1rem; color:var(--sidebar-text); }
.sidebar-title .sidebar-workspace{ font-size:0.85rem; color:var(--sidebar-muted); font-weight:600; margin-left:4px; }

/* Branding shown at top of sidebar nav */
.menu-brand{ display:block; padding:8px 12px; color:var(--sidebar-text); font-weight:800; margin-bottom:6px; border-bottom:1px solid rgba(255,255,255,.04); }
.menu-brand .menu-brand-name{ font-weight:900; }
.menu-brand .menu-brand-workspace{ color:var(--sidebar-muted); font-weight:600; font-size:0.85rem }

/* Hide duplicate workspace label in sidebar header (we show in nav) */
.sidebar-logo .sidebar-workspace{ display:none; }

.nav{
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav a{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--sidebar-text);
  text-decoration: none;
}
.nav a:hover{ background: var(--sidebar-hover); }
.nav a[aria-current="page"]{
  background: rgba(37,99,235,.20);
  border: 1px solid rgba(37,99,235,.22);
}
.nav .sub{
  margin-left: 10px;
  padding-left: 14px;
  border-left: 1px dashed rgba(255,255,255,.18);
}
.nav .sub a{ padding: 9px 12px; color: var(--sidebar-muted); }
.nav .sub a:hover{ color: var(--sidebar-text); }

.sidebar-footer{
  margin-top: auto;
  padding: 12px 10px 6px;
  display: grid;
  gap: 10px;
}
.plan{
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-md);
  padding: 12px;
}
.plan strong{ display:block; }
.plan .row{
  display:flex; align-items:center; justify-content:space-between;
  gap: 10px;
}

/* Plans: feature list and card tweaks */
.plan-features{ margin: 8px 0 0 0; padding-left: 18px; }
.plan-features li{ margin: 4px 0; }
.plan-features .sub-features{ margin: 6px 0 0 8px; padding-left: 16px; list-style: disc; }
.grid.cols-3 .card{ min-height: 220px; display:flex; }
.grid.cols-3 .card > div{ flex:1; }

/* Plan card ribbon (popular) */
.plan-card{ overflow: visible; }
.plan-card-ribbon{
  position: absolute;
  left: 12px;
  top: -10px;
  background: linear-gradient(90deg,var(--primary),var(--primary-600));
  color: white;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  font-size: .85rem;
}

.price-large{ font-size: 1.45rem; font-weight: 900; color: var(--text); }

/* Public home page styles */
.public-header{ background: linear-gradient(90deg, rgba(37,99,235,0.06), rgba(16,185,129,0.03)); padding: 18px 12px; }
.public-header .brand { font-weight:800; font-size:1.1rem; }
.public-header nav a{ color:var(--primary); font-weight:600; }
.home-hero{ background: linear-gradient(180deg, var(--surface), var(--surface-2)); border-radius: 14px; padding: 28px; box-shadow: var(--shadow-md); }
.home-grid{ display:grid; grid-template-columns: 1fr 320px; gap:20px; align-items:start; }
.home-features{ display:grid; grid-template-columns: repeat(2,1fr); gap:12px; }
.feature-card{ background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:14px; box-shadow: var(--shadow-sm); }
.cta{ display:inline-flex; gap:10px; align-items:center; padding:10px 16px; border-radius:12px; background:var(--primary); color:#fff; font-weight:700; }

@media (max-width:900px){
  .home-grid{ grid-template-columns: 1fr; }
  .home-features{ grid-template-columns: 1fr; }
}

/* Buttons */
.btn{ display:inline-flex; align-items:center; gap:8px; padding:8px 12px; border-radius:8px; border:1px solid var(--border); background:var(--surface); }
.btn.primary, .cta{ background:var(--primary); color:#fff; border-color:transparent; }
.pill{ background:transparent; border:1px solid var(--border); color:var(--text); }

/* Small responsive tweaks for public pages */
@media (max-width:600px){
  .public-header nav{ gap:10px; }
  .public-header { padding:12px; }

  /* Responsive navigation */
  .nav-toggle{ display:none; background:transparent; border:0; color:var(--muted); font-size:20px; }
  @media (max-width:900px){
    .public-header nav a{ display:none; }
    .nav-toggle{ display:inline-flex; align-items:center; justify-content:center; }
    body.nav-open .public-header nav a{ display:inline-block; margin-top:8px; display:block; width:100%; padding:12px 16px; background:var(--surface); border-radius:8px; }
    .public-header{ flex-direction:column; align-items:flex-start; gap:12px; }
  }

  /* Lead form */
  .lead-form{ display:flex; gap:8px; margin-top:12px; }
  .lead-form input[type="email"]{ padding:10px 12px; border-radius:8px; border:1px solid var(--border); flex:1; }
  .lead-form button{ padding:10px 14px; border-radius:8px; border:0; background:var(--primary); color:#fff; }

  /* Testimonials layout */
  .testimonials{ display:grid; gap:12px; margin-top:18px; }
  .testimonial{ padding:12px; border-radius:10px; background:var(--surface); border:1px solid var(--border); }

}

/* Hover lift for cards */
.card{ transition: transform .18s ease, box-shadow .18s ease; }
.card:hover{ transform: translateY(-6px); box-shadow: 0 18px 40px rgba(11,18,32,.12); }

/* Feature checkmark */
.plan-features li{ position: relative; padding-left: 20px; }
.plan-features li::before{ content: "\2713"; position: absolute; left: 0; top: 0; color: var(--primary); font-weight: 700; }

/* CTA tweaks */
.btn.primary{ padding: 10px 16px; border-radius: 12px; }
.btn.ghost{ background: transparent; border: 1px solid rgba(11,18,32,.06); }

/* Main */
.main{
  grid-area: main;
  padding: var(--gap-5);
}
.page-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap-4);
  margin-bottom: var(--gap-4);
}
.h1{
  font-size: clamp(1.25rem, 1.0vw + 1.05rem, 1.85rem);
  margin: 0;
  letter-spacing: -.02em;
}
.breadcrumbs{
  color: var(--muted);
  font-size: .92rem;
}
.actions{ display:flex; gap: 10px; flex-wrap: wrap; }

/* --- Components --- */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card .card-h{
  padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.card .card-b{ padding: 18px; }
.card-title{ font-weight: 800; letter-spacing: -.01em; }
.card-sub{ color: var(--muted); font-size: .92rem; margin-top: 2px; }

/* Compact card variant for small items (approvals, events) */
.card.card-sm{ border-radius: 12px; padding: 0; box-shadow: none; border-color: rgba(15,23,42,.06); }
.card.card-sm .card-b{ padding: 10px; }

.grid{
  display: grid;
  gap: var(--gap-4);
}
.grid.cols-4{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2{ grid-template-columns: repeat(2, minmax(0, 1fr)); }

.stat{
  padding: 16px;
  display: grid;
  gap: 10px;
}
.stat .top{
  display:flex; align-items:center; justify-content:space-between;
  gap: 10px;
}
.stat .num{
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -.03em;
}
.badge{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: .85rem;
  color: var(--muted);
}
.badge.success{ background: rgba(22,163,74,.10); color: var(--success); border-color: rgba(22,163,74,.22); }
.badge.warn{ background: rgba(245,158,11,.12); color: #b45309; border-color: rgba(245,158,11,.25); }
.badge.danger{ background: rgba(239,68,68,.12); color: #b91c1c; border-color: rgba(239,68,68,.25); }
.badge.primary{ background: rgba(37,99,235,.12); color: var(--primary); border-color: rgba(37,99,235,.24); }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn.primary{
  border-color: rgba(37,99,235,.35);
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  color: white;
}
.btn.ghost{
  background: transparent;
  box-shadow: none;
}
.btn.danger{
  border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.12);
  color: #b91c1c;
}

/* Compact icon button variant */
.btn.icon{
  padding: 6px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.btn.icon .icon{ width:18px; height:18px; }

/* Forms */
.field{
  display:grid;
  gap: 8px;
  margin-bottom: 14px;
}
label{ font-weight: 700; font-size: .92rem; }
.input, select, textarea{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
/* Backwards-compatible alias used by some views: */
.form-control, input.form-control, select.form-control, textarea.form-control{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
textarea{ min-height: 110px; resize: vertical; }
.help{ font-size: .88rem; color: var(--muted); }
.inline{
  display:flex; gap: 12px; flex-wrap: wrap; align-items: center;
}

/* Responsive table container (small screens) */
.table-responsive{ overflow: auto; border-radius: var(--radius-lg); }

/* Inline form helpers used in filters/bulk controls */
.form-inline{ display:flex; gap:8px; align-items:center; }
.form-inline label{ margin:0; white-space:nowrap; font-weight:700; }
.form-inline .form-control{ width: auto; min-width: 160px; }
.form-inline .btn{ white-space:nowrap; }

@media (max-width: 640px){
  .form-inline{ flex-direction: column; align-items: stretch; gap:10px; }
  .form-inline .form-control{ width: 100%; min-width: 0; }
  .form-inline .btn{ align-self: flex-start; }
}

/* Tables (responsive-friendly) */
.table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.table th, .table td{
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.table th{
  font-size: .86rem;
  color: var(--muted);
  background: var(--surface-2);
}
.table tr:last-child td{ border-bottom: 0; }

/* Actions column styling */
.table td .actions{ display:flex; gap:8px; align-items:center; }
.btn .icon{ font-size: 14px; line-height:1; display:inline-flex; }
.btn .text{ display:inline-block; }

@media (max-width: 780px){
  /* hide action labels on small screens to save space */
  .table td .actions .text{ display:none; }
  .btn{ padding: 8px; }
}

/* Tabs */
.tabs{
  display:flex; gap: 10px; flex-wrap: wrap;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  width: fit-content;
}
.tab{
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
}
.tab[aria-selected="true"]{
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
}

/* Kanban */
.kanban{
  display:grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: var(--gap-4);
  overflow-x: auto;
  padding-bottom: 10px;
}
.column{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  min-height: 220px;
}
.column .col-h{
  padding: 14px 14px 10px;
  display:flex; align-items:center; justify-content:space-between;
  border-bottom: 1px solid var(--border);
}
.ticket{
  margin: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.ticket strong{ display:block; }
.ticket .meta{ margin-top: 8px; display:flex; gap: 8px; flex-wrap: wrap; }

/* Message layout */
.split{
  display:grid;
  grid-template-columns: 340px 1fr;
  gap: var(--gap-4);
}
.thread{
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  display:grid;
  gap: 6px;
}
.thread:hover{ background: var(--surface-2); }
.chat{
  display:flex;
  flex-direction: column;
  gap: 12px;
}
.bubble{
  max-width: 76%;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.bubble.me{
  margin-left: auto;
  background: rgba(37,99,235,.12);
  border-color: rgba(37,99,235,.25);
}
.chatbox{
  display:flex;
  gap: 10px;
  align-items: center;
  margin-top: auto;
}
.chatbox input{
  flex: 1;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* Dialog (optional) */
dialog{
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
  padding: 0;
  width: min(560px, 92vw);
}
dialog::backdrop{ background: rgba(0,0,0,.45); }

/* --- Auth layout --- */
.auth{
  min-height: 100vh;
  display:grid;
  place-items:center;
  padding: 24px;
}
.auth-card{
  width: min(980px, 100%);
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  border-radius: 28px;
  overflow:hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.auth-hero{
  padding: 28px;
  background: radial-gradient(1200px 380px at 10% 0%, rgba(37,99,235,.28), transparent 60%),
              radial-gradient(900px 420px at 90% 20%, rgba(22,163,74,.20), transparent 55%),
              var(--surface-2);
  border-right: 1px solid var(--border);
}
.auth-hero h1{ margin: 0 0 10px; font-size: 2rem; letter-spacing: -.03em; }
.auth-hero p{ margin: 0; color: var(--muted); }
.auth-form{
  padding: 28px;
  display:grid;
  align-content: center;
}

/* --- Mobile / Responsive --- */
.mobile-only{ display:none; }

@media (max-width: 1020px){
  .grid.cols-4{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split{ grid-template-columns: 1fr; }
  /* small-screen override: make cols-sm-1 single column (col-sm=12) */
  .grid.cols-sm-1{ grid-template-columns: 1fr !important; }
}

@media (max-width: 900px){
  /* switch to drawer behavior */
  .app{
    grid-template-columns: 1fr;
    grid-template-rows: 68px 1fr;
    grid-template-areas:
      "topbar"
      "main";
  }
  .sidebar{
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    transform: translateX(-105%);
    transition: transform .22s ease;
    z-index: 80;
  }
  .brand{ display:flex; }
  .main{ padding: 18px; }
  .mobile-only{ display:inline-flex; }
  .drawer-backdrop{
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    opacity: 0; pointer-events: none;
    transition: opacity .22s ease;
    z-index: 70;
  }

    /* Checkbox toggles the drawer (no JS needed)
      Adjusted selectors to match DOM where .sidebar and .drawer-backdrop
      are children of .app (not direct siblings of the checkbox). */
    #drawerToggle:checked ~ .app .sidebar{ transform: translateX(0); }
    #drawerToggle:checked ~ .app .drawer-backdrop{ opacity: 1; pointer-events: auto; }

    /* JS fallback: add `.drawer-open` to the document body when JS toggles the drawer */
    .drawer-open .sidebar{ transform: translateX(0); }
    .drawer-open .drawer-backdrop{ opacity: 1; pointer-events: auto; }

  /* Kanban becomes horizontally scrollable */
  .kanban{ grid-template-columns: repeat(4, minmax(260px, 1fr)); }
}

@media (max-width: 780px){
  .auth-card{ grid-template-columns: 1fr; }
  .auth-hero{ border-right: 0; border-bottom: 1px solid var(--border); }
  .grid.cols-2{ grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce){
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Invoice Form Styling */
.text-end { text-align: right !important; }

/* Numeric fields - monospace and right-aligned */
.entry-qty,
.entry-amount,
.entry-taxamt,
.subtotal,
.disctotal,
.taxtotal,
.total,
input[name="subtotal"], 
input[name="taxes"], 
input[name="total_amount"]{
  font-family: var(--mono);
  text-align: right;
  letter-spacing: 0.3px;
}

.entry-qty, 
.entry-amount { 
  width: 120px;
}

.entry-taxamt { 
  width: 90px;
}

/* Summary display */
.subtotal, 
.disctotal, 
.taxtotal {
  color: var(--muted);
  font-weight: 600;
  font-family: var(--mono);
  display: inline-block;
  min-width: 80px;
  padding: 4px 8px;
}

.total {
  color: var(--primary);
  font-weight: 800;
  font-size: 1.1rem;
  font-family: var(--mono);
  display: inline-block;
  min-width: 90px;
  padding: 6px 10px;
  border: 2px solid var(--primary);
  border-radius: 4px;
  background: rgba(30, 64, 175, 0.05);
}

/* Invoice table */
table.invoice {
  width: 100%;
}

table.invoice tbody tr {
  border-bottom: 1px solid var(--border);
}

table.invoice tbody tr:hover {
  background: rgba(30, 64, 175, 0.02);
}

table.invoice td {
  padding: 10px 8px;
  vertical-align: middle;
}

table.invoice th {
  padding: 12px 8px;
  font-weight: 600;
  background: var(--surface-2);
  border-bottom: 2px solid var(--border);
}

/* Profile card improvements */
.profile-card .card-h { border-bottom: none; }
.profile-card .profile-name-lg { font-size: 1.6rem; }
.profile-card .profile-job { color: rgba(255,255,255,0.9); }
.profile-card .card-b { font-size: 0.98rem; }
.profile-card .badge.success { background: rgba(22,163,74,.10); color: var(--success); border-color: rgba(22,163,74,.22); }
.profile-card .btn { padding: 8px 12px; border-radius: 10px; }
.profile-card .btn.primary { padding: 10px 14px; }

/* Notification status attention animation */
@keyframes notif-shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
 100% { transform: translateX(0); }
}

@keyframes notif-pulse {
  0% { box-shadow: 0 0 0 0 rgba(30,64,175,0.12); }
  70% { box-shadow: 0 0 18px 6px rgba(30,64,175,0.06); }
 100% { box-shadow: 0 0 0 0 rgba(30,64,175,0); }
}

.status-attention{
  color: var(--danger);
  font-weight: 700;
  border-radius: 8px;
  padding: 6px 8px;
  display: inline-block;
  animation: notif-shake 0.6s ease-in-out 0s 3, notif-pulse 2.6s ease-in-out 1s infinite;
}

.status-read{ color: var(--muted); font-weight:600; }
