:root{
  --bg:#f4f6fb;
  --bg-2:#eef2f8;
  --surface:#ffffff;
  --surface-2:#f8f9fc;
  --sidebar:#ffffff;
  --sidebar-active:#e9eefc;
  --line:#e7ebf3;
  --text:#1f2a3d;
  --text-soft:#67758d;
  --text-muted:#93a0b5;
  --shadow:0 10px 30px rgba(31,42,61,.06);
  --brand:#4c6fff;
  --brand-2:#5f7cff;
  --green:#25b26d;
  --amber:#f6b51e;
  --red:#ff5c6b;
  --orange:#ff8d3a;
  --purple:#8f55ff;
  --card-radius:20px;
}

html[data-theme="dark"]{
  --bg:#0a1020;
  --bg-2:#0f1730;
  --surface:#111a31;
  --surface-2:#151f39;
  --sidebar:#0b1530;
  --sidebar-active:#16233f;
  --line:rgba(255,255,255,.08);
  --text:#f5f7ff;
  --text-soft:#b5bfd6;
  --text-muted:#8793ab;
  --shadow:0 18px 40px rgba(0,0,0,.32);
}

*{box-sizing:border-box}
html,body{min-height:100%}
body{
  margin:0;
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at top right, rgba(76,111,255,.12), transparent 22%),
    radial-gradient(circle at bottom left, rgba(143,85,255,.08), transparent 18%),
    linear-gradient(180deg,var(--bg) 0%,var(--bg-2) 100%);
}
a{text-decoration:none;color:inherit}
button,input,select,textarea{font:inherit}

.app-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:248px 1fr;
}

.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  background:var(--sidebar);
  border-right:1px solid var(--line);
  padding:22px 16px 16px;
  display:flex;
  flex-direction:column;
}
.brand-wrap{
  display:flex;
  align-items:center;
  gap:14px;
  padding:8px 8px 22px;
}
.brand-mark{
  width:40px;
  height:40px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  color:#fff;
  font-weight:800;
  font-size:22px;
  box-shadow:0 10px 24px rgba(76,111,255,.28);
}
.brand-text{
  font-size:15px;
  font-weight:800;
  letter-spacing:.02em;
}

.nav{
  display:grid;
  gap:8px;
}
.nav a{
  display:flex;
  align-items:center;
  gap:12px;
  padding:13px 14px;
  border-radius:14px;
  color:var(--text-soft);
  font-weight:600;
  transition:.18s ease;
}
.nav a:hover{
  background:var(--surface-2);
  color:var(--text);
}
.nav a.active{
  background:var(--sidebar-active);
  color:var(--brand);
  box-shadow:inset 0 0 0 1px rgba(76,111,255,.06);
}
.nav-ico{
  width:18px;
  min-width:18px;
  text-align:center;
  font-size:15px;
  opacity:.95;
}

.sidebar-footer{
  margin-top:auto;
  padding-top:18px;
  border-top:1px solid var(--line);
}
.profile-card{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 8px;
}
.profile-avatar{
  width:40px;
  height:40px;
  border-radius:999px;
  background:linear-gradient(135deg,#ffcc89,#ff8d62);
  display:grid;
  place-items:center;
  color:#1f2a3d;
  font-weight:800;
}
.profile-meta{min-width:0}
.user-name{
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.user-role{
  color:var(--text-soft);
  font-size:13px;
  margin-top:3px;
}
.logout-link{
  display:inline-flex;
  margin-top:8px;
  padding:11px 14px;
  border-radius:12px;
  background:#f34f62;
  color:#fff;
  font-weight:700;
}
html[data-theme="dark"] .logout-link{ background:#e44f61; }

.content{
  padding:34px 24px 28px;
}

.topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:24px;
}
.topbar-copy{min-width:0}
.page-title{
  margin:0;
  font-size:30px;
  line-height:1.08;
  letter-spacing:-.03em;
}
.page-subtitle{
  margin:10px 0 0;
  color:var(--text-soft);
  font-size:15px;
}
.topbar-actions{
  display:flex;
  align-items:center;
  gap:12px;
  margin-left:auto;
}
.toolbar-icon,
.toolbar-chip,
.toolbar-primary{
  height:44px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface);
  color:var(--text);
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:0 16px;
  box-shadow:var(--shadow);
}
.toolbar-icon{
  width:44px;
  justify-content:center;
  padding:0;
}
.toolbar-icon .theme-sun,
.toolbar-icon .theme-moon{line-height:1;font-size:16px}
html[data-theme="light"] .toolbar-icon .theme-moon{display:none}
html[data-theme="dark"] .toolbar-icon .theme-sun{display:none}
.toolbar-primary{
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  color:#fff;
  border-color:transparent;
  padding:0 18px;
  box-shadow:0 14px 26px rgba(76,111,255,.24);
}
.chip-icon,
.chip-plus,
.chip-caret{line-height:1}
.chip-caret{opacity:.68}

.flash{
  margin:0 0 18px;
  padding:14px 16px;
  border-radius:14px;
  font-weight:600;
}
.flash-success{background:rgba(37,178,109,.14);color:#1f8b58}
.flash-error{background:rgba(255,92,107,.14);color:#cc4453}

.grid{display:grid;gap:18px}
.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.chart-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.detail-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:18px}
.form-grid,
.filter-bar,
.kv-grid{
  display:grid;
  gap:16px;
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.card,
table{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--card-radius);
  box-shadow:var(--shadow);
}
.card{
  padding:20px 20px 18px;
}
.card h2,
.card h3{
  margin:0 0 18px;
  font-size:19px;
  letter-spacing:-.02em;
}

.kpi-card{padding:18px}
.kpi-card-inner{
  display:flex;
  align-items:flex-start;
  gap:14px;
}
.kpi-icon{
  width:48px;
  height:48px;
  border-radius:16px;
  display:grid;
  place-items:center;
  font-size:22px;
  font-weight:700;
}
.kpi-icon.blue{background:rgba(76,111,255,.12); color:#4c6fff}
.kpi-icon.purple{background:rgba(143,85,255,.12); color:#8f55ff}
.kpi-icon.orange{background:rgba(255,141,58,.14); color:#ff8d3a}
.kpi-label{
  color:var(--text-soft);
  font-size:14px;
  margin-bottom:8px;
}
.kpi-value{
  font-size:22px;
  font-weight:800;
  letter-spacing:-.02em;
}
.kpi-trend{
  margin-top:8px;
  font-size:13px;
  color:var(--text-soft);
}
.kpi-trend.up{color:var(--green)}
.kpi-trend.warn{color:var(--amber)}
.kpi-trend.muted{color:var(--text-soft)}

.table-wrap{overflow:auto}
table{
  width:100%;
  border-collapse:collapse;
}
th,td{
  padding:14px 14px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:top;
}
tr:last-child td{border-bottom:0}
th{
  color:var(--text-soft);
  font-size:13px;
  font-weight:700;
}
tbody td{font-weight:500}

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.btn,
button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  line-height:1.2;
  min-height:44px;
  border:0;
  border-radius:12px;
  padding:11px 14px;
  background:#101d38;
  color:#fff;
  cursor:pointer;
  font-weight:700;
}
html[data-theme="light"] .btn,
html[data-theme="light"] button{
  background:#16233f;
}
.btn-secondary{
  background:var(--surface-2);
  color:var(--text);
  border:1px solid var(--line);
}
.btn-danger{
  background:#eb5a68;
  color:#fff;
}

.field label{
  display:block;
  margin-bottom:8px;
  color:var(--text-soft);
  font-size:13px;
  font-weight:700;
}
.field input,
.field select,
.field textarea,
form textarea,
form input[type="file"]{
  width:100%;
  border:1px solid var(--line);
  background:var(--surface-2);
  color:var(--text);
  border-radius:14px;
  padding:12px 14px;
}
.field textarea,
form textarea{
  min-height:110px;
  resize:vertical;
}
.form-actions{
  margin-top:18px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
}
.badge-active{background:rgba(37,178,109,.12); color:var(--green)}
.badge-expired{background:rgba(255,92,107,.12); color:var(--red)}
.badge-pending{background:rgba(246,181,30,.14); color:#b88600}
.badge-info{background:rgba(76,111,255,.12); color:var(--brand)}

.stat-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 0;
}
.muted{color:var(--text-soft)}
.meter{
  height:10px;
  border-radius:999px;
  background:var(--surface-2);
  overflow:hidden;
  border:1px solid var(--line);
}
.meter > span{
  display:block;
  height:100%;
  background:linear-gradient(90deg,var(--brand),#7391ff);
  border-radius:999px;
}

.invoice-sheet{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:24px;
  padding:28px;
  box-shadow:var(--shadow);
}
.invoice-head{
  display:flex;
  justify-content:space-between;
  gap:20px;
  margin-bottom:22px;
}
.invoice-meta{display:grid;gap:8px}

.profile-meta .user-name,
.section-title{font-weight:800}

@media (max-width:1180px){
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .chart-grid{grid-template-columns:1fr}
}
@media (max-width:980px){
  .app-shell{grid-template-columns:1fr}
  .sidebar{position:relative;height:auto}
  .topbar{flex-direction:column}
  .topbar-actions{width:100%;justify-content:flex-start;flex-wrap:wrap}
  .grid-2,.form-grid,.filter-bar,.detail-grid,.kv-grid{grid-template-columns:1fr}
}
@media (max-width:720px){
  .content{padding:20px 14px}
  .grid-4{grid-template-columns:1fr}
  .page-title{font-size:26px}
}
@media print{
  .sidebar,.topbar,.flash,.actions,.tabs-links{display:none !important}
  body,.content,.invoice-sheet{background:#fff !important;box-shadow:none !important;padding:0 !important}
}


/* Stage 13 fix v3: force readable text on dark buttons in light theme */
html[data-theme="light"] .btn,
html[data-theme="light"] button,
html[data-theme="light"] .toolbar-primary,
html[data-theme="light"] .logout-link {
  color: #ffffff !important;
}

html[data-theme="light"] .btn .chip-caret,
html[data-theme="light"] button .chip-caret,
html[data-theme="light"] .toolbar-primary .chip-caret,
html[data-theme="light"] .toolbar-primary .chip-plus {
  color: #ffffff !important;
  opacity: 1 !important;
}

html[data-theme="light"] .btn-secondary {
  color: var(--text) !important;
}


/* Stage 13 fix v4: enforce contrast on dark/primary buttons everywhere */
.btn,
a.btn,
button,
input[type="submit"],
input[type="button"],
.toolbar-primary,
a.toolbar-primary,
.logout-link {
  color: #ffffff !important;
}

.btn *,
a.btn *,
button *,
.toolbar-primary *,
a.toolbar-primary *,
.logout-link * {
  color: inherit !important;
}

.btn-secondary,
a.btn-secondary {
  color: var(--text) !important;
}

.btn-secondary *,
a.btn-secondary * {
  color: inherit !important;
}

.actions .btn,
.actions a.btn,
.table-wrap .btn,
.table-wrap a.btn,
.form-actions .btn,
.form-actions a.btn {
  color: #ffffff !important;
}

.actions .btn-secondary,
.actions a.btn-secondary,
.table-wrap .btn-secondary,
.table-wrap a.btn-secondary,
.form-actions .btn-secondary,
.form-actions a.btn-secondary {
  color: var(--text) !important;
}


/* Stage 13 dark polish: fix button contrast and tune dark theme closer to reference */
:root{
  --brand:#4f6fff;
  --brand-2:#5d7cff;
}

html[data-theme="dark"]{
  --bg:#0b1020;
  --bg-2:#0f1530;
  --surface:#131a2b;
  --surface-2:#182136;
  --sidebar:#0b1325;
  --sidebar-active:#16233d;
  --line:rgba(255,255,255,.07);
  --text:#f5f7ff;
  --text-soft:#adb8d0;
  --text-muted:#7f8aa3;
  --shadow:0 18px 40px rgba(0,0,0,.34);
}

html[data-theme="dark"] body{
  background:
    radial-gradient(circle at top right, rgba(79,111,255,.10), transparent 24%),
    radial-gradient(circle at bottom left, rgba(143,85,255,.07), transparent 18%),
    linear-gradient(180deg,#0b1020 0%,#0f1530 55%,#101735 100%);
}

html[data-theme="dark"] .sidebar{
  background:
    linear-gradient(180deg, rgba(255,255,255,.015), rgba(255,255,255,0)),
    var(--sidebar);
}

html[data-theme="dark"] .brand-mark{
  background:linear-gradient(135deg,#4570ff,#5d7cff);
  box-shadow:0 12px 28px rgba(79,111,255,.30);
}

html[data-theme="dark"] .nav a{
  color:#d2daf0;
}
html[data-theme="dark"] .nav a.active{
  background:#18243d;
  color:#6d8cff;
  box-shadow:inset 0 0 0 1px rgba(109,140,255,.10);
}
html[data-theme="dark"] .nav a:hover{
  background:#141f35;
  color:#f5f7ff;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] table,
html[data-theme="dark"] .invoice-sheet{
  background:
    linear-gradient(180deg, rgba(255,255,255,.014), rgba(255,255,255,.004)),
    var(--surface);
  border-color:rgba(255,255,255,.06);
  box-shadow:
    0 14px 32px rgba(0,0,0,.26),
    inset 0 1px 0 rgba(255,255,255,.02);
}

html[data-theme="dark"] .toolbar-icon,
html[data-theme="dark"] .toolbar-chip{
  background:#131c31;
  border-color:rgba(255,255,255,.08);
  color:#f5f7ff;
}
html[data-theme="dark"] .toolbar-primary{
  background:linear-gradient(135deg,#4b6fff,#5c7cff);
  color:#ffffff !important;
  box-shadow:0 14px 30px rgba(79,111,255,.28);
}

html[data-theme="dark"] .kpi-icon.blue{background:rgba(79,111,255,.14); color:#6f8dff;}
html[data-theme="dark"] .kpi-icon.purple{background:rgba(143,85,255,.14); color:#a97bff;}
html[data-theme="dark"] .kpi-icon.orange{background:rgba(255,141,58,.14); color:#ff9b4d;}

html[data-theme="dark"] .meter{
  background:#202948;
  border-color:rgba(255,255,255,.04);
}
html[data-theme="dark"] .meter > span{
  background:linear-gradient(90deg,#4f6fff,#6990ff);
}

html[data-theme="dark"] .badge-info{background:rgba(79,111,255,.14); color:#7b98ff;}
html[data-theme="dark"] .badge-pending{background:rgba(246,181,30,.15); color:#ffc64a;}
html[data-theme="dark"] .badge-active{background:rgba(37,178,109,.16); color:#58d08c;}
html[data-theme="dark"] .badge-expired{background:rgba(255,92,107,.16); color:#ff7d8a;}

html[data-theme="dark"] th{ color:#8fa0bf; }
html[data-theme="dark"] .muted,
html[data-theme="dark"] .kpi-label,
html[data-theme="dark"] .page-subtitle,
html[data-theme="dark"] .user-role,
html[data-theme="dark"] .field label{ color:#a8b4cd; }

/* Definitive button contrast fix */
.btn,
a.btn,
button,
input[type="submit"],
input[type="button"],
.toolbar-primary,
a.toolbar-primary,
.logout-link{
  color:#ffffff !important;
}

.btn:not(.btn-secondary):not(.btn-danger),
a.btn:not(.btn-secondary):not(.btn-danger),
button:not(.btn-secondary):not(.btn-danger),
input[type="submit"]:not(.btn-secondary):not(.btn-danger),
input[type="button"]:not(.btn-secondary):not(.btn-danger){
  background:#16233f !important;
  color:#ffffff !important;
}

html[data-theme="dark"] .btn:not(.btn-secondary):not(.btn-danger),
html[data-theme="dark"] a.btn:not(.btn-secondary):not(.btn-danger),
html[data-theme="dark"] button:not(.btn-secondary):not(.btn-danger),
html[data-theme="dark"] input[type="submit"]:not(.btn-secondary):not(.btn-danger),
html[data-theme="dark"] input[type="button"]:not(.btn-secondary):not(.btn-danger){
  background:#16233d !important;
  color:#ffffff !important;
}

.btn *,
a.btn *,
button *,
.toolbar-primary *,
a.toolbar-primary *,
.logout-link *{
  color:inherit !important;
}

.btn-secondary,
a.btn-secondary,
button.btn-secondary{
  background:var(--surface-2) !important;
  color:var(--text) !important;
  border:1px solid var(--line) !important;
}

.btn-secondary *,
a.btn-secondary *,
button.btn-secondary *{
  color:inherit !important;
}

.btn-danger,
a.btn-danger,
button.btn-danger{
  background:#eb5a68 !important;
  color:#ffffff !important;
}

.actions .btn,
.actions a.btn,
.table-wrap .btn,
.table-wrap a.btn,
.form-actions .btn,
.form-actions a.btn{
  color:inherit !important;
}

.actions .btn:not(.btn-secondary):not(.btn-danger),
.actions a.btn:not(.btn-secondary):not(.btn-danger),
.table-wrap .btn:not(.btn-secondary):not(.btn-danger),
.table-wrap a.btn:not(.btn-secondary):not(.btn-danger),
.form-actions .btn:not(.btn-secondary):not(.btn-danger),
.form-actions a.btn:not(.btn-secondary):not(.btn-danger){
  color:#ffffff !important;
}

.actions .btn-secondary,
.actions a.btn-secondary,
.table-wrap .btn-secondary,
.table-wrap a.btn-secondary,
.form-actions .btn-secondary,
.form-actions a.btn-secondary{
  color:var(--text) !important;
}


/* Stage 13 refined v2: tighter spacing, typography, and dark surface tuning */
:root{
  --card-radius:22px;
}

html[data-theme="dark"] body{
  background:
    radial-gradient(circle at 84% 12%, rgba(84,101,255,.10), transparent 18%),
    radial-gradient(circle at 15% 88%, rgba(108,63,255,.08), transparent 18%),
    linear-gradient(180deg,#0a1020 0%,#0d1428 48%,#101735 100%);
}

html[data-theme="dark"] .sidebar{
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0)),
    linear-gradient(180deg,#0b1326 0%,#0c1428 100%);
}

html[data-theme="dark"] .content{
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.015), transparent 28%);
}

.app-shell{
  grid-template-columns: 244px 1fr;
}

.content{
  padding: 28px 24px 28px;
}

.brand-wrap{
  padding: 6px 8px 20px;
}
.brand-mark{
  width:42px;
  height:42px;
  border-radius:14px;
  font-size:23px;
}
.brand-text{
  font-size:16px;
  font-weight:800;
}

.nav{
  gap:10px;
}
.nav a{
  padding:14px 16px;
  border-radius:15px;
  font-size:15px;
  letter-spacing:-.01em;
}
.nav-ico{
  width:20px;
  min-width:20px;
  font-size:14px;
  opacity:.9;
}

.profile-card{
  padding:14px 8px 10px;
}
.profile-avatar{
  width:42px;
  height:42px;
}

.topbar{
  margin-bottom:26px;
}
.page-title{
  font-size:32px;
  font-weight:800;
}
.page-subtitle{
  margin-top:10px;
  font-size:15px;
}
.topbar-actions{
  gap:14px;
}
.toolbar-icon,
.toolbar-chip,
.toolbar-primary{
  height:42px;
  border-radius:14px;
}
.toolbar-chip{
  min-width:236px;
  justify-content:space-between;
}
.toolbar-primary{
  min-width:146px;
  justify-content:center;
}

.grid{ gap:20px; }
.grid-4{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-grid{ gap:20px; }

.card{
  padding:22px 22px 20px;
}
.card h2,
.card h3{
  font-size:18px;
  font-weight:800;
  margin-bottom:18px;
}

.kpi-card{
  padding:18px 18px 16px;
}
.kpi-card-inner{
  gap:16px;
}
.kpi-icon{
  width:52px;
  height:52px;
  border-radius:17px;
  font-size:22px;
}
.kpi-label{
  font-size:13px;
  margin-bottom:7px;
}
.kpi-value{
  font-size:21px;
  line-height:1;
}
.kpi-trend{
  margin-top:10px;
  font-size:12px;
}

.stat-row{
  padding:9px 0;
}
.stat-row strong{
  font-weight:700;
}

table{
  border-radius:18px;
}
th, td{
  padding:15px 14px;
}
th{
  font-size:13px;
  font-weight:700;
}
tbody td{
  font-size:15px;
}

.field input,
.field select,
.field textarea,
form textarea,
form input[type="file"]{
  min-height:46px;
  border-radius:14px;
  padding:12px 15px;
}

.btn,
button,
input[type="submit"],
input[type="button"]{
  min-height:44px;
  border-radius:13px;
  padding:11px 16px;
  font-weight:800;
  letter-spacing:-.01em;
}

.meter{
  height:11px;
  border-radius:999px;
}

.flash{
  border-radius:16px;
  padding:14px 16px;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] table,
html[data-theme="dark"] .invoice-sheet{
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,.004)),
    linear-gradient(180deg,#11192d 0%,#121b31 100%);
  border-color:rgba(255,255,255,.055);
}

html[data-theme="dark"] .toolbar-icon,
html[data-theme="dark"] .toolbar-chip{
  background:#121b31;
}

html[data-theme="dark"] .toolbar-primary{
  background:linear-gradient(135deg,#4c6fff,#5c7cff 65%,#6a8dff 100%);
}

html[data-theme="dark"] .kpi-icon.blue{background:rgba(92,120,255,.14); color:#6e8eff;}
html[data-theme="dark"] .kpi-icon.purple{background:rgba(157,98,255,.14); color:#ad83ff;}
html[data-theme="dark"] .kpi-icon.orange{background:rgba(255,146,66,.14); color:#ff9d57;}

html[data-theme="dark"] .page-title,
html[data-theme="dark"] .card h2,
html[data-theme="dark"] .card h3{
  color:#f7f9ff;
}
html[data-theme="dark"] .page-subtitle,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .kpi-label{
  color:#a8b6cf;
}
html[data-theme="dark"] tbody td{
  color:#eef2ff;
}
html[data-theme="dark"] th{
  color:#8fa0bf;
}

html[data-theme="light"] .sidebar{
  background:#ffffff;
}
html[data-theme="light"] .card,
html[data-theme="light"] table,
html[data-theme="light"] .invoice-sheet{
  background:#ffffff;
}
html[data-theme="light"] .topbar-copy .page-title{
  color:#1f2a3d;
}
html[data-theme="light"] .toolbar-chip{
  background:#fff;
}
html[data-theme="light"] .toolbar-primary{
  background:linear-gradient(135deg,#4c6fff,#5c7cff);
}

@media (max-width:1180px){
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:980px){
  .app-shell{grid-template-columns:1fr}
  .toolbar-chip{min-width:0}
}

/* Stage 13 refined v3: functional topbar dropdowns */
.toolbar-dropdown{
  position:relative;
}
.dropdown-menu{
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  min-width:220px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:var(--shadow);
  padding:8px;
  display:none;
  z-index:50;
}
.dropdown-menu.is-open{
  display:block;
}
.dropdown-item{
  width:100%;
  display:flex;
  align-items:center;
  border:0;
  background:transparent !important;
  color:var(--text) !important;
  padding:11px 12px;
  border-radius:12px;
  text-align:left;
  cursor:pointer;
  font-weight:600;
}
.dropdown-item:hover{
  background:var(--surface-2) !important;
}
.dropdown-menu-links a.dropdown-item{
  text-decoration:none;
}
html[data-theme="dark"] .dropdown-menu{
  background:#121b31;
  border-color:rgba(255,255,255,.08);
}
html[data-theme="dark"] .dropdown-item{
  color:#f5f7ff !important;
}
html[data-theme="dark"] .dropdown-item:hover{
  background:#192540 !important;
}


/* Stage 13 glass dark refinement based on provided reference */
html[data-theme="dark"]{
  --bg:#181a24;
  --bg-2:#181a24;
  --surface:#21242e;
  --surface-2:#262a35;
  --sidebar:#181a24;
  --sidebar-active:#232736;
  --line:rgba(255,255,255,.08);
  --text:#f5f7ff;
  --text-soft:#b2b8c8;
  --text-muted:#8f97aa;
  --shadow:0 20px 45px rgba(0,0,0,.30);
}

html[data-theme="dark"] body{
  background:
    radial-gradient(circle at 82% 8%, rgba(92,109,255,.08), transparent 18%),
    radial-gradient(circle at 14% 88%, rgba(118,80,255,.05), transparent 16%),
    linear-gradient(180deg,#181a24 0%,#181a24 100%);
}

html[data-theme="dark"] .sidebar{
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0)),
    #181a24;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

html[data-theme="dark"] .content{
  background: transparent;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] table,
html[data-theme="dark"] .invoice-sheet,
html[data-theme="dark"] .toolbar-icon,
html[data-theme="dark"] .toolbar-chip,
html[data-theme="dark"] .dropdown-menu{
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015)),
    rgba(33,36,46,.82) !important;
  border:1px solid rgba(255,255,255,.09) !important;
  box-shadow:
    0 16px 40px rgba(0,0,0,.24),
    inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

html[data-theme="dark"] .toolbar-primary{
  background:linear-gradient(135deg,#4f6fff,#5e7dff) !important;
  border-color:transparent !important;
  color:#fff !important;
  box-shadow:0 16px 34px rgba(79,111,255,.28);
}

html[data-theme="dark"] .nav a{
  color:#d8dcea;
}
html[data-theme="dark"] .nav a:hover{
  background:rgba(255,255,255,.04);
  color:#ffffff;
}
html[data-theme="dark"] .nav a.active{
  background:rgba(79,111,255,.12);
  color:#738dff;
  box-shadow:inset 0 0 0 1px rgba(115,141,255,.10);
}

html[data-theme="dark"] .brand-wrap,
html[data-theme="dark"] .sidebar-footer{
  border-color:rgba(255,255,255,.07);
}

html[data-theme="dark"] .meter{
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.04);
}
html[data-theme="dark"] .meter > span{
  background:linear-gradient(90deg,#5b7cff,#6e8dff);
}

html[data-theme="dark"] th{
  color:#9da7bc;
}
html[data-theme="dark"] tbody td,
html[data-theme="dark"] .page-title,
html[data-theme="dark"] .card h2,
html[data-theme="dark"] .card h3{
  color:#f4f7ff;
}
html[data-theme="dark"] .page-subtitle,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .kpi-label,
html[data-theme="dark"] .field label,
html[data-theme="dark"] .user-role{
  color:#b0b8cb;
}

html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] form textarea,
html[data-theme="dark"] form input[type="file"]{
  background:rgba(255,255,255,.035);
  border-color:rgba(255,255,255,.08);
  color:#f4f7ff;
}

html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] a.btn-secondary,
html[data-theme="dark"] button.btn-secondary{
  background:rgba(255,255,255,.05) !important;
  color:#f4f7ff !important;
  border:1px solid rgba(255,255,255,.08) !important;
}

html[data-theme="dark"] .dropdown-item{
  color:#f4f7ff !important;
}
html[data-theme="dark"] .dropdown-item:hover{
  background:rgba(255,255,255,.06) !important;
}


/* Custom confirm modal */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(10,14,24,.52);
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:9999;
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}
.modal-overlay.is-open{
  display:flex;
}
.modal-card{
  width:100%;
  max-width:460px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:22px;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.modal-head,
.modal-body,
.modal-actions{
  padding:20px 22px;
}
.modal-head{
  border-bottom:1px solid var(--line);
}
.modal-head h3{
  margin:0;
  font-size:20px;
  font-weight:800;
}
.modal-body p{
  margin:0;
  color:var(--text-soft);
  line-height:1.5;
}
.modal-actions{
  border-top:1px solid var(--line);
  display:flex;
  justify-content:flex-end;
  gap:10px;
}
html[data-theme="dark"] .modal-card{
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015)),
    rgba(33,36,46,.88);
  border-color:rgba(255,255,255,.09);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}


/* Stage 16 billing */
.form-group-full{
  grid-column:1 / -1;
}


.kanban-board{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
  align-items:start;
}
.kanban-column{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.kanban-column-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 18px;
  border-bottom:1px solid var(--line);
}
.kanban-list{
  padding:14px;
  display:grid;
  gap:12px;
}
.kanban-card{
  border:1px solid var(--line);
  background:var(--surface-2);
  border-radius:14px;
  padding:14px;
}
.kanban-card-title{
  font-weight:800;
  margin-bottom:6px;
}
.kanban-empty{
  color:var(--text-soft);
  padding:10px 4px;
}
@media (max-width:980px){
  .kanban-board{
    grid-template-columns:1fr;
  }
}


.auth-shell-enhanced{
  min-height:100vh;
  display:grid;
  grid-template-columns:1.05fr .95fr;
  align-items:center;
  gap:32px;
  padding:40px;
}
.auth-hero{
  padding:28px;
}
.auth-hero-badge{
  display:inline-flex;
  padding:8px 14px;
  border-radius:999px;
  background:rgba(76,111,255,.10);
  color:var(--brand);
  font-weight:700;
  margin-bottom:18px;
}
.auth-hero h1{
  font-size:42px;
  line-height:1.06;
  margin:0 0 14px;
}
.auth-hero p{
  color:var(--text-soft);
  font-size:17px;
  max-width:620px;
  margin:0 0 22px;
}
.auth-hero-points{
  display:grid;
  gap:12px;
  max-width:460px;
}
.hero-point{
  padding:14px 16px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.55);
  backdrop-filter:blur(10px);
  border-radius:16px;
  box-shadow:var(--shadow);
  font-weight:600;
}
.auth-card-enhanced{
  width:100%;
  max-width:700px;
  margin-left:auto;
  padding:28px;
  border-radius:24px;
  background:rgba(255,255,255,.78);
  border:1px solid var(--line);
  box-shadow:0 24px 60px rgba(31,42,61,.10);
  backdrop-filter:blur(18px);
}
.auth-tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:20px;
}
.auth-tabs a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 16px;
  border-radius:14px;
  background:var(--surface-2);
  color:var(--text-soft);
  font-weight:700;
  border:1px solid var(--line);
}
.auth-tabs a.active{
  color:#fff;
  background:linear-gradient(135deg,var(--brand),var(--brand-2));
  border-color:transparent;
}
.auth-panel-head h2{
  margin:0 0 6px;
  font-size:28px;
}
.auth-panel-head p{
  margin:0 0 18px;
  color:var(--text-soft);
}
.auth-card-enhanced .form-actions{
  margin-top:10px;
}
.auth-card-enhanced .btn,
.auth-card-enhanced button{
  min-height:46px;
}
@media (max-width: 980px){
  .auth-shell-enhanced{
    grid-template-columns:1fr;
    padding:22px;
  }
  .auth-hero{
    padding:8px 0 0;
  }
  .auth-hero h1{
    font-size:32px;
  }
  .auth-card-enhanced{
    max-width:none;
    margin:0;
  }
}
html[data-theme="dark"] .hero-point,
html[data-theme="dark"] .auth-card-enhanced{
  background:rgba(17,26,49,.78);
}


.login-intro-body{
  overflow-x:hidden;
}

.login-shell-hidden{
  opacity:0;
  visibility:hidden;
  transform:translateY(20px);
  transition:opacity .55s ease, transform .55s ease, visibility .55s ease;
}
.login-shell-hidden.is-visible{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
}

.intro-overlay{
  position:fixed;
  inset:0;
  z-index:60;
  display:grid;
  place-items:center;
  padding:24px;
  background:
    radial-gradient(circle at 20% 20%, rgba(96,216,255,.20), transparent 22%),
    radial-gradient(circle at 80% 78%, rgba(76,111,255,.22), transparent 25%),
    linear-gradient(180deg, #07101f 0%, #0d1630 100%);
  opacity:1;
  visibility:visible;
  transition:opacity .65s ease, visibility .65s ease;
}
.intro-overlay.is-hidden{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}

.intro-stage{
  width:min(1100px, 100%);
  min-height:min(86vh, 860px);
  border:1px solid rgba(255,255,255,.08);
  border-radius:32px;
  background:rgba(10,18,35,.58);
  backdrop-filter:blur(18px);
  box-shadow:0 30px 80px rgba(0,0,0,.35);
  padding:34px 28px 28px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:28px;
  overflow:hidden;
  position:relative;
}
.intro-stage::before{
  content:"";
  position:absolute;
  inset:-20%;
  background:
    radial-gradient(circle, rgba(95,124,255,.14), transparent 32%),
    radial-gradient(circle at 70% 30%, rgba(95,241,214,.12), transparent 28%);
  animation:introPulse 5.5s ease-in-out infinite;
}

.intro-brand-sequence{
  position:relative;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:18px;
  flex-wrap:wrap;
}
.intro-logo{
  display:block;
  height:auto;
  filter:drop-shadow(0 10px 24px rgba(0,0,0,.22));
  opacity:0;
  transform:translateY(30px) scale(.92);
}
.intro-logo-mirio{
  width:min(300px, 66vw);
  animation:introLogoIn .9s ease forwards .15s;
}
.intro-logo-crm{
  width:min(150px, 38vw);
  animation:introLogoIn .9s ease forwards .45s;
}

.intro-symbol-wrap{
  position:relative;
  z-index:2;
  width:min(360px, 78vw);
  aspect-ratio:1/1;
  display:grid;
  place-items:center;
}
.intro-glow{
  position:absolute;
  border-radius:999px;
  filter:blur(24px);
  opacity:.7;
}
.intro-glow-a{
  width:62%;
  height:62%;
  background:rgba(76,111,255,.40);
  animation:introOrbitA 5.2s ease-in-out infinite;
}
.intro-glow-b{
  width:56%;
  height:56%;
  background:rgba(95,241,214,.36);
  animation:introOrbitB 5.8s ease-in-out infinite;
}
.intro-symbol{
  position:relative;
  z-index:2;
  width:100%;
  max-width:340px;
  opacity:0;
  transform:scale(.84) rotate(-8deg);
  filter:drop-shadow(0 18px 36px rgba(17,54,122,.32));
  animation:introSymbolIn 1.2s cubic-bezier(.2,.8,.2,1) forwards .9s,
           introFloat 4.6s ease-in-out infinite 2.2s;
}

.intro-copy{
  position:relative;
  z-index:2;
  max-width:760px;
  text-align:center;
  color:#f5f7ff;
  opacity:0;
  transform:translateY(24px);
  animation:introCopyIn .8s ease forwards 1.35s;
}
.intro-copy h1{
  margin:0 0 12px;
  font-size:clamp(34px, 5vw, 56px);
  line-height:1.02;
}
.intro-copy p{
  margin:0;
  color:rgba(245,247,255,.82);
  font-size:clamp(15px, 2vw, 19px);
}

.intro-actions{
  position:relative;
  z-index:2;
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  justify-content:center;
  opacity:0;
  transform:translateY(20px);
  animation:introCopyIn .8s ease forwards 1.65s;
}
.intro-enter-btn{
  min-width:180px;
  min-height:50px;
  box-shadow:0 14px 34px rgba(76,111,255,.25);
}
.intro-skip-btn{
  background:transparent;
  color:rgba(255,255,255,.78);
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  padding:12px 18px;
  font-weight:700;
  cursor:pointer;
}

@keyframes introLogoIn{
  to{
    opacity:1;
    transform:translateY(0) scale(1);
  }
}
@keyframes introSymbolIn{
  0%{
    opacity:0;
    transform:scale(.84) rotate(-8deg);
  }
  70%{
    opacity:1;
    transform:scale(1.04) rotate(2deg);
  }
  100%{
    opacity:1;
    transform:scale(1) rotate(0);
  }
}
@keyframes introCopyIn{
  to{
    opacity:1;
    transform:translateY(0);
  }
}
@keyframes introFloat{
  0%,100%{ transform:translateY(0) scale(1); }
  50%{ transform:translateY(-10px) scale(1.02); }
}
@keyframes introOrbitA{
  0%,100%{ transform:translate(-18px, 14px) scale(1); }
  50%{ transform:translate(16px, -10px) scale(1.12); }
}
@keyframes introOrbitB{
  0%,100%{ transform:translate(22px, -14px) scale(1); }
  50%{ transform:translate(-16px, 14px) scale(1.08); }
}
@keyframes introPulse{
  0%,100%{ transform:scale(1); opacity:1; }
  50%{ transform:scale(1.08); opacity:.8; }
}

@media (max-width: 980px){
  .intro-stage{
    min-height:auto;
    padding:26px 18px 24px;
    gap:22px;
  }
  .intro-brand-sequence{
    gap:12px;
  }
  .intro-actions{
    width:100%;
  }
  .intro-enter-btn,
  .intro-skip-btn{
    width:100%;
  }
}


.intro-overlay-single-logo{
  background:
    radial-gradient(circle at 20% 20%, rgba(96,216,255,.16), transparent 22%),
    radial-gradient(circle at 80% 78%, rgba(76,111,255,.18), transparent 25%),
    linear-gradient(180deg, #050b17 0%, #0b1430 100%);
}

.intro-stage-single{
  background:transparent;
  border:none;
  box-shadow:none;
  backdrop-filter:none;
  min-height:100vh;
  width:100%;
  padding:0;
}
.intro-stage-single::before{
  display:none;
}

.intro-symbol-scene{
  position:relative;
  width:min(760px, 88vw);
  aspect-ratio:1.12/1;
  display:grid;
  place-items:center;
  perspective:1600px;
}
.intro-logo-3d-wrap{
  position:relative;
  width:min(620px, 84vw);
  transform-style:preserve-3d;
  animation:intro3DSpin 2.35s cubic-bezier(.2,.75,.2,1) forwards;
  will-change:transform, opacity;
  filter:drop-shadow(0 26px 60px rgba(0,0,0,.34));
}
.intro-logo-3d{
  display:block;
  width:100%;
  height:auto;
  transform:translateZ(0);
  backface-visibility:hidden;
}
.intro-shadow-disc{
  position:absolute;
  width:52%;
  height:11%;
  border-radius:999px;
  background:radial-gradient(circle, rgba(33,149,255,.28) 0%, rgba(33,149,255,.16) 35%, rgba(0,0,0,0) 70%);
  filter:blur(18px);
  bottom:11%;
  opacity:0;
  animation:introShadowIn .9s ease forwards .9s;
}
.intro-ring{
  position:absolute;
  border-radius:999px;
  border:1px solid rgba(142,238,255,.14);
  opacity:0;
}
.intro-ring-a{
  width:66%;
  height:66%;
  animation:introRingA 2.6s ease-out forwards .2s;
}
.intro-ring-b{
  width:82%;
  height:82%;
  animation:introRingB 2.9s ease-out forwards .35s;
}
.intro-ring-c{
  width:98%;
  height:98%;
  animation:introRingC 3.2s ease-out forwards .5s;
}

@keyframes intro3DSpin{
  0%{
    opacity:0;
    transform:rotateY(-86deg) rotateX(18deg) rotateZ(-8deg) scale(.72);
  }
  38%{
    opacity:1;
    transform:rotateY(22deg) rotateX(-6deg) rotateZ(3deg) scale(1.05);
  }
  68%{
    opacity:1;
    transform:rotateY(-12deg) rotateX(4deg) rotateZ(-1deg) scale(.98);
  }
  100%{
    opacity:1;
    transform:rotateY(0) rotateX(0) rotateZ(0) scale(1);
  }
}
@keyframes introShadowIn{
  from{ opacity:0; transform:scale(.78); }
  to{ opacity:1; transform:scale(1); }
}
@keyframes introRingA{
  0%{ opacity:0; transform:scale(.5) rotate(0deg); }
  45%{ opacity:.45; }
  100%{ opacity:0; transform:scale(1.24) rotate(30deg); }
}
@keyframes introRingB{
  0%{ opacity:0; transform:scale(.42) rotate(0deg); }
  45%{ opacity:.34; }
  100%{ opacity:0; transform:scale(1.36) rotate(-24deg); }
}
@keyframes introRingC{
  0%{ opacity:0; transform:scale(.35) rotate(0deg); }
  45%{ opacity:.28; }
  100%{ opacity:0; transform:scale(1.44) rotate(18deg); }
}



/* intro title */
.intro-title{
  position:absolute;
  top:6%;
  left:50%;
  transform:translateX(-50%);
  font-size:clamp(36px,6vw,64px);
  font-weight:800;
  letter-spacing:.08em;
  z-index:5;
  opacity:0;
  animation:introTitleFade 1.2s ease forwards .9s;
}

.intro-title-mirio{
  color:#ffffff;
  margin-right:14px;
}

.intro-title-crm{
  background:linear-gradient(90deg,#4f9cff,#60e7c7);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
}

@keyframes introTitleFade{
  from{
    opacity:0;
    transform:translate(-50%, -20px);
  }
  to{
    opacity:1;
    transform:translate(-50%, 0);
  }
}



/* ===== Stage 70 cinematic intro ===== */

.intro-symbol-scene{
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
}

.intro-title{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%, -170%);
  font-size:clamp(42px,6vw,72px);
  font-weight:900;
  letter-spacing:.08em;
  text-align:center;
  z-index:10;
  opacity:0;
  animation:introTitleFade 1.1s ease forwards 1s;
}

.intro-title-mirio{
  color:#ffffff;
  margin-right:16px;
}

.intro-title-crm{
  background:linear-gradient(90deg,#4f9cff,#60e7c7);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
}

@keyframes introTitleFade{
  0%{
    opacity:0;
    transform:translate(-50%, -190%);
  }
  100%{
    opacity:1;
    transform:translate(-50%, -170%);
  }
}

/* subtle glow around logo */

.intro-logo-3d-wrap{
  position:relative;
}

.intro-logo-3d-wrap::after{
  content:"";
  position:absolute;
  inset:-40px;
  background:radial-gradient(circle, rgba(96,231,199,.35), transparent 70%);
  filter:blur(40px);
  opacity:0;
  animation:introGlow 2.2s ease forwards .8s;
}

@keyframes introGlow{
  0%{opacity:0;}
  100%{opacity:.7;}
}



/* ===== Stage 71 Premium Intro ===== */

.intro-overlay-single-logo::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 20% 20%, rgba(96,231,199,.15), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(79,156,255,.18), transparent 45%);
  pointer-events:none;
}

/* floating particles */

.intro-particles{
  position:absolute;
  inset:0;
  overflow:hidden;
  pointer-events:none;
}

.intro-particle{
  position:absolute;
  width:6px;
  height:6px;
  border-radius:50%;
  background:rgba(120,220,255,.7);
  filter:blur(.5px);
  animation:introParticleFloat linear infinite;
}

@keyframes introParticleFloat{
  from{
    transform:translateY(40px);
    opacity:0;
  }
  20%{
    opacity:.8;
  }
  100%{
    transform:translateY(-120vh);
    opacity:0;
  }
}

/* smoother logo easing */

.intro-logo-3d-wrap{
  animation:intro3DSpinPremium 2.8s cubic-bezier(.19,1,.22,1) forwards;
}

@keyframes intro3DSpinPremium{

  0%{
    opacity:0;
    transform:rotateY(-90deg) rotateX(18deg) scale(.7);
  }

  40%{
    opacity:1;
    transform:rotateY(20deg) rotateX(-6deg) scale(1.05);
  }

  70%{
    transform:rotateY(-8deg) rotateX(2deg) scale(.98);
  }

  100%{
    transform:rotateY(0deg) rotateX(0deg) scale(1);
  }
}



/* ===== Stage 72 Ultra Premium Intro ===== */

.intro-symbol-scene{
  transform-style:preserve-3d;
}

.intro-logo-3d-wrap{
  transform-style:preserve-3d;
  perspective:1800px;
}

.intro-logo-3d{
  animation:introLogoMicroFloat 5.5s ease-in-out infinite 2.9s;
}

.intro-light-sweep{
  position:absolute;
  inset:-10%;
  z-index:3;
  background:linear-gradient(
    105deg,
    rgba(255,255,255,0) 20%,
    rgba(255,255,255,.07) 42%,
    rgba(255,255,255,.33) 50%,
    rgba(255,255,255,.08) 58%,
    rgba(255,255,255,0) 80%
  );
  filter:blur(8px);
  transform:translateX(-145%) skewX(-16deg);
  animation:introSweep 1.45s cubic-bezier(.19,1,.22,1) forwards 1.9s;
  pointer-events:none;
}

.intro-symbol-scene::after{
  content:"";
  position:absolute;
  inset:8% 18% 18% 18%;
  border-radius:50%;
  background:radial-gradient(circle, rgba(255,255,255,.08), rgba(255,255,255,0) 68%);
  filter:blur(26px);
  opacity:.55;
  animation:introSceneBreath 4.4s ease-in-out infinite;
  pointer-events:none;
}

.intro-title{
  text-shadow:
    0 0 18px rgba(255,255,255,.10),
    0 0 40px rgba(79,156,255,.08);
}

.intro-title-crm{
  filter:drop-shadow(0 0 16px rgba(79,156,255,.18));
}

.intro-ring{
  mix-blend-mode:screen;
}

.intro-ring-a{
  border-color:rgba(115,229,255,.18);
  animation:introRingA 2.8s ease-out forwards .18s;
}
.intro-ring-b{
  border-color:rgba(79,156,255,.16);
  animation:introRingB 3.1s ease-out forwards .34s;
}
.intro-ring-c{
  border-color:rgba(96,231,199,.14);
  animation:introRingC 3.35s ease-out forwards .52s;
}

.intro-overlay-single-logo{
  overflow:hidden;
}

.intro-overlay-single-logo::after{
  content:"";
  position:absolute;
  inset:-20%;
  background:
    linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.035) 30%, rgba(255,255,255,0) 60%),
    radial-gradient(circle at 50% 50%, rgba(79,156,255,.08), transparent 48%);
  animation:introBackgroundDrift 9s linear infinite;
  pointer-events:none;
}

.login-shell-hidden{
  filter:blur(10px);
}
.login-shell-hidden.is-visible{
  filter:blur(0);
  transition:
    opacity .65s ease,
    transform .65s ease,
    visibility .65s ease,
    filter .65s ease;
}

@keyframes introSweep{
  0%{ transform:translateX(-145%) skewX(-16deg); opacity:0; }
  18%{ opacity:1; }
  100%{ transform:translateX(135%) skewX(-16deg); opacity:0; }
}

@keyframes introLogoMicroFloat{
  0%,100%{ transform:translateY(0) translateZ(0) scale(1); }
  50%{ transform:translateY(-6px) translateZ(8px) scale(1.01); }
}

@keyframes introSceneBreath{
  0%,100%{ transform:scale(1); opacity:.45; }
  50%{ transform:scale(1.06); opacity:.72; }
}

@keyframes introBackgroundDrift{
  0%{ transform:translate3d(-2%,0,0) rotate(0deg); }
  50%{ transform:translate3d(2%,1%,0) rotate(1.2deg); }
  100%{ transform:translate3d(-2%,0,0) rotate(0deg); }
}


.profile-avatar-image{
  width:40px;
  height:40px;
  border-radius:999px;
  object-fit:cover;
  box-shadow:0 8px 18px rgba(31,42,61,.14);
}

.profile-links{
  display:grid;
  gap:8px;
  margin-top:6px;
}

.profile-link-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius:12px;
  background:var(--surface-2);
  color:var(--text);
  font-weight:700;
  border:1px solid var(--line);
}

.profile-link-secondary{
  background:transparent;
}

.profile-settings-card{
  max-width:860px;
}

.profile-settings-head{
  display:flex;
  align-items:center;
  gap:18px;
  margin-bottom:22px;
}

.profile-settings-avatar-wrap{
  width:84px;
  height:84px;
  flex:0 0 84px;
}

.profile-settings-avatar,
.profile-settings-avatar-fallback{
  width:84px;
  height:84px;
  border-radius:999px;
  object-fit:cover;
}

.profile-settings-avatar-fallback{
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#ffcc89,#ff8d62);
  color:#1f2a3d;
  font-size:28px;
  font-weight:800;
  box-shadow:0 10px 24px rgba(31,42,61,.12);
}


.account-center-grid{
  display:grid;
  gap:18px;
}

.account-center-hero{
  overflow:hidden;
}

.account-center-hero-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
}

.account-role-pill{
  padding:10px 14px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--surface-2);
  font-weight:700;
  text-transform:capitalize;
}

.account-kpis{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}

.account-kpi{
  padding:16px;
  border-radius:16px;
  background:var(--surface-2);
  border:1px solid var(--line);
}

.account-kpi-label{
  color:var(--muted);
  margin-bottom:6px;
  font-size:13px;
}

.account-kpi-value{
  font-size:28px;
  font-weight:800;
  line-height:1;
}

.account-actions-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.account-action-card{
  display:block;
  padding:18px;
  border-radius:18px;
  border:1px solid var(--line);
  background:var(--surface-2);
  transition:transform .18s ease, border-color .18s ease;
}

.account-action-card:hover{
  transform:translateY(-2px);
  border-color:rgba(102,126,234,.45);
}

.account-action-title{
  font-weight:800;
  margin-bottom:8px;
  color:var(--text);
}

.account-action-text{
  color:var(--muted);
  line-height:1.5;
}

.eyebrow{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(102,126,234,.12);
  border:1px solid rgba(102,126,234,.22);
  font-size:12px;
  font-weight:700;
  color:var(--text);
  margin-bottom:12px;
}

@media (max-width: 900px){
  .account-kpis,
  .account-actions-grid{
    grid-template-columns:1fr;
  }
}


.sidebar-footer{
  position:relative;
  z-index:3;
}

.profile-card-link{
  display:flex;
  width:100%;
  cursor:pointer;
  position:relative;
  z-index:4;
}

.profile-link-btn{
  display:flex;
  width:100%;
  justify-content:center;
  cursor:pointer;
  position:relative;
  z-index:4;
}

.profile-link-primary{
  margin-top:8px;
}

.sidebar-footer a{
  pointer-events:auto;
}


.profile-card-link{
  display:flex;
  width:100%;
  cursor:pointer;
  position:relative;
  z-index:4;
  border-radius:16px;
  transition:transform .18s ease,border-color .18s ease,background .18s ease;
}

.profile-card-link:hover{
  background:var(--surface-2);
  transform:translateY(-1px);
}

.profile-card-active{
  border:1px solid rgba(102,126,234,.38);
  background:rgba(102,126,234,.10);
}

.sidebar-footer{
  position:relative;
  z-index:3;
}

.sidebar-footer .logout-link{
  width:100%;
  justify-content:center;
}


.account-center-trigger-form{
  margin:0;
}

.profile-card-button{
  width:100%;
  border:0;
  background:transparent;
  text-align:left;
  cursor:pointer;
  padding:12px 8px;
}

.profile-card-button:hover{
  background:var(--surface-2);
}

.profile-card-button .profile-meta{
  text-align:left;
}

.profile-card-button:focus{
  outline:none;
  box-shadow:0 0 0 3px rgba(102,126,234,.18);
}


.clickable-avatar-wrap{
  position:relative;
  cursor:pointer;
  transition:transform .16s ease;
}

.clickable-avatar-wrap:hover{
  transform:scale(1.035);
}

.avatar-hover-label{
  position:absolute;
  inset:auto 50% 8px 50%;
  transform:translateX(-50%);
  padding:6px 10px;
  border-radius:999px;
  background:rgba(17,26,49,.72);
  color:#fff;
  font-size:11px;
  font-weight:700;
  letter-spacing:.01em;
  opacity:0;
  transition:opacity .16s ease;
  pointer-events:none;
  white-space:nowrap;
}

.clickable-avatar-wrap:hover .avatar-hover-label{
  opacity:1;
}

html[data-theme="dark"] .avatar-hover-label{
  background:rgba(255,255,255,.14);
  color:#fff;
}


.clickable-avatar-wrap input[type="file"]{
  display:none !important;
}






.toggle-password{
position:absolute;
right:10px;
cursor:pointer;
opacity:0.7;
font-size:14px;
}

.password-warning{
color:#ff4d4f;
font-size:12px;
margin-top:5px;
}







.toggle-password{
  position:absolute;
  right:12px;
  cursor:pointer;
  opacity:.8;
  font-size:14px;
  user-select:none;
  line-height:1;
}

.toggle-password:hover{
  opacity:1;
}

.password-warning{
  color:#ff4d4f;
  font-size:12px;
  margin-top:6px;
}

.input-error{
  border:1px solid #ff4d4f !important;
  box-shadow:0 0 0 3px rgba(255,77,79,.12);
}

.password-strength{
  margin-top:8px;
}

.password-strength-bar{
  height:8px;
  border-radius:999px;
  background:rgba(120,130,150,.18);
  overflow:hidden;
}

.password-strength-bar span{
  display:block;
  width:0;
  height:100%;
  border-radius:999px;
  transition:width .18s ease;
}

.password-strength-label{
  font-size:12px;
  margin-top:6px;
  color:var(--text-soft);
}

.password-strength.is-weak .password-strength-bar span{
  background:#ff5c6b;
}
.password-strength.is-medium .password-strength-bar span{
  background:#f6b51e;
}
.password-strength.is-good .password-strength-bar span{
  background:#4c6fff;
}
.password-strength.is-strong .password-strength-bar span{
  background:#25b26d;
}


/* Stage 88B visual cleanup */
.password-card{
  max-width:980px;
}

.password-form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}

.password-form-grid .form-actions{
  grid-column:1 / -1;
}

.password-field-wrap{
  min-width:0;
}





.toggle-password{
  position:absolute;
  right:14px;
  top:50%;
  transform:translateY(-50%);
  z-index:3;
  width:28px;
  height:28px;
  border:0;
  background:transparent;
  color:var(--text-soft);
  cursor:pointer;
  display:grid;
  place-items:center;
  border-radius:999px;
  line-height:1;
}

.toggle-password:hover{
  color:var(--text);
  background:rgba(127,140,170,.12);
}

.password-strength{
  margin-top:10px;
}

.password-strength-bar{
  height:7px;
  border-radius:999px;
  background:rgba(120,130,150,.18);
  overflow:hidden;
}

.password-strength-bar span{
  display:block;
  width:0;
  height:100%;
  border-radius:999px;
  transition:width .18s ease;
}

.password-strength-label{
  font-size:12px;
  margin-top:6px;
  color:var(--text-soft);
}

.password-warning{
  color:#ff6b75;
  font-size:12px;
  margin-top:6px;
  line-height:1.35;
}

.input-error{
  border:1px solid #ff5c6b !important;
  box-shadow:0 0 0 3px rgba(255,92,107,.12);
}

.password-strength.is-weak .password-strength-bar span{background:#ff5c6b;}
.password-strength.is-medium .password-strength-bar span{background:#f6b51e;}
.password-strength.is-good .password-strength-bar span{background:#4c6fff;}
.password-strength.is-strong .password-strength-bar span{background:#25b26d;}

.invite-user-card{
  max-width:1100px;
}

.invite-user-grid{
  grid-template-columns:repeat(4,minmax(0,1fr));
}

.activity-card{
  overflow:hidden;
}

.activity-filter-bar{
  grid-template-columns:1.2fr 1fr 1fr auto;
  align-items:end;
}

.activity-summary-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:8px 0 18px;
}

.activity-summary-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--surface-2);
  color:var(--text-soft);
  font-size:13px;
}

.activity-table-wrap table tbody tr:hover{
  background:rgba(102,126,234,.06);
}

.activity-date-cell{
  white-space:nowrap;
}

.activity-description-cell{
  max-width:520px;
  line-height:1.5;
}

.activity-badge,
.activity-entity-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  line-height:1;
  border:1px solid transparent;
}

.activity-badge.success{background:rgba(37,178,109,.14); color:#25b26d;}
.activity-badge.info{background:rgba(76,111,255,.14); color:#6c8cff;}
.activity-badge.danger{background:rgba(255,92,107,.14); color:#ff7280;}
.activity-badge.muted{background:rgba(127,140,170,.14); color:var(--text-soft);}
.activity-entity-pill{background:rgba(143,85,255,.14); color:#b395ff;}

@media (max-width: 1100px){
  .invite-user-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .activity-filter-bar{
    grid-template-columns:1fr 1fr;
  }
}

@media (max-width: 860px){
  .password-form-grid,
  .invite-user-grid,
  .activity-filter-bar{
    grid-template-columns:1fr;
  }
}






/* Stage 91 – eye toggle state fix */
.password-field{
  position:relative;
  display:block;
}

.password-field input{
  width:100%;
  padding-right:46px;
}

.password-toggle{
  all:unset;
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
  cursor:pointer;
  color:#111827;
  z-index:3;
  line-height:1;
}

html[data-theme="dark"] .password-toggle{
  color:#f5f7ff;
}

.password-toggle:hover{
  transform:translateY(-50%) scale(1.06);
}

.password-toggle:focus{
  outline:none;
  transform:translateY(-50%) scale(1.06);
}

.eye-icon{
  position:absolute;
  inset:0;
  width:20px;
  height:20px;
  stroke:currentColor;
  stroke-width:1.8;
  fill:none;
  opacity:0;
  transform:scale(.92);
  transition:opacity .16s ease, transform .16s ease;
  overflow:visible;
}

.password-toggle.is-hidden-password .eye-closed{
  opacity:1;
  transform:scale(1);
}

.password-toggle.is-visible-password .eye-open{
  opacity:1;
  transform:scale(1);
}

.password-toggle.is-hidden-password .eye-open{
  opacity:0;
  transform:scale(.92);
}

.password-toggle.is-visible-password .eye-closed{
  opacity:0;
  transform:scale(.92);
}

.password-toggle.is-visible-password .eye-open{
  animation:eyeOpenSwap .18s ease;
}

.password-toggle.is-hidden-password .eye-closed{
  animation:eyeCloseSwap .18s ease;
}

@keyframes eyeOpenSwap{
  0%{opacity:0; transform:scale(.88)}
  100%{opacity:1; transform:scale(1)}
}

@keyframes eyeCloseSwap{
  0%{opacity:0; transform:scale(.88)}
  100%{opacity:1; transform:scale(1)}
}


/* Stage 91B – remove eye background completely */

.password-toggle{
all:unset !important;
background:transparent !important;
border:none !important;
box-shadow:none !important;
padding:0 !important;

position:absolute;
right:10px;
top:50%;
transform:translateY(-50%);

width:22px;
height:22px;

display:flex;
align-items:center;
justify-content:center;

cursor:pointer;
color:#111827;
z-index:5;
}

html[data-theme="dark"] .password-toggle{
color:#ffffff;
}

.password-toggle *{
background:transparent !important;
box-shadow:none !important;
}


/* Stage 91C – ensure eye icon is visible */
.password-toggle{
  all: unset !important;
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 22px !important;
  height: 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 6 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: #111827 !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .password-toggle{
  color: #ffffff !important;
}

.password-toggle .eye-icon{
  position: absolute !important;
  inset: 0 !important;
  width: 20px !important;
  height: 20px !important;
  display: block !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  fill: none !important;
  overflow: visible !important;
  opacity: 0 !important;
  transform: scale(.92) !important;
  transition: opacity .16s ease, transform .16s ease !important;
}

.password-toggle.is-hidden-password .eye-closed{
  opacity: 1 !important;
  transform: scale(1) !important;
}

.password-toggle.is-visible-password .eye-open{
  opacity: 1 !important;
  transform: scale(1) !important;
}

.password-toggle.is-hidden-password .eye-open{
  opacity: 0 !important;
  transform: scale(.92) !important;
}

.password-toggle.is-visible-password .eye-closed{
  opacity: 0 !important;
  transform: scale(.92) !important;
}

.password-toggle:hover{
  background: transparent !important;
  color: #4c6fff !important;
}

/* Stage 91D – final eye toggle cleanup */
.password-field{
  position:relative;
}

.password-field input[type="password"],
.password-field input[type="text"]{
  padding-right:52px !important;
}

.password-toggle,
button.password-toggle,
.password-field .password-toggle{
  -webkit-appearance:none !important;
  appearance:none !important;
  background:none !important;
  background-color:transparent !important;
  background-image:none !important;
  border:0 !important;
  border-color:transparent !important;
  border-radius:0 !important;
  box-shadow:none !important;
  outline:none !important;
  text-decoration:none !important;
  position:absolute !important;
  top:50% !important;
  right:12px !important;
  left:auto !important;
  transform:translateY(-50%) !important;
  width:20px !important;
  min-width:20px !important;
  max-width:20px !important;
  height:20px !important;
  min-height:20px !important;
  max-height:20px !important;
  padding:0 !important;
  margin:0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:visible !important;
  cursor:pointer !important;
  z-index:8 !important;
  color:#111111 !important;
  line-height:1 !important;
}

html[data-theme="dark"] .password-toggle,
html[data-theme="dark"] button.password-toggle,
html[data-theme="dark"] .password-field .password-toggle{
  color:#ffffff !important;
}

.password-toggle:hover,
.password-toggle:active,
.password-toggle:focus,
button.password-toggle:hover,
button.password-toggle:active,
button.password-toggle:focus{
  -webkit-appearance:none !important;
  appearance:none !important;
  background:none !important;
  background-color:transparent !important;
  background-image:none !important;
  border:0 !important;
  border-color:transparent !important;
  box-shadow:none !important;
  outline:none !important;
  transform:translateY(-50%) !important;
}

.password-toggle::before,
.password-toggle::after,
button.password-toggle::before,
button.password-toggle::after{
  content:none !important;
  display:none !important;
}

.password-toggle .eye-icon,
button.password-toggle .eye-icon{
  position:absolute !important;
  inset:0 !important;
  width:20px !important;
  height:20px !important;
  display:block !important;
  color:inherit !important;
  stroke:currentColor !important;
  fill:none !important;
  stroke-width:1.9 !important;
  stroke-linecap:round !important;
  stroke-linejoin:round !important;
  vector-effect:non-scaling-stroke !important;
  overflow:visible !important;
  pointer-events:none !important;
}

html:not([data-theme="dark"]) .password-toggle,
:root .password-toggle{
  color:#111111 !important;
}


/* Stage 91E – replace native button styling with pure icon span */
.password-field{ position:relative !important; }
.password-field input[type="password"], .password-field input[type="text"]{ padding-right:56px !important; }
span.password-toggle{ position:absolute !important; top:50% !important; right:14px !important; transform:translateY(-50%) !important; display:flex !important; align-items:center !important; justify-content:center !important; width:22px !important; height:22px !important; margin:0 !important; padding:0 !important; background:transparent !important; background-color:transparent !important; background-image:none !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; outline:none !important; color:#111111 !important; cursor:pointer !important; z-index:20 !important; -webkit-tap-highlight-color:transparent !important; user-select:none !important; }
html[data-theme="dark"] span.password-toggle{ color:#ffffff !important; }
span.password-toggle::before, span.password-toggle::after{ content:none !important; display:none !important; }
span.password-toggle .eye-icon{ position:absolute !important; inset:0 !important; display:block !important; width:22px !important; height:22px !important; margin:0 !important; padding:0 !important; background:transparent !important; fill:none !important; stroke:currentColor !important; stroke-width:1.9 !important; stroke-linecap:round !important; stroke-linejoin:round !important; vector-effect:non-scaling-stroke !important; }
span.password-toggle .eye-open, span.password-toggle .eye-closed{ opacity:0 !important; transform:scale(.92) !important; transition:opacity .16s ease, transform .16s ease !important; }
span.password-toggle.is-hidden-password .eye-closed{ opacity:1 !important; transform:scale(1) !important; }
span.password-toggle.is-visible-password .eye-open{ opacity:1 !important; transform:scale(1) !important; }
span.password-toggle:focus-visible{ outline:none !important; }


/* FINAL-RC2.1 topbar restore */
.topbar-actions{
  display:flex !important;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.topbar-actions .toolbar-chip,
.topbar-actions .icon-btn{
  visibility:visible !important;
  opacity:1 !important;
}


/* FINAL-RC2.4 search overlay + billing cleanup */
.global-spotlight[hidden]{display:none !important;}
.global-spotlight{
  position:fixed; inset:0; z-index:9999;
}
.global-spotlight-backdrop{
  position:absolute; inset:0;
  background:rgba(10,14,24,.16);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  opacity:0; transition:opacity .18s ease;
}
.global-spotlight-panel{
  position:relative;
  width:min(940px, calc(100vw - 28px));
  margin:82px auto 0;
  border:1px solid rgba(255,255,255,.18);
  border-radius:28px;
  background:linear-gradient(180deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,.07) 100%);
  backdrop-filter:blur(28px);
  -webkit-backdrop-filter:blur(28px);
  box-shadow:0 30px 90px rgba(0,0,0,.22);
  overflow:hidden;
  opacity:0; transform:translateY(-8px) scaleY(.18);
  transform-origin:top center;
  transition:transform .22s ease, opacity .22s ease;
}
.global-spotlight.is-open .global-spotlight-backdrop{opacity:1;}
.global-spotlight.is-open .global-spotlight-panel{opacity:1; transform:translateY(0) scaleY(1);}
.global-spotlight-head{padding:16px; border-bottom:1px solid rgba(255,255,255,.08);}
.global-spotlight-input-wrap{
  display:flex; align-items:center; gap:12px;
  min-height:68px; padding:0 16px;
  border:1px solid rgba(255,255,255,.10); border-radius:20px;
  background:rgba(255,255,255,.04);
}
.global-spotlight-icon{font-size:20px; opacity:.82;}
#global-spotlight-input{flex:1; border:none; outline:none; background:transparent; font-size:20px; color:var(--text);}
.global-spotlight-close{border:none; background:transparent; font-size:28px; cursor:pointer; color:var(--text);}
.global-spotlight-meta{
  display:flex; justify-content:space-between; gap:16px;
  padding:10px 18px; font-size:12px; color:var(--text-soft);
  border-bottom:1px solid rgba(255,255,255,.08);
}
.global-spotlight-results{max-height:min(calc(100vh - 190px), 760px); overflow:auto; padding:8px;}
.global-spotlight-item{
  display:flex; justify-content:space-between; gap:14px; align-items:flex-start;
  padding:14px; border-radius:16px; color:var(--text); text-decoration:none;
}
.global-spotlight-item:hover{background:rgba(255,255,255,.05);}
.global-spotlight-item-title{font-size:15px; font-weight:700;}
.global-spotlight-item-subtitle{margin-top:4px; font-size:13px; color:var(--text-soft);}
.global-spotlight-section{
  display:inline-flex; align-items:center; min-height:28px; padding:0 10px;
  border-radius:999px; border:1px solid rgba(255,255,255,.10);
  font-size:12px; color:var(--text-soft); background:rgba(255,255,255,.04);
}
.global-spotlight-empty{padding:22px 16px; color:var(--text-soft); text-align:center;}


/* FINAL-RC2.7 admin context + topbar dropdown repair */
.toolbar-dropdown{
  position:relative;
}
.toolbar-dropdown-toggle{
  border:none;
  cursor:pointer;
}
.toolbar-dropdown-menu{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  min-width:220px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--surface);
  box-shadow:var(--shadow);
  display:grid;
  gap:6px;
  z-index:120;
}
.toolbar-dropdown-menu[hidden]{
  display:none !important;
}
.toolbar-dropdown-menu a{
  display:block;
  padding:10px 12px;
  border-radius:12px;
  color:var(--text);
}
.toolbar-dropdown-menu a:hover{
  background:var(--surface-2);
}


/* FINAL-RC2.8 admin authority + router cleanup */
.sidebar-admin-link{
  width:100%;
}
.toolbar-dropdown{
  position:relative;
}
.toolbar-dropdown-toggle{
  border:none;
  cursor:pointer;
}
.toolbar-dropdown-menu{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  min-width:220px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--surface);
  box-shadow:var(--shadow);
  display:grid;
  gap:6px;
  z-index:120;
}
.toolbar-dropdown-menu[hidden]{
  display:none !important;
}
.toolbar-dropdown-menu a{
  display:block;
  padding:10px 12px;
  border-radius:12px;
  color:var(--text);
}
.toolbar-dropdown-menu a:hover{
  background:var(--surface-2);
}


/* FINAL-RC2.8.1 hard admin visibility */
.sidebar-admin-link{width:100%;}
.toolbar-dropdown{position:relative;}
.toolbar-dropdown-toggle{border:none;cursor:pointer;}
.toolbar-dropdown-menu{
  position:absolute; right:0; top:calc(100% + 10px);
  min-width:220px; padding:10px; border:1px solid var(--line);
  border-radius:18px; background:var(--surface); box-shadow:var(--shadow);
  display:grid; gap:6px; z-index:120;
}
.toolbar-dropdown-menu[hidden]{display:none !important;}
.toolbar-dropdown-menu a{
  display:block; padding:10px 12px; border-radius:12px; color:var(--text);
}
.toolbar-dropdown-menu a:hover{background:var(--surface-2);}


/* FINAL-RC3.2 stabilization pass */
.toolbar-dropdown{position:relative;}
.toolbar-dropdown-toggle{border:none;cursor:pointer;}
.toolbar-dropdown-menu{
  position:absolute; right:0; top:calc(100% + 10px);
  min-width:220px; padding:10px; border:1px solid var(--line);
  border-radius:18px; background:var(--surface); box-shadow:var(--shadow);
  display:grid; gap:6px; z-index:120;
}
.toolbar-dropdown-menu[hidden]{display:none !important;}
.toolbar-dropdown-menu a{display:block; padding:10px 12px; border-radius:12px; color:var(--text);}
.toolbar-dropdown-menu a:hover{background:var(--surface-2);}
.sidebar-admin-link{width:100%;}
.global-spotlight[hidden]{display:none !important;}


/* UI_SETTINGS_STABILIZATION_PATCH */
html, body, input, button, select, textarea {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}
.notif-nav-ico{position:relative; display:inline-flex; align-items:center; justify-content:center; min-width:18px;}
.notif-badge{
  position:absolute; top:-8px; right:-10px; min-width:18px; height:18px; padding:0 5px;
  border-radius:999px; display:inline-flex; align-items:center; justify-content:center;
  font-size:10px; line-height:1; font-weight:700;
  background: rgba(220, 38, 38, 0.95); color:#fff; border:1px solid rgba(255,255,255,.25);
}
.toolbar-dropdown-menu button{
  display:block; width:100%; text-align:left; padding:10px 12px; border-radius:12px;
  color:var(--text); background:transparent; border:none; cursor:pointer;
}
.toolbar-dropdown-menu button:hover{background:var(--surface-2);}
.btn, button, .toolbar-chip, .account-action-card{border-radius:12px;}
button, .btn{font:inherit;}
input, select, textarea, button, a, .btn, .toolbar-chip, .account-action-title, .page-subtitle, .section-title { unicode-bidi: plaintext; }
[data-theme="dark"] .btn, [data-theme="dark"] button, [data-theme="dark"] .account-action-card, [data-theme="dark"] .toolbar-chip { color: var(--text); }
.table-wrap table th, .table-wrap table td, .card, .page-subtitle, .section-title, .account-action-text { word-break: normal; overflow-wrap: anywhere; }


/* FINAL_UI_PATCH_SETTINGS_PROFORMA */
.settings-page-card,
.document-page-card{
  max-width:1180px;
}

.form-grid.settings-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(280px,1fr));
  gap:20px 34px;
  align-items:start;
}

.form-grid.settings-grid .field{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.form-grid.settings-grid .field label{
  font-size:13px;
  color:var(--text-soft);
  font-weight:600;
}

.form-grid.settings-grid .field input,
.form-grid.settings-grid .field select,
.form-grid.settings-grid .field textarea{
  width:100%;
  border:1px solid var(--line);
  background:var(--surface-2);
  color:var(--text);
  border-radius:14px;
  padding:12px 14px;
  min-height:46px;
}

.form-grid.settings-grid .field textarea{
  min-height:120px;
}

.settings-subtitle{
  color:var(--text-soft);
  margin:-6px 0 14px;
}

.form-actions.settings-actions{
  grid-column:1 / -1;
  margin-top:4px;
}

.notif-topbar-btn{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.notif-bell{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:18px;
}

.notif-badge{
  position:absolute;
  top:-7px;
  right:-7px;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:10px;
  line-height:1;
  font-weight:700;
  background:rgba(220,38,38,.95);
  color:#fff;
  border:1px solid rgba(255,255,255,.22);
}

.toolbar-dropdown-menu button,
.toolbar-dropdown-menu a{
  display:block;
  width:100%;
  text-align:left;
  padding:10px 12px;
  border-radius:12px;
  color:var(--text);
  background:transparent;
  border:none;
  cursor:pointer;
}

.toolbar-dropdown-menu button:hover,
.toolbar-dropdown-menu a:hover{
  background:var(--surface-2);
}

.recent-activity, .recent-activity *{
  unicode-bidi:plaintext;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
}

.proforma-header{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:20px;
  align-items:start;
}

.proforma-meta{
  text-align:right;
  color:var(--text-soft);
}

.proforma-box{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px 24px;
  margin-top:20px;
}

.proforma-panel{
  border:1px solid var(--line);
  background:var(--surface-2);
  border-radius:16px;
  padding:16px;
}

.proforma-items{
  margin-top:18px;
}

.proforma-table{
  width:100%;
  border-collapse:collapse;
}

.proforma-table th,
.proforma-table td{
  padding:12px 10px;
  border-bottom:1px solid var(--line);
  text-align:left;
}

.proforma-total{
  display:flex;
  justify-content:flex-end;
  margin-top:16px;
  font-size:18px;
  font-weight:700;
}

@media (max-width: 900px){
  .form-grid.settings-grid,
  .proforma-box,
  .proforma-header{
    grid-template-columns:1fr;
  }
  .proforma-meta{
    text-align:left;
  }
}


/* HOTFIX_PROFORMA_REFERENCE */
.invoice-sheet-ref{
  background:#fff;
  color:#17324d;
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 16px 40px rgba(0,0,0,.14);
  border:1px solid rgba(255,255,255,.14);
}
.invoice-topband{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:22px 26px;
  background:linear-gradient(135deg,#f7fbff 0%,#dbeafe 36%,var(--invoice-primary, #1d4ed8) 36%,var(--invoice-secondary, #1e40af) 100%);
}
.invoice-brand-logo{width:56px;height:56px;object-fit:contain;border-radius:16px;background:#fff;padding:6px;box-shadow:0 8px 18px rgba(17,80,136,.12);} 
.invoice-branding{display:flex;align-items:center;gap:14px;color:#11406d}
.invoice-brand-mark{
  width:56px;height:56px;border-radius:16px;
  background:linear-gradient(135deg,#14b8a6,var(--invoice-primary, #1d4ed8));
  color:#fff;display:flex;align-items:center;justify-content:center;
  font-weight:800;font-size:24px;
}
.invoice-brand-name{font-size:26px;font-weight:800;line-height:1.1;color:#115088}
.invoice-brand-sub{font-size:12px;opacity:.75}
.invoice-title-chip{
  color:#fff;background:rgba(3,22,65,.18);padding:14px 24px;border-radius:12px;
  font-size:34px;font-weight:900;letter-spacing:.02em;box-shadow:inset 0 1px 0 rgba(255,255,255,.2);
}
.invoice-head-grid,.invoice-two-cols{
  display:grid;grid-template-columns:1fr 1fr;gap:18px;padding:24px 26px 0 26px;
}
.invoice-issued-box,.invoice-meta-box,.invoice-panel{
  background:#f8fbff;border:1px solid #d7e3f3;border-radius:16px;padding:18px 18px 16px;
}
.invoice-meta-row{display:flex;justify-content:space-between;gap:16px;padding:8px 0;border-bottom:1px solid #dbe5f1}
.invoice-meta-row:last-child{border-bottom:none}
.invoice-section-title,.invoice-panel-title{
  font-size:18px;font-weight:800;color:#144e83;margin-bottom:12px;
}
.invoice-client-name{font-size:28px;font-weight:800;margin-bottom:8px;color:#17324d}
.invoice-ref-table{
  width:calc(100% - 52px);margin:22px 26px 0;border-collapse:collapse;overflow:hidden;border-radius:14px;
}
.invoice-sheet-ref .invoice-ref-table thead th{
  background:linear-gradient(135deg,var(--invoice-primary, #1d4ed8),var(--invoice-secondary, #1e3a8a));color:#fff !important;padding:14px 12px;font-size:16px;text-align:left;
}
.invoice-sheet-ref .invoice-ref-table tbody td{
  padding:16px 12px;border-bottom:1px solid #dbe5f1;background:#fff !important;font-size:15px;color:#17324d !important;
}
.invoice-ref-table tbody tr:nth-child(even) td{background:#f8fbff}
.invoice-totals-box{
  width:380px;max-width:calc(100% - 52px);margin:20px 26px 0 auto;border-radius:16px;overflow:hidden;
  border:1px solid #d7e3f3;background:#fff;
}
.invoice-total-row,.invoice-total-grand{
  display:flex;justify-content:space-between;gap:16px;padding:14px 18px;color:#17324d;
}
.invoice-total-row{border-bottom:1px solid #dbe5f1}
.invoice-total-grand{background:linear-gradient(135deg,var(--invoice-primary, #1d4ed8),var(--invoice-secondary, #1e3a8a));color:#fff;font-size:20px;font-weight:800}
.invoice-footer-note{
  margin:28px 26px 30px;padding-top:18px;border-top:1px solid #dbe5f1;color:#17324d;font-size:15px;
}
@media print{
  .actions,.sidebar,.topbar,.trial-banner{display:none!important}
  body{background:#fff!important}
  .invoice-sheet-ref{box-shadow:none;border:none}
}
@media (max-width: 960px){
  .invoice-head-grid,.invoice-two-cols{grid-template-columns:1fr}
  .invoice-title-chip{font-size:24px}
  .invoice-brand-name{font-size:22px}
  .invoice-totals-box{width:auto;margin-left:26px}
}


/* HOTFIX_NOTIFICATIONS_DATE_DELETE */
.topbar-notif-only{
  position:relative;
  width:18px;
  height:18px;
  padding:0;
  border:none;
  background:transparent;
  cursor:pointer;
}
.topbar-notif-only .topbar-notif-badge{
  position:static;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(220,38,38,.98);
  color:#fff;
  font-size:11px;
  font-weight:800;
  box-shadow:0 2px 8px rgba(220,38,38,.35);
  border:1px solid rgba(255,255,255,.22);
}
.toolbar-dropdown{position:relative;}
.toolbar-dropdown-menu{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  min-width:220px;
  z-index:1000;
  padding:8px;
  border-radius:16px;
  background:rgba(24,26,36,.96);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 18px 50px rgba(0,0,0,.35);
}
.toolbar-dropdown-menu[hidden]{display:none !important;}
.toolbar-dropdown-menu.open{display:block;}
.toolbar-dropdown-menu button{
  display:block;
  width:100%;
  text-align:left;
  padding:10px 12px;
  border-radius:12px;
  border:none;
  background:transparent;
  color:var(--text);
  cursor:pointer;
}
.toolbar-dropdown-menu button:hover{background:rgba(255,255,255,.06);}
.btn-danger{
  background:linear-gradient(135deg,#dc2626,#b91c1c);
  color:#fff;
}


/* REAL_FIX_NOTIFICATIONS_RANGE_DELETE_BRANDING_SEARCH */
.topbar-notif-only{
  position:relative;
  width:22px;
  height:22px;
  padding:0;
  border:none;
  background:transparent;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.topbar-notif-badge,.notif-badge{
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(220,38,38,.98);
  color:#fff;
  font-size:11px;
  font-weight:800;
  border:1px solid rgba(255,255,255,.22);
  box-shadow:0 4px 12px rgba(220,38,38,.35);
}
.toolbar-dropdown{position:relative;}
.toolbar-dropdown-menu{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  min-width:220px;
  z-index:1000;
  padding:8px;
  border-radius:16px;
  background:rgba(24,26,36,.96);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 18px 50px rgba(0,0,0,.35);
}
.toolbar-dropdown-menu[hidden]{display:none!important;}
.toolbar-dropdown-menu button{
  display:block;
  width:100%;
  text-align:left;
  padding:10px 12px;
  border-radius:12px;
  border:none;
  background:transparent;
  color:var(--text);
  cursor:pointer;
}
.toolbar-dropdown-menu button:hover{background:rgba(255,255,255,.06);}
.btn, button, .toolbar-chip{
  border-radius:12px;
}
.btn-danger{
  background:linear-gradient(135deg,#dc2626,#b91c1c)!important;
  color:#fff!important;
}
.actions .btn, .filter-actions .btn, .form-actions .btn, .form-actions button{
  min-height:40px;
  padding:0 16px;
}
.workspace-logo-preview{
  max-width:96px;
  max-height:96px;
  border-radius:14px;
  display:block;
  margin-top:8px;
  border:1px solid rgba(255,255,255,.12);
}

.invoice-brand-logo{
  width:64px;
  height:64px;
  object-fit:contain;
  border-radius:14px;
  background:#fff;
  padding:6px;
  box-shadow:0 6px 18px rgba(0,0,0,.12);
}


/* SCREENSHOT_FIX_DASHBOARD_DELETE_BRANDING */
.range-cards-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin-top:18px;
}
.range-summary-card{
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px 18px 16px;
  box-shadow:var(--shadow);
}
.range-summary-label{
  color:var(--text-soft);
  font-size:14px;
  margin-bottom:10px;
}
.range-summary-value{
  font-size:28px;
  font-weight:800;
  letter-spacing:-.02em;
  color:var(--text);
}
.activity-cards-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  margin-top:16px;
}
.activity-mini-card{
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  min-height:110px;
}
.activity-mini-date{
  color:var(--text-muted);
  font-size:13px;
  margin-bottom:8px;
}
.activity-mini-title{
  font-weight:800;
  margin-bottom:8px;
}
.activity-mini-desc{
  color:var(--text-soft);
  line-height:1.45;
}
.invoice-brand-logo{
  width:64px;
  height:64px;
  object-fit:contain;
  border-radius:14px;
  background:#fff;
  padding:6px;
  box-shadow:0 6px 18px rgba(0,0,0,.12);
}
.settings-grid input[type="color"]{
  width:100%;
  min-height:46px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--surface-2);
  padding:4px;
}
.bulk-toolbar select,
.bulk-toolbar button,
.filter-actions button,
.filter-actions .btn,
.table-wrap .btn{
  min-height:40px;
  border-radius:12px;
}
.bulk-toolbar select{
  background:var(--surface-2);
  color:var(--text);
  border:1px solid var(--line);
  padding:0 12px;
}
@media (max-width: 1200px){
  .range-cards-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width: 800px){
  .range-cards-grid,.activity-cards-grid{grid-template-columns:1fr;}
}


/* DASHBOARD_WIDGETS_FIXED */
.dashboard-shell{
  display:block;
}
.dashboard-widgets-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  margin-top:18px;
}
.dashboard-widget-card{
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:18px;
  padding:18px;
  box-shadow:var(--shadow);
  min-height:118px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.dashboard-widget-label{
  color:var(--text-soft);
  font-size:14px;
  line-height:1.35;
}
.dashboard-widget-value{
  color:var(--text);
  font-size:30px;
  font-weight:800;
  letter-spacing:-0.03em;
}
.dashboard-activity-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  margin-top:14px;
}
.dashboard-activity-item{
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  min-height:120px;
}
.dashboard-activity-item.empty{
  grid-column:1 / -1;
}
.dashboard-activity-date{
  color:var(--text-muted);
  font-size:13px;
  margin-bottom:8px;
}
.dashboard-activity-title{
  color:var(--text);
  font-weight:800;
  margin-bottom:8px;
}
.dashboard-activity-desc{
  color:var(--text-soft);
  line-height:1.45;
}
@media (max-width: 1240px){
  .dashboard-widgets-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width: 820px){
  .dashboard-widgets-grid,
  .dashboard-activity-grid{
    grid-template-columns:1fr;
  }
}


/* Stage delete modal repair */
body.modal-open{
  overflow:hidden;
}

.confirm-modal-overlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(7,12,24,.58);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .18s ease, visibility .18s ease;
  z-index:9999;
}

.confirm-modal-overlay.is-open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

.confirm-modal{
  width:min(100%, 460px);
  border-radius:22px;
  background:linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)), var(--surface);
  border:1px solid var(--line);
  box-shadow:0 24px 60px rgba(0,0,0,.35);
  padding:22px;
  transform:translateY(10px) scale(.98);
  transition:transform .18s ease;
}

.confirm-modal-overlay.is-open .confirm-modal{
  transform:translateY(0) scale(1);
}

.confirm-modal-title{
  font-size:22px;
  font-weight:800;
  line-height:1.15;
  margin:0 0 10px;
  color:var(--text);
}

.confirm-modal-message{
  color:var(--text-soft);
  line-height:1.55;
  margin:0;
}

.confirm-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:12px;
  margin-top:20px;
  flex-wrap:wrap;
}

.btn,
a.btn,
button,
input[type="submit"],
input[type="button"]{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  min-height:44px;
  line-height:1.1;
  white-space:nowrap;
}

.actions .btn,
.actions a.btn,
.table-wrap .btn,
.table-wrap a.btn,
.form-actions .btn,
.form-actions a.btn,
.confirm-modal-actions .btn,
.confirm-modal-actions a.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}


/* Stage deliverables bulk action select polish */
.actions select,
.bulk-toolbar select,
select[name="bulk_status"]{
  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;
  min-height:44px;
  height:44px;
  padding:0 44px 0 16px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01)),
    var(--surface-2);
  color:var(--text);
  font-weight:600;
  line-height:1.2;
  box-shadow:
    0 10px 24px rgba(0,0,0,.16),
    inset 0 1px 0 rgba(255,255,255,.03);
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,.7) 50%),
    linear-gradient(135deg, rgba(255,255,255,.7) 50%, transparent 50%),
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px),
    0 0;
  background-size:6px 6px, 6px 6px, 100% 100%;
  background-repeat:no-repeat;
}

.actions select:hover,
.bulk-toolbar select:hover,
select[name="bulk_status"]:hover{
  border-color:rgba(255,255,255,.14);
}

.actions select:focus,
.bulk-toolbar select:focus,
select[name="bulk_status"]:focus{
  outline:none;
  border-color:rgba(88,125,255,.58);
  box-shadow:
    0 0 0 3px rgba(88,125,255,.18),
    0 12px 28px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.03);
}

.actions select option,
.bulk-toolbar select option,
select[name="bulk_status"] option{
  color:#0f172a;
}

.actions > select,
.actions > button,
.actions > .btn,
.bulk-toolbar > select,
.bulk-toolbar > button,
.bulk-toolbar > .btn{
  min-height:44px;
}

html[data-theme="light"] .actions select,
html[data-theme="light"] .bulk-toolbar select,
html[data-theme="light"] select[name="bulk_status"]{
  border-color:rgba(15,23,42,.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,250,252,.95)),
    var(--surface-2);
  color:var(--text);
  box-shadow:
    0 8px 18px rgba(15,23,42,.08),
    inset 0 1px 0 rgba(255,255,255,.5);
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(15,23,42,.62) 50%),
    linear-gradient(135deg, rgba(15,23,42,.62) 50%, transparent 50%),
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,250,252,.95));
}

.invoice-sheet-ref .invoice-ref-table tbody td:nth-child(2),.invoice-sheet-ref .invoice-ref-table tbody td:nth-child(3),.invoice-sheet-ref .invoice-ref-table tbody td:nth-child(4){white-space:nowrap;}


/* STAGE136_3_1_NOTIFICATION_WIRING_AND_FLICKER_FIX */
.topbar-actions{
  position:relative;
}
.topbar-notif-only{
  position:fixed !important;
  top:22px;
  right:210px;
  width:56px !important;
  height:56px !important;
  padding:0 !important;
  border:none !important;
  border-radius:999px !important;
  background:transparent !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  cursor:pointer;
  z-index:1200;
  box-shadow:none !important;
  overflow:visible;
  transform:translateZ(0);
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
}
.topbar-notif-orb{
  position:absolute;
  inset:0;
  border-radius:999px;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,.22), rgba(255,255,255,0) 32%),
    radial-gradient(circle at 50% 50%, rgba(78,93,210,.28), rgba(18,25,52,.92) 72%);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:
    0 14px 34px rgba(6,11,30,.34),
    inset 0 1px 1px rgba(255,255,255,.08),
    inset 0 -10px 18px rgba(0,0,0,.14);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#eef2ff;
  will-change:transform;
  transform:translateZ(0);
}
.topbar-notif-only .topbar-notif-badge{
  position:absolute;
  top:-3px;
  right:-5px;
  min-width:24px;
  height:24px;
  padding:0 7px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(180deg,#ff5f6d,#ef4444);
  color:#fff !important;
  font-size:11px;
  font-weight:800;
  line-height:1;
  border:1px solid rgba(255,255,255,.24);
  box-shadow:0 10px 20px rgba(239,68,68,.22);
  will-change:transform;
  transform:translateZ(0);
}
.topbar-notif-only.is-empty .topbar-notif-badge{
  display:none !important;
}
.topbar-notif-only.has-count .topbar-notif-orb{
  animation:crmNotifOrbFloat 3.2s ease-in-out infinite;
}
.topbar-notif-only.has-count .topbar-notif-badge{
  animation:crmNotifBadgePop 2.2s ease-in-out infinite;
}
@keyframes crmNotifBadgePop{
  0%,100%{transform:scale(1) translateZ(0);}
  8%{transform:scale(1.10) translateZ(0);}
  14%{transform:scale(.97) translateZ(0);}
  20%{transform:scale(1.06) translateZ(0);}
  28%{transform:scale(1) translateZ(0);}
}
@keyframes crmNotifOrbFloat{
  0%,100%{transform:translateY(0) translateZ(0);}
  50%{transform:translateY(-2px) translateZ(0);}
}
html[data-theme="dark"] .page-title{
  color:#f5f7fb !important;
}
html[data-theme="dark"] .page-subtitle,
html[data-theme="dark"] .trial-banner,
html[data-theme="dark"] .trial-banner a{
  color:#cfd7ea !important;
}
@media (max-width:1200px){
  .topbar-notif-only{right:148px;}
}
@media (max-width:860px){
  .topbar-notif-only{
    top:18px;
    right:18px;
    width:52px !important;
    height:52px !important;
  }
}


/* STAGE158W_UI_CONSISTENCY_PATCH */
:root{
  --ui-topbar-control-height:44px;
  --ui-topbar-radius:14px;
  --ui-topbar-gap:12px;
  --ui-topbar-surface:linear-gradient(180deg, rgba(255,255,255,.94), rgba(246,249,255,.90));
  --ui-topbar-surface-hover:linear-gradient(180deg, rgba(255,255,255,.98), rgba(241,245,255,.96));
  --ui-topbar-border:rgba(17,24,39,.08);
  --ui-topbar-shadow:0 14px 32px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.72);
  --ui-topbar-text:#152238;
  --ui-topbar-primary:linear-gradient(135deg, #4c6fff 0%, #6380ff 100%);
  --ui-topbar-primary-border:rgba(76,111,255,.26);
  --ui-topbar-primary-shadow:0 16px 34px rgba(76,111,255,.22), inset 0 1px 0 rgba(255,255,255,.18);
  --ui-dropdown-surface:rgba(255,255,255,.90);
  --ui-dropdown-border:rgba(17,24,39,.08);
  --ui-dropdown-shadow:0 24px 50px rgba(15,23,42,.16);
  --ui-dropdown-item-hover:rgba(76,111,255,.08);
  --ui-dropdown-text:#17253b;
}
html[data-theme="dark"]{
  --ui-topbar-surface:linear-gradient(180deg, rgba(18,29,54,.94), rgba(12,21,41,.92));
  --ui-topbar-surface-hover:linear-gradient(180deg, rgba(25,38,68,.96), rgba(14,25,47,.94));
  --ui-topbar-border:rgba(255,255,255,.10);
  --ui-topbar-shadow:0 18px 40px rgba(6,11,30,.30), inset 0 1px 0 rgba(255,255,255,.07);
  --ui-topbar-text:#eef2ff;
  --ui-topbar-primary:linear-gradient(135deg, #4c6fff 0%, #6f87ff 100%);
  --ui-topbar-primary-border:rgba(124,145,255,.22);
  --ui-topbar-primary-shadow:0 18px 38px rgba(34,61,182,.34), inset 0 1px 0 rgba(255,255,255,.10);
  --ui-dropdown-surface:rgba(15,22,42,.86);
  --ui-dropdown-border:rgba(255,255,255,.08);
  --ui-dropdown-shadow:0 24px 50px rgba(0,0,0,.42);
  --ui-dropdown-item-hover:rgba(255,255,255,.08);
  --ui-dropdown-text:#f5f7ff;
}

.topbar-actions{
  gap:var(--ui-topbar-gap) !important;
  align-items:center;
}
.topbar-actions > *{
  flex:0 0 auto;
}
.toolbar-chip,
.toolbar-icon,
.icon-btn,
.notification-topbar-btn{
  height:var(--ui-topbar-control-height);
  min-height:var(--ui-topbar-control-height);
  border-radius:var(--ui-topbar-radius) !important;
}
.toolbar-chip,
.icon-btn{
  border:1px solid var(--ui-topbar-border) !important;
  background:var(--ui-topbar-surface) !important;
  color:var(--ui-topbar-text) !important;
  box-shadow:var(--ui-topbar-shadow) !important;
  backdrop-filter:blur(22px) saturate(160%);
  -webkit-backdrop-filter:blur(22px) saturate(160%);
  transition:background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.toolbar-chip:hover,
.icon-btn:hover,
.toolbar-chip:focus-visible,
.icon-btn:focus-visible{
  background:var(--ui-topbar-surface-hover) !important;
  border-color:var(--ui-topbar-border) !important;
  transform:translateY(-1px);
}
.toolbar-primary,
.toolbar-chip.toolbar-primary,
.toolbar-dropdown-toggle.toolbar-primary,
.topbar-actions a.toolbar-chip.toolbar-primary{
  background:var(--ui-topbar-primary) !important;
  color:#fff !important;
  border-color:var(--ui-topbar-primary-border) !important;
  box-shadow:var(--ui-topbar-primary-shadow) !important;
}
.toolbar-primary:hover,
.toolbar-chip.toolbar-primary:hover,
.toolbar-dropdown-toggle.toolbar-primary:hover,
.topbar-actions a.toolbar-chip.toolbar-primary:hover{
  filter:brightness(1.03);
}
.toolbar-date-range-toggle,
#date-range-toggle,
#add-menu-toggle,
#global-search-open,
#theme-toggle{
  position:relative;
}

.toolbar-dropdown{
  position:relative;
}
.toolbar-dropdown-menu,
#date-range-panel,
#add-menu-panel{
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  min-width:220px;
  padding:8px;
  display:grid;
  gap:6px;
  z-index:140;
  border-radius:18px;
  border:1px solid var(--ui-dropdown-border) !important;
  background:var(--ui-dropdown-surface) !important;
  color:var(--ui-dropdown-text) !important;
  box-shadow:var(--ui-dropdown-shadow) !important;
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}
.toolbar-dropdown-menu[hidden],
#date-range-panel[hidden],
#add-menu-panel[hidden]{
  display:none !important;
}
.toolbar-dropdown-menu button,
.toolbar-dropdown-menu a,
#date-range-panel button,
#add-menu-panel a{
  display:flex;
  align-items:center;
  width:100%;
  min-height:44px;
  padding:11px 14px;
  border-radius:14px;
  border:none;
  background:transparent !important;
  color:var(--ui-dropdown-text) !important;
  opacity:1 !important;
  text-align:left;
  font-weight:600;
  line-height:1.2;
  text-decoration:none;
  box-shadow:none;
}
.toolbar-dropdown-menu button:hover,
.toolbar-dropdown-menu a:hover,
#date-range-panel button:hover,
#add-menu-panel a:hover,
.toolbar-dropdown-menu button:focus-visible,
.toolbar-dropdown-menu a:focus-visible,
#date-range-panel button:focus-visible,
#add-menu-panel a:focus-visible{
  background:var(--ui-dropdown-item-hover) !important;
  color:var(--ui-dropdown-text) !important;
  outline:none;
}
#date-range-panel button[aria-current="true"]{
  background:var(--ui-dropdown-item-hover) !important;
}
html[data-theme="light"] .toolbar-dropdown-menu,
html[data-theme="light"] #date-range-panel,
html[data-theme="light"] #add-menu-panel{
  background:rgba(255,255,255,.94) !important;
}
html[data-theme="dark"] .toolbar-dropdown-menu,
html[data-theme="dark"] #date-range-panel,
html[data-theme="dark"] #add-menu-panel{
  background:rgba(15,22,42,.90) !important;
}
.notification-topbar-btn{
  border-radius:14px !important;
}


/* STAGE 159 REAL CLICKABLE DASHBOARD */
.dashboard-widget-link,
.dashboard-activity-link{
  text-decoration:none;
  color:inherit;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.dashboard-widget-link:hover,
.dashboard-activity-link:hover{
  transform:translateY(-2px);
  box-shadow:0 18px 38px rgba(0,0,0,.18);
  border-color:rgba(99,122,255,.28);
}
.dashboard-widget-link:focus-visible,
.dashboard-activity-link:focus-visible{
  outline:2px solid rgba(99,122,255,.45);
  outline-offset:2px;
}
.dashboard-widget-hint{
  margin-top:14px;
  color:var(--text-muted);
  font-size:12px;
  font-weight:700;
}
.dashboard-widgets-grid--compact{
  grid-template-columns:repeat(4,minmax(0,1fr));
  margin-top:0;
}
@media (max-width: 1240px){
  .dashboard-widgets-grid--compact{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media (max-width: 820px){
  .dashboard-widgets-grid--compact{
    grid-template-columns:1fr;
  }
}


/* Stage 159.2 dashboard drill-down polish */
.dashboard-widget-link,
.dashboard-activity-link{
  text-decoration:none;
  color:inherit;
}
.dashboard-widget-link{
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.dashboard-widget-link:hover,
.dashboard-widget-link:focus-visible,
.dashboard-activity-link:hover,
.dashboard-activity-link:focus-visible,
.dashboard-table-row-link:hover,
.dashboard-table-row-link:focus-visible{
  transform:translateY(-1px);
  box-shadow:0 16px 34px rgba(0,0,0,.18);
  border-color:rgba(92,124,250,.28);
}
.dashboard-widget-hint{
  color:var(--text-muted);
  font-size:12px;
  line-height:1.35;
}
.dashboard-table-row-link{
  display:table-row;
  text-decoration:none;
  color:inherit;
}
.dashboard-table-link{
  color:inherit;
  text-decoration:none;
  font-weight:700;
}
.dashboard-table-row-link td,
.dashboard-table-row-link th{
  background-clip:padding-box;
}
.dashboard-focus-strip{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:14px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
}
.dashboard-focus-strip strong{color:var(--text);}
@media (max-width:820px){
  .dashboard-focus-strip{align-items:flex-start;}
}


.language-switcher{display:flex;align-items:center;gap:8px;justify-content:center;margin:0;height:var(--ui-topbar-control-height);padding:0 4px;border-radius:999px;border:1px solid var(--ui-topbar-border);background:rgba(255,255,255,.08);backdrop-filter:blur(22px) saturate(160%);-webkit-backdrop-filter:blur(22px) saturate(160%);box-shadow:var(--ui-topbar-shadow)}
.language-switcher-link{display:inline-flex;align-items:center;justify-content:center;min-width:48px;height:calc(var(--ui-topbar-control-height) - 8px);padding:0 14px;border-radius:999px;border:1px solid transparent;background:transparent;color:var(--ui-topbar-text);text-decoration:none;font-weight:700;font-size:12px;letter-spacing:.04em;transition:background .18s ease,border-color .18s ease,transform .18s ease,box-shadow .18s ease}
.language-switcher-link:hover,.language-switcher-link:focus-visible{background:rgba(255,255,255,.10);border-color:rgba(255,255,255,.10);transform:translateY(-1px)}
.language-switcher-link.active{background:linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,.12));color:#fff;border-color:rgba(255,255,255,.18);box-shadow:inset 0 1px 0 rgba(255,255,255,.22)}
.login-language-wrap{display:flex;justify-content:flex-end;margin-bottom:14px}


.dashboard-activity-card .page-subtitle{max-width:760px;}
.dashboard-activity-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}
.dashboard-activity-item{padding:16px 18px;border-radius:22px;border:1px solid rgba(255,255,255,.10);background:linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);box-shadow:0 18px 40px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.06);}
.dashboard-activity-date{font-size:12px;font-weight:700;letter-spacing:.04em;color:var(--text-muted);margin-bottom:10px;}
.dashboard-activity-title{font-size:15px;font-weight:800;line-height:1.35;margin-bottom:6px;}
.dashboard-activity-desc{font-size:13px;line-height:1.55;color:var(--text-soft);}
.dashboard-activity-item.empty{grid-column:1/-1;text-align:center;padding:24px 18px;}
@media (max-width: 980px){.dashboard-activity-grid{grid-template-columns:1fr;}}


/* Stage 171: plans + deliverables UX repair */
.field select option,
.actions select option,
.bulk-toolbar select option,
select option{
  background-color:var(--surface-2);
  color:var(--text);
}
html[data-theme="light"] .field select option,
html[data-theme="light"] .actions select option,
html[data-theme="light"] .bulk-toolbar select option,
html[data-theme="light"] select option{
  background-color:#ffffff;
  color:#17253b;
}
html[data-theme="dark"] .field select option,
html[data-theme="dark"] .actions select option,
html[data-theme="dark"] .bulk-toolbar select option,
html[data-theme="dark"] select option{
  background-color:#21242e;
  color:#f5f7ff;
}

.toolbar-dropdown-menu,
.dropdown-menu{
  background:var(--ui-dropdown-surface) !important;
  border:1px solid var(--ui-dropdown-border) !important;
}
.toolbar-dropdown-menu a,
.toolbar-dropdown-menu button,
.dropdown-item{
  color:var(--ui-dropdown-text) !important;
}
.toolbar-dropdown-menu a:hover,
.toolbar-dropdown-menu button:hover,
.dropdown-item:hover{
  background:var(--ui-dropdown-item-hover) !important;
}

.deliverables-table td:last-child .actions{
  min-width:220px;
}
.plan-overview-month-block{
  display:grid;
  gap:8px;
}
.plan-overview-deliverable-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface-2);
}
@media (max-width: 980px){
  .deliverables-table td:last-child .actions{
    min-width:unset;
  }
  .plan-overview-deliverable-row{
    flex-direction:column;
    align-items:flex-start;
  }
}

/* Windows dark theme select/option hardening */
html[data-theme="dark"] select,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .actions select,
html[data-theme="dark"] .bulk-toolbar select,
html[data-theme="dark"] select[name="bulk_status"]{
  background-color:#21242e !important;
  color:#f4f7ff !important;
  border-color:rgba(255,255,255,.10) !important;
  color-scheme:dark;
}

html[data-theme="dark"] select option,
html[data-theme="dark"] .field select option,
html[data-theme="dark"] .actions select option,
html[data-theme="dark"] .bulk-toolbar select option,
html[data-theme="dark"] select[name="bulk_status"] option,
html[data-theme="dark"] select optgroup{
  background:#21242e !important;
  background-color:#21242e !important;
  color:#f4f7ff !important;
}

html[data-theme="dark"] select option:checked,
html[data-theme="dark"] select option:hover,
html[data-theme="dark"] select option:focus{
  background:#2b3040 !important;
  background-color:#2b3040 !important;
  color:#ffffff !important;
}

/* STAGE_VISUAL_TABLE_NOTIFICATIONS_FIX_20260524 */
.table-wrap.deliverables-table-wrap{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.deliverables-table{
  min-width:980px;
  table-layout:auto;
}
.deliverables-table th,
.deliverables-table td{
  overflow-wrap:normal;
  word-break:normal;
  white-space:normal;
  vertical-align:middle;
}
.deliverables-table .check-col{width:44px;min-width:44px;}
.deliverables-table .actions-col{width:290px;min-width:290px;}
.deliverables-table .actions-cell{width:290px;min-width:290px;}
.deliverables-table .date-cell{white-space:nowrap;min-width:104px;font-variant-numeric:tabular-nums;}
.deliverables-table .row-actions{
  display:grid;
  grid-template-columns:repeat(2, minmax(108px, 1fr));
  gap:10px;
  align-items:center;
}
.deliverables-table .row-actions .btn,
.deliverables-table .row-actions a.btn{
  min-height:42px;
  padding:10px 14px;
  white-space:nowrap;
}
.deliverables-table .row-actions .btn-danger{
  grid-column:1 / -1;
  justify-self:start;
  min-width:132px;
}
.sortable-th{
  color:inherit;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:4px;
  white-space:nowrap;
}
.sortable-th:hover,
.sortable-th:focus-visible{
  color:var(--text);
  text-decoration:underline;
}
.status-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.22);
  background:rgba(148,163,184,.10);
  white-space:nowrap;
  font-size:12px;
  font-weight:800;
  line-height:1.1;
}
.notification-card .notification-card-due{
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
@media (max-width: 760px){
  .deliverables-table{min-width:900px;}
  .deliverables-table .actions-col,
  .deliverables-table .actions-cell{min-width:250px;width:250px;}
  .deliverables-table .row-actions{grid-template-columns:1fr;}
  .deliverables-table .row-actions .btn-danger{grid-column:auto;width:100%;}
}


/* Client linked work hub */
.client-work-hub{margin-top:18px;margin-bottom:18px;}
.client-hub-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;flex-wrap:wrap;}
.client-hub-head h3,.section-head-row h3{margin:0 0 6px 0;}
.client-hub-actions{justify-content:flex-end;max-width:760px;}
.client-linked-grid{align-items:start;}
.section-head-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;flex-wrap:wrap;}
.row-actions{gap:8px;flex-wrap:wrap;}
@media (max-width: 900px){.client-hub-head{display:block}.client-hub-actions{justify-content:flex-start;margin-top:14px}.client-linked-grid{grid-template-columns:1fr}}


/* Stage CRM relational navigation + status visual fix */
.status-badge,
.badge,
.status-pill{
  white-space:nowrap !important;
  word-break:keep-all !important;
  overflow-wrap:normal !important;
  min-width:max-content;
  line-height:1;
}
.status-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:32px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.22);
  font-size:12px;
  font-weight:900;
  letter-spacing:.01em;
}
.status-badge--active{background:rgba(34,197,94,.16);color:#55d989;border-color:rgba(34,197,94,.24);}
.status-badge--draft,.status-badge--pending{background:rgba(245,158,11,.18);color:#ffd166;border-color:rgba(245,158,11,.28);}
.status-badge--expired,.status-badge--cancelled{background:rgba(244,63,94,.18);color:#ff7d8a;border-color:rgba(244,63,94,.28);}
.status-badge--completed{background:rgba(59,130,246,.16);color:#8fb8ff;border-color:rgba(59,130,246,.26);}
.status-badge--paused,.status-badge--suspended,.status-badge--delayed{background:rgba(148,163,184,.16);color:#cbd5e1;border-color:rgba(148,163,184,.25);}
.table-wrap table th:nth-last-child(2),
.table-wrap table td:nth-last-child(2){min-width:118px;}
.clients-table .actions,
.contracts-table .actions,
.plans-table .actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
.clients-table .actions .btn,
.contracts-table .actions .btn,
.plans-table .actions .btn{white-space:nowrap;}
.client-work-hub,.contract-work-hub{
  border:1px solid rgba(148,163,184,.18);
  background:linear-gradient(135deg,rgba(96,165,250,.08),rgba(148,163,184,.04));
}
.quick-link-note{font-size:12px;color:var(--muted);margin-top:6px;}
@media (max-width: 900px){
  .clients-table,.contracts-table,.plans-table{min-width:980px;}
}


/* CRM responsive density + notification client emphasis - 2026-05-24 */
html{font-size:clamp(14px, 0.72vw + 5.2px, 16px);}
body{overflow-x:hidden;}
.app-shell{min-width:0;}
.content{min-width:0; width:100%;}
.card{max-width:100%;}

.notification-client-name,
.notification-client-line .notification-client-name,
.notif-card-meta .notification-client-name{
  color:#ef4444 !important;
  font-weight:900;
}
.notification-client-line{
  color:var(--text-soft);
}

.table-wrap{
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overflow-y:visible;
  -webkit-overflow-scrolling:touch;
  scrollbar-gutter:stable;
}
.table-wrap table{
  width:100%;
  min-width:1080px;
  table-layout:auto;
}
.clients-table,
.contracts-table,
.plans-table,
.deliverables-table{
  min-width:1120px !important;
}
.clients-table th,
.clients-table td,
.contracts-table th,
.contracts-table td,
.plans-table th,
.plans-table td,
.deliverables-table th,
.deliverables-table td{
  white-space:nowrap;
  vertical-align:middle;
}
.clients-table td:first-child,
.clients-table td:nth-child(2),
.contracts-table td:first-child,
.contracts-table td:nth-child(2),
.plans-table td:first-child,
.plans-table td:nth-child(2),
.deliverables-table td:first-child,
.deliverables-table td:nth-child(2){
  white-space:normal;
  min-width:150px;
}
.clients-table td:last-child,
.contracts-table td:last-child,
.plans-table td:last-child,
.deliverables-table td:last-child{
  min-width:300px;
}
.status-badge,
.badge,
.status-pill,
.activity-badge{
  white-space:nowrap !important;
  word-break:keep-all !important;
  overflow-wrap:normal !important;
  min-width:fit-content;
  flex:0 0 auto;
}
.actions,
.row-actions,
.filter-actions,
.client-hub-actions{
  min-width:0;
}
.actions .btn,
.actions a.btn,
.row-actions .btn,
.row-actions a.btn{
  flex:0 0 auto;
  white-space:nowrap;
}

@media (max-width: 1500px){
  .app-shell{grid-template-columns:228px minmax(0,1fr);}
  .content{padding:22px 18px 24px;}
  .sidebar{padding:18px 12px 14px;}
  .nav{gap:6px;}
  .nav a{padding:11px 12px;font-size:14px;}
  .page-title{font-size:clamp(25px, 2vw, 30px);}
  .card{padding:18px;}
  th,td{padding:12px 10px;}
  .btn,button,input[type="submit"],input[type="button"]{min-height:40px;padding:9px 12px;border-radius:12px;font-size:14px;}
  .status-badge{min-height:28px;padding:7px 10px;font-size:11px;}
  .toolbar-icon,.toolbar-chip,.toolbar-primary{height:40px;}
  .toolbar-chip{min-width:180px;}
}

@media (max-width: 1366px){
  html{font-size:14px;}
  .app-shell{grid-template-columns:212px minmax(0,1fr);}
  .content{padding:18px 14px 22px;}
  .brand-text{font-size:14px;}
  .nav a{padding:10px 10px;gap:9px;}
  .topbar{gap:12px;margin-bottom:18px;}
  .topbar-actions{gap:8px;}
  .grid,.chart-grid{gap:14px;}
  .card{padding:16px;}
  .filter-bar{gap:12px;}
  .clients-table,
  .contracts-table,
  .plans-table,
  .deliverables-table{min-width:1040px !important;}
  .clients-table td:last-child,
  .contracts-table td:last-child,
  .plans-table td:last-child,
  .deliverables-table td:last-child{min-width:270px;}
}

@media (min-width: 981px) and (max-width: 1280px){
  .app-shell{grid-template-columns:200px minmax(0,1fr);}
  .sidebar{padding-left:10px;padding-right:10px;}
  .nav a{font-size:13px;}
  .nav-ico{min-width:16px;width:16px;}
  .content{padding:16px 12px 22px;}
  th,td{padding:10px 9px;}
  .btn,button,input[type="submit"],input[type="button"]{font-size:13px;min-height:38px;padding:8px 10px;}
  .status-badge{font-size:11px;min-height:26px;padding:6px 9px;}
}

@media (max-width: 980px){
  .table-wrap table,
  .clients-table,
  .contracts-table,
  .plans-table,
  .deliverables-table{min-width:920px !important;}
}

/* STAGE 2026-05-24 - HARD TABLE RESPONSIVE FIX
   Prevent laptop/Windows browser text from being squeezed character-by-character.
   Tables keep readable columns and scroll horizontally inside the card instead of pushing data downward. */
.table-wrap{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:visible !important;
  -webkit-overflow-scrolling:touch !important;
  overscroll-behavior-x:contain;
}
.table-wrap > table,
.table-wrap table,
table.clients-table,
table.contracts-table,
table.plans-table,
table.deliverables-table{
  width:max-content !important;
  min-width:100% !important;
  table-layout:auto !important;
  border-collapse:separate;
  border-spacing:0;
}
.table-wrap table th,
.table-wrap table td{
  word-break:normal !important;
  overflow-wrap:normal !important;
  hyphens:none !important;
  vertical-align:middle !important;
}
.table-wrap table th{
  white-space:nowrap !important;
  min-width:max-content;
}
.clients-table th,
.clients-table td,
.contracts-table th,
.contracts-table td,
.plans-table th,
.plans-table td,
.deliverables-table th,
.deliverables-table td{
  white-space:nowrap !important;
  line-height:1.25 !important;
}
/* Allow only meaningful text columns to wrap naturally, never letter-by-letter. */
.clients-table td:nth-child(1),
.clients-table td:nth-child(2),
.contracts-table td:nth-child(1),
.contracts-table td:nth-child(2),
.plans-table td:nth-child(1),
.plans-table td:nth-child(2),
.plans-table td:nth-child(3),
.deliverables-table td:nth-child(1),
.deliverables-table td:nth-child(2),
.deliverables-table td:nth-child(3){
  white-space:normal !important;
  word-break:normal !important;
  overflow-wrap:break-word !important;
  min-width:160px;
  max-width:280px;
}
/* Numeric/date/status columns must never split: fixes 0.00 % and activ/draft wrapping. */
.plans-table th:nth-child(5),
.plans-table td:nth-child(5),
.plans-table th:nth-child(6),
.plans-table td:nth-child(6),
.plans-table th:nth-child(7),
.plans-table td:nth-child(7),
.plans-table th:nth-child(8),
.plans-table td:nth-child(8),
.contracts-table th:nth-child(4),
.contracts-table td:nth-child(4),
.contracts-table th:nth-child(5),
.contracts-table td:nth-child(5),
.contracts-table th:nth-child(6),
.contracts-table td:nth-child(6),
.contracts-table th:nth-child(7),
.contracts-table td:nth-child(7),
.deliverables-table .date-cell,
.deliverables-table th:nth-last-child(2),
.deliverables-table td:nth-last-child(2){
  white-space:nowrap !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  min-width:96px;
  font-variant-numeric:tabular-nums;
}
.plans-table th:nth-child(7),
.plans-table td:nth-child(7){min-width:108px;text-align:center;}
.plans-table th:nth-child(8),
.plans-table td:nth-child(8){min-width:124px;text-align:center;}
.status-badge,
.badge,
.status-pill,
.activity-badge,
[class*="badge-"]{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  max-width:none !important;
  min-width:max-content !important;
  white-space:nowrap !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  hyphens:none !important;
  line-height:1 !important;
}
.actions,
.row-actions{
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  flex-wrap:nowrap !important;
  white-space:nowrap !important;
}
.actions .btn,
.row-actions .btn,
.actions a.btn,
.row-actions a.btn{
  flex:0 0 auto !important;
  white-space:nowrap !important;
}
.clients-table td:last-child,
.contracts-table td:last-child,
.plans-table td:last-child,
.deliverables-table td:last-child{
  min-width:max-content !important;
}
@media (max-width:1500px){
  .clients-table td:nth-child(1),
  .clients-table td:nth-child(2),
  .contracts-table td:nth-child(1),
  .contracts-table td:nth-child(2),
  .plans-table td:nth-child(1),
  .plans-table td:nth-child(2),
  .plans-table td:nth-child(3),
  .deliverables-table td:nth-child(1),
  .deliverables-table td:nth-child(2),
  .deliverables-table td:nth-child(3){max-width:240px;}
  .table-wrap{border-radius:16px;}
}
@media (max-width:1280px){
  .content{overflow-x:hidden !important;}
  .card{overflow:hidden;}
  .table-wrap{margin-left:0;margin-right:0;}
  th,td{padding:10px 9px !important;}
}


/* Hardfix: client name in notifications must be red in every notification surface */
#notifSidebar span.notification-client-name,
.notif-sidebar span.notification-client-name,
.notif-card-meta span.notification-client-name,
.notification-client-line span.notification-client-name,
.notification-card span.notification-client-name,
.notifications-cards-grid span.notification-client-name,
td span.notification-client-name,
span.notification-client-name{
  color:#ff2f45 !important;
  -webkit-text-fill-color:#ff2f45 !important;
  font-weight:900 !important;
  opacity:1 !important;
  filter:none !important;
  mix-blend-mode:normal !important;
}


/* STAGE 2026-05-24 - LAPTOP TABLE SCALE / FIT FIX
   Goal: keep operational tables readable on Windows/laptop resolutions without text falling one letter per line.
   Strategy: tables use a stable 100% layout; long values are clipped with ellipsis; action buttons wrap in a compact grid. */
.card:has(.table-wrap){
  max-width:100% !important;
  overflow:hidden !important;
}
.table-wrap{
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:visible !important;
  scrollbar-gutter:stable;
}
.table-wrap table,
table.clients-table,
table.contracts-table,
table.plans-table,
table.deliverables-table{
  width:100% !important;
  min-width:980px !important;
  max-width:none !important;
  table-layout:fixed !important;
}
.table-wrap th,
.table-wrap td{
  white-space:nowrap !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  hyphens:none !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  line-height:1.28 !important;
}
.table-wrap th a,
.sortable-th{
  white-space:normal !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  line-height:1.2 !important;
}
/* Clients table column budget */
.clients-table th:nth-child(1), .clients-table td:nth-child(1){width:12% !important; min-width:110px !important; max-width:none !important; white-space:normal !important;}
.clients-table th:nth-child(2), .clients-table td:nth-child(2){width:11% !important; min-width:100px !important; max-width:none !important; white-space:normal !important;}
.clients-table th:nth-child(3), .clients-table td:nth-child(3){width:17% !important; min-width:170px !important;}
.clients-table th:nth-child(4), .clients-table td:nth-child(4){width:10% !important; min-width:105px !important;}
.clients-table th:nth-child(5), .clients-table td:nth-child(5){width:7% !important; min-width:78px !important;}
.clients-table th:nth-child(6), .clients-table td:nth-child(6){width:8% !important; min-width:92px !important;}
.clients-table th:nth-child(7), .clients-table td:nth-child(7){width:6% !important; min-width:70px !important; text-align:center !important;}
.clients-table th:nth-child(8), .clients-table td:nth-child(8){width:29% !important; min-width:330px !important; overflow:visible !important; text-overflow:clip !important;}
/* Contracts / plans / deliverables get sane action column behavior too. */
.contracts-table td:last-child,
.plans-table td:last-child,
.deliverables-table td:last-child,
.clients-table td:last-child{
  overflow:visible !important;
  text-overflow:clip !important;
}
.clients-table .actions,
.contracts-table .actions,
.plans-table .actions,
.deliverables-table .actions,
.row-actions{
  display:grid !important;
  grid-template-columns:repeat(3, minmax(0, 1fr)) !important;
  align-items:stretch !important;
  gap:8px !important;
  white-space:normal !important;
  min-width:0 !important;
  max-width:100% !important;
}
.clients-table .actions .btn,
.contracts-table .actions .btn,
.plans-table .actions .btn,
.deliverables-table .actions .btn,
.row-actions .btn{
  min-width:0 !important;
  width:100% !important;
  max-width:100% !important;
  height:38px !important;
  min-height:38px !important;
  padding:8px 10px !important;
  font-size:14px !important;
  border-radius:12px !important;
  display:inline-flex !important;
  justify-content:center !important;
  align-items:center !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}
.clients-table .actions .btn-danger,
.contracts-table .actions .btn-danger,
.plans-table .actions .btn-danger,
.deliverables-table .actions .btn-danger{
  grid-column:auto !important;
}
.status-badge,
.badge,
.status-pill{
  min-width:72px !important;
  max-width:100% !important;
  padding:7px 10px !important;
  white-space:nowrap !important;
}
@media (max-width:1500px){
  .table-wrap table,
  table.clients-table,
  table.contracts-table,
  table.plans-table,
  table.deliverables-table{min-width:1040px !important;}
  .clients-table th:nth-child(8), .clients-table td:nth-child(8){min-width:310px !important;}
  .clients-table .actions,
  .contracts-table .actions,
  .plans-table .actions,
  .deliverables-table .actions,
  .row-actions{grid-template-columns:repeat(3, minmax(86px, 1fr)) !important; gap:7px !important;}
  .clients-table .actions .btn,
  .contracts-table .actions .btn,
  .plans-table .actions .btn,
  .deliverables-table .actions .btn,
  .row-actions .btn{font-size:13px !important; padding:7px 8px !important; height:36px !important; min-height:36px !important;}
}
@media (max-width:1280px){
  .table-wrap table,
  table.clients-table,
  table.contracts-table,
  table.plans-table,
  table.deliverables-table{min-width:1120px !important;}
  .clients-table th:nth-child(8), .clients-table td:nth-child(8){min-width:300px !important;}
  .content{min-width:0 !important;}
  .card{padding:14px !important;}
}
@media (min-width:1501px){
  .clients-table .actions{grid-template-columns:repeat(6, minmax(90px, 1fr)) !important;}
  .clients-table .actions .btn{height:40px !important; min-height:40px !important;}
}

/* STAGE 2026-05-24B - REAL TABLE FIT / SCALING FIX
   Fixes Windows/laptop layout where table action buttons were clipped and cells pushed down.
   Uses predictable column budgets, compact 2-column action grids and controlled text wrapping. */
.table-wrap{
  position:relative !important;
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:visible !important;
  -webkit-overflow-scrolling:touch !important;
  scrollbar-gutter:auto !important;
}
.table-wrap table.clients-table,
.table-wrap table.contracts-table,
.table-wrap table.plans-table,
.table-wrap table.deliverables-table{
  width:100% !important;
  max-width:100% !important;
  table-layout:fixed !important;
  border-collapse:separate !important;
  border-spacing:0 !important;
}
.table-wrap table.clients-table{min-width:0 !important;}
.table-wrap table.contracts-table{min-width:0 !important;}
.table-wrap table.plans-table{min-width:0 !important;}
.table-wrap table.deliverables-table{min-width:0 !important;}
.clients-table th,.clients-table td,
.contracts-table th,.contracts-table td,
.plans-table th,.plans-table td,
.deliverables-table th,.deliverables-table td{
  vertical-align:middle !important;
  white-space:nowrap !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  hyphens:none !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  padding:14px 14px !important;
  line-height:1.25 !important;
}
.clients-table th a,.contracts-table th a,.plans-table th a,.deliverables-table th a{
  white-space:nowrap !important;
  word-break:normal !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  display:inline-block !important;
  max-width:100% !important;
}
/* Clients: 100% total */
.clients-table th:nth-child(1),.clients-table td:nth-child(1){width:12% !important;}
.clients-table th:nth-child(2),.clients-table td:nth-child(2){width:11% !important;}
.clients-table th:nth-child(3),.clients-table td:nth-child(3){width:18% !important;}
.clients-table th:nth-child(4),.clients-table td:nth-child(4){width:11% !important;}
.clients-table th:nth-child(5),.clients-table td:nth-child(5){width:7% !important;}
.clients-table th:nth-child(6),.clients-table td:nth-child(6){width:9% !important;}
.clients-table th:nth-child(7),.clients-table td:nth-child(7){width:6% !important; text-align:center !important;}
.clients-table th:nth-child(8),.clients-table td:nth-child(8){width:26% !important; min-width:0 !important; overflow:visible !important; text-overflow:clip !important;}
/* Contracts: 100% total */
.contracts-table th:nth-child(1),.contracts-table td:nth-child(1){width:12% !important;}
.contracts-table th:nth-child(2),.contracts-table td:nth-child(2){width:9% !important;}
.contracts-table th:nth-child(3),.contracts-table td:nth-child(3){width:20% !important; white-space:normal !important; display:table-cell !important;}
.contracts-table th:nth-child(4),.contracts-table td:nth-child(4){width:10% !important;}
.contracts-table th:nth-child(5),.contracts-table td:nth-child(5){width:10% !important;}
.contracts-table th:nth-child(6),.contracts-table td:nth-child(6){width:10% !important;}
.contracts-table th:nth-child(7),.contracts-table td:nth-child(7){width:8% !important; text-align:center !important;}
.contracts-table th:nth-child(8),.contracts-table td:nth-child(8){width:21% !important; overflow:visible !important; text-overflow:clip !important;}
/* Plans: 100% total */
.plans-table th:nth-child(1),.plans-table td:nth-child(1){width:12% !important;}
.plans-table th:nth-child(2),.plans-table td:nth-child(2){width:7% !important;}
.plans-table th:nth-child(3),.plans-table td:nth-child(3){width:18% !important; white-space:normal !important; display:table-cell !important;}
.plans-table th:nth-child(4),.plans-table td:nth-child(4){width:9% !important;}
.plans-table th:nth-child(5),.plans-table td:nth-child(5){width:8% !important;}
.plans-table th:nth-child(6),.plans-table td:nth-child(6){width:10% !important;}
.plans-table th:nth-child(7),.plans-table td:nth-child(7){width:8% !important; text-align:center !important;}
.plans-table th:nth-child(8),.plans-table td:nth-child(8){width:8% !important; text-align:center !important;}
.plans-table th:nth-child(9),.plans-table td:nth-child(9){width:20% !important; overflow:visible !important; text-overflow:clip !important;}
/* Deliverables */
.deliverables-table th:nth-child(1),.deliverables-table td:nth-child(1){width:42px !important; text-align:center !important;}
.deliverables-table th:last-child,.deliverables-table td:last-child{width:210px !important; overflow:visible !important; text-overflow:clip !important;}
.clients-table .actions,
.contracts-table .actions,
.plans-table .actions,
.deliverables-table .actions,
.table-wrap .row-actions{
  display:grid !important;
  grid-template-columns:repeat(2, minmax(74px, 1fr)) !important;
  gap:8px !important;
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  align-items:stretch !important;
  justify-content:stretch !important;
  white-space:normal !important;
}
.clients-table .actions .btn,
.contracts-table .actions .btn,
.plans-table .actions .btn,
.deliverables-table .actions .btn,
.table-wrap .row-actions .btn,
.clients-table .actions a.btn,
.contracts-table .actions a.btn,
.plans-table .actions a.btn,
.deliverables-table .actions a.btn,
.table-wrap .row-actions a.btn{
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  height:36px !important;
  min-height:36px !important;
  padding:7px 8px !important;
  border-radius:12px !important;
  font-size:13.5px !important;
  line-height:1 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}
.status-badge,.badge,.status-pill{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  min-width:64px !important;
  max-width:100% !important;
  padding:7px 10px !important;
  white-space:nowrap !important;
  word-break:normal !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  line-height:1 !important;
}
@media (max-width:1600px){
  .clients-table th,.clients-table td,
  .contracts-table th,.contracts-table td,
  .plans-table th,.plans-table td,
  .deliverables-table th,.deliverables-table td{padding:12px 10px !important; font-size:14px !important;}
  .clients-table th:nth-child(8),.clients-table td:nth-child(8){width:27% !important;}
  .contracts-table th:nth-child(8),.contracts-table td:nth-child(8){width:22% !important;}
  .plans-table th:nth-child(9),.plans-table td:nth-child(9){width:22% !important;}
}
@media (max-width:1366px){
  .table-wrap table.clients-table{min-width:1180px !important;}
  .table-wrap table.contracts-table{min-width:1180px !important;}
  .table-wrap table.plans-table{min-width:1260px !important;}
  .table-wrap table.deliverables-table{min-width:1160px !important;}
  .card:has(.table-wrap){padding:12px !important;}
}

/* STAGE 2026-05-24C - FINAL TABLE SCALING / FIT OVERRIDE
   Replace percentage-based table squeezing with fixed readable column budgets.
   This prevents Windows/laptop browsers from clipping action buttons or pushing data downward. */
.card:has(.table-wrap){
  overflow:hidden !important;
}
.table-wrap{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  -webkit-overflow-scrolling:touch !important;
  padding-bottom:8px !important;
}
.table-wrap > table.clients-table,
.table-wrap > table.contracts-table,
.table-wrap > table.plans-table,
.table-wrap > table.deliverables-table{
  width:max-content !important;
  max-width:none !important;
  table-layout:fixed !important;
  border-collapse:separate !important;
  border-spacing:0 !important;
}
.table-wrap th,
.table-wrap td{
  box-sizing:border-box !important;
  vertical-align:middle !important;
  padding:12px 12px !important;
  white-space:nowrap !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  hyphens:none !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  line-height:1.25 !important;
}
.table-wrap th a{display:inline-block !important;max-width:100% !important;overflow:hidden !important;text-overflow:ellipsis !important;white-space:nowrap !important;}

/* Clients table: total 1430px, fits normal laptop content and scrolls on smaller screens. */
.table-wrap > table.clients-table{min-width:1430px !important;}
.clients-table th:nth-child(1),.clients-table td:nth-child(1){width:180px !important;min-width:180px !important;}
.clients-table th:nth-child(2),.clients-table td:nth-child(2){width:170px !important;min-width:170px !important;}
.clients-table th:nth-child(3),.clients-table td:nth-child(3){width:260px !important;min-width:260px !important;}
.clients-table th:nth-child(4),.clients-table td:nth-child(4){width:150px !important;min-width:150px !important;}
.clients-table th:nth-child(5),.clients-table td:nth-child(5){width:110px !important;min-width:110px !important;}
.clients-table th:nth-child(6),.clients-table td:nth-child(6){width:130px !important;min-width:130px !important;}
.clients-table th:nth-child(7),.clients-table td:nth-child(7){width:90px !important;min-width:90px !important;text-align:center !important;}
.clients-table th:nth-child(8),.clients-table td:nth-child(8){width:340px !important;min-width:340px !important;overflow:visible !important;text-overflow:clip !important;}

/* Contracts table: total 1510px. */
.table-wrap > table.contracts-table{min-width:1510px !important;}
.contracts-table th:nth-child(1),.contracts-table td:nth-child(1){width:170px !important;min-width:170px !important;}
.contracts-table th:nth-child(2),.contracts-table td:nth-child(2){width:95px !important;min-width:95px !important;}
.contracts-table th:nth-child(3),.contracts-table td:nth-child(3){width:260px !important;min-width:260px !important;white-space:normal !important;overflow-wrap:break-word !important;}
.contracts-table th:nth-child(4),.contracts-table td:nth-child(4){width:130px !important;min-width:130px !important;}
.contracts-table th:nth-child(5),.contracts-table td:nth-child(5){width:130px !important;min-width:130px !important;}
.contracts-table th:nth-child(6),.contracts-table td:nth-child(6){width:150px !important;min-width:150px !important;}
.contracts-table th:nth-child(7),.contracts-table td:nth-child(7){width:130px !important;min-width:130px !important;text-align:center !important;}
.contracts-table th:nth-child(8),.contracts-table td:nth-child(8){width:445px !important;min-width:445px !important;overflow:visible !important;text-overflow:clip !important;}

/* Plans table: total 1530px. */
.table-wrap > table.plans-table{min-width:1530px !important;}
.plans-table th:nth-child(1),.plans-table td:nth-child(1){width:170px !important;min-width:170px !important;}
.plans-table th:nth-child(2),.plans-table td:nth-child(2){width:95px !important;min-width:95px !important;}
.plans-table th:nth-child(3),.plans-table td:nth-child(3){width:260px !important;min-width:260px !important;white-space:normal !important;overflow-wrap:break-word !important;}
.plans-table th:nth-child(4),.plans-table td:nth-child(4){width:130px !important;min-width:130px !important;}
.plans-table th:nth-child(5),.plans-table td:nth-child(5){width:125px !important;min-width:125px !important;}
.plans-table th:nth-child(6),.plans-table td:nth-child(6){width:150px !important;min-width:150px !important;}
.plans-table th:nth-child(7),.plans-table td:nth-child(7){width:120px !important;min-width:120px !important;text-align:center !important;}
.plans-table th:nth-child(8),.plans-table td:nth-child(8){width:120px !important;min-width:120px !important;text-align:center !important;}
.plans-table th:nth-child(9),.plans-table td:nth-child(9){width:360px !important;min-width:360px !important;overflow:visible !important;text-overflow:clip !important;}

/* Deliverables table: total 1540px. */
.table-wrap > table.deliverables-table{min-width:1540px !important;}
.deliverables-table th:nth-child(1),.deliverables-table td:nth-child(1){width:54px !important;min-width:54px !important;text-align:center !important;}
.deliverables-table th:nth-child(2),.deliverables-table td:nth-child(2){width:170px !important;min-width:170px !important;}
.deliverables-table th:nth-child(3),.deliverables-table td:nth-child(3){width:130px !important;min-width:130px !important;}
.deliverables-table th:nth-child(4),.deliverables-table td:nth-child(4){width:130px !important;min-width:130px !important;}
.deliverables-table th:nth-child(5),.deliverables-table td:nth-child(5){width:160px !important;min-width:160px !important;}
.deliverables-table th:nth-child(6),.deliverables-table td:nth-child(6){width:330px !important;min-width:330px !important;white-space:normal !important;overflow-wrap:break-word !important;}
.deliverables-table th:nth-child(7),.deliverables-table td:nth-child(7){width:130px !important;min-width:130px !important;text-align:center !important;}
.deliverables-table th:nth-child(8),.deliverables-table td:nth-child(8){width:130px !important;min-width:130px !important;}
.deliverables-table th:nth-child(9),.deliverables-table td:nth-child(9){width:296px !important;min-width:296px !important;overflow:visible !important;text-overflow:clip !important;}

/* Controlled action buttons: no clipping, no half-visible labels. */
.clients-table .actions,
.contracts-table .actions,
.plans-table .actions,
.deliverables-table .actions,
.table-wrap .row-actions{
  display:grid !important;
  grid-template-columns:repeat(3, 1fr) !important;
  gap:8px !important;
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  white-space:normal !important;
  overflow:visible !important;
}
.deliverables-table .actions,
.deliverables-table .row-actions{grid-template-columns:repeat(3, 1fr) !important;}
.clients-table .actions .btn,
.contracts-table .actions .btn,
.plans-table .actions .btn,
.deliverables-table .actions .btn,
.table-wrap .row-actions .btn,
.clients-table .actions a.btn,
.contracts-table .actions a.btn,
.plans-table .actions a.btn,
.deliverables-table .actions a.btn,
.table-wrap .row-actions a.btn{
  box-sizing:border-box !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  height:38px !important;
  min-height:38px !important;
  padding:7px 9px !important;
  border-radius:12px !important;
  font-size:13px !important;
  line-height:1 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
.status-badge,.badge,.status-pill,.activity-badge{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-width:74px !important;
  width:auto !important;
  max-width:100% !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  line-height:1 !important;
}
@media (max-width:1366px){
  .table-wrap{box-shadow:inset -22px 0 22px -24px rgba(255,255,255,.45) !important;}
  .card:has(.table-wrap){padding:12px !important;}
}


/* STAGE 2026-05-24D - INVESTIGATED RESPONSIVE TABLE REBUILD
   Root cause fixed: previous overrides still depended on wide tables + unchanged CSS cache version.
   On laptop widths, CRM lists switch to compact row-cards instead of squeezing/cropping columns. */
@media (max-width: 1700px){
  .card:has(.table-wrap){
    overflow:visible !important;
  }
  .table-wrap{
    overflow-x:visible !important;
    overflow-y:visible !important;
    padding-bottom:0 !important;
  }
  .table-wrap > table.clients-table,
  .table-wrap > table.contracts-table,
  .table-wrap > table.plans-table,
  .table-wrap > table.deliverables-table{
    display:block !important;
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    table-layout:auto !important;
    border-collapse:separate !important;
    border-spacing:0 !important;
  }
  .clients-table thead,
  .contracts-table thead,
  .plans-table thead,
  .deliverables-table thead{
    display:none !important;
  }
  .clients-table tbody,
  .contracts-table tbody,
  .plans-table tbody,
  .deliverables-table tbody{
    display:grid !important;
    gap:14px !important;
    width:100% !important;
  }
  .clients-table tr,
  .contracts-table tr,
  .plans-table tr,
  .deliverables-table tr{
    display:grid !important;
    grid-template-columns:repeat(4, minmax(0, 1fr)) !important;
    gap:12px !important;
    width:100% !important;
    padding:16px !important;
    border:1px solid var(--line) !important;
    border-radius:18px !important;
    background:linear-gradient(180deg,var(--surface),var(--surface-2)) !important;
    box-shadow:0 12px 32px rgba(0,0,0,.12) !important;
  }
  .clients-table td,
  .contracts-table td,
  .plans-table td,
  .deliverables-table td{
    display:flex !important;
    flex-direction:column !important;
    justify-content:center !important;
    gap:6px !important;
    width:auto !important;
    min-width:0 !important;
    max-width:100% !important;
    padding:0 !important;
    border:0 !important;
    overflow:visible !important;
    white-space:normal !important;
    word-break:normal !important;
    overflow-wrap:anywhere !important;
    text-overflow:clip !important;
    line-height:1.35 !important;
    font-size:14px !important;
  }
  .clients-table td::before,
  .contracts-table td::before,
  .plans-table td::before,
  .deliverables-table td::before{
    content:"";
    display:block !important;
    font-size:11px !important;
    font-weight:800 !important;
    letter-spacing:.05em !important;
    text-transform:uppercase !important;
    color:var(--text-muted) !important;
    white-space:nowrap !important;
  }

  /* Client labels */
  .clients-table td:nth-child(1)::before{content:"Firma";}
  .clients-table td:nth-child(2)::before{content:"Persoana contact";}
  .clients-table td:nth-child(3)::before{content:"Email";}
  .clients-table td:nth-child(4)::before{content:"Telefon";}
  .clients-table td:nth-child(5)::before{content:"Status";}
  .clients-table td:nth-child(6)::before{content:"Creat la";}
  .clients-table td:nth-child(7)::before{content:"Contracte";}
  .clients-table td:nth-child(8)::before{content:"Actiuni";}

  /* Contract labels */
  .contracts-table td:nth-child(1)::before{content:"Client";}
  .contracts-table td:nth-child(2)::before{content:"Numar";}
  .contracts-table td:nth-child(3)::before{content:"Tip";}
  .contracts-table td:nth-child(4)::before{content:"Creat la";}
  .contracts-table td:nth-child(5)::before{content:"Start";}
  .contracts-table td:nth-child(6)::before{content:"Expirare";}
  .contracts-table td:nth-child(7)::before{content:"Status";}
  .contracts-table td:nth-child(8)::before{content:"Actiuni";}

  /* Plan labels */
  .plans-table td:nth-child(1)::before{content:"Client";}
  .plans-table td:nth-child(2)::before{content:"Contract";}
  .plans-table td:nth-child(3)::before{content:"Tip";}
  .plans-table td:nth-child(4)::before{content:"Creat la";}
  .plans-table td:nth-child(5)::before{content:"Durata";}
  .plans-table td:nth-child(6)::before{content:"Buget";}
  .plans-table td:nth-child(7)::before{content:"Progres";}
  .plans-table td:nth-child(8)::before{content:"Status";}
  .plans-table td:nth-child(9)::before{content:"Actiuni";}

  /* Deliverable labels */
  .deliverables-table td:nth-child(1)::before{content:"Selectie";}
  .deliverables-table td:nth-child(2)::before{content:"Client";}
  .deliverables-table td:nth-child(3)::before{content:"Luna";}
  .deliverables-table td:nth-child(4)::before{content:"Canal";}
  .deliverables-table td:nth-child(5)::before{content:"Tip";}
  .deliverables-table td:nth-child(6)::before{content:"Titlu";}
  .deliverables-table td:nth-child(7)::before{content:"Status";}
  .deliverables-table td:nth-child(8)::before{content:"Deadline";}
  .deliverables-table td:nth-child(9)::before{content:"Actiuni";}

  .clients-table td:last-child,
  .contracts-table td:last-child,
  .plans-table td:last-child,
  .deliverables-table td:last-child{
    grid-column:1 / -1 !important;
    width:100% !important;
    min-width:0 !important;
  }
  .clients-table .actions,
  .contracts-table .actions,
  .plans-table .actions,
  .deliverables-table .actions,
  .table-wrap .row-actions{
    display:grid !important;
    grid-template-columns:repeat(auto-fit, minmax(128px, 1fr)) !important;
    gap:10px !important;
    width:100% !important;
    max-width:100% !important;
    overflow:visible !important;
  }
  .clients-table .actions .btn,
  .contracts-table .actions .btn,
  .plans-table .actions .btn,
  .deliverables-table .actions .btn,
  .table-wrap .row-actions .btn,
  .clients-table .actions a.btn,
  .contracts-table .actions a.btn,
  .plans-table .actions a.btn,
  .deliverables-table .actions a.btn,
  .table-wrap .row-actions a.btn{
    min-width:0 !important;
    width:100% !important;
    max-width:100% !important;
    height:42px !important;
    min-height:42px !important;
    padding:9px 12px !important;
    font-size:14px !important;
    line-height:1 !important;
    overflow:visible !important;
    text-overflow:clip !important;
    white-space:nowrap !important;
  }
  .status-badge,.badge,.status-pill,.activity-badge{
    align-self:flex-start !important;
    min-width:78px !important;
    white-space:nowrap !important;
    overflow:visible !important;
    text-overflow:clip !important;
  }
}

@media (max-width: 1180px){
  .clients-table tr,
  .contracts-table tr,
  .plans-table tr,
  .deliverables-table tr{
    grid-template-columns:repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 680px){
  .clients-table tr,
  .contracts-table tr,
  .plans-table tr,
  .deliverables-table tr{
    grid-template-columns:1fr !important;
    padding:14px !important;
  }
  .clients-table .actions,
  .contracts-table .actions,
  .plans-table .actions,
  .deliverables-table .actions,
  .table-wrap .row-actions{
    grid-template-columns:1fr !important;
  }
}
