:root{
 --bg:#f3f6fb;--surface:#fff;--surface-2:#f8faff;--text:#172033;--muted:#7c879b;--line:#e4e9f1;--line-2:#d6deea;
 --nav:#0d1424;--nav-2:#151f35;--nav-text:#adbad0;--nav-soft:#1b2945;--accent:#3b66f6;--accent-2:#5a7cff;--accent-soft:#edf2ff;
 --success:#16865a;--success-soft:#e7f8ef;--danger:#c83e3e;--danger-soft:#fff0f0;--warning:#a26700;--warning-soft:#fff6df;
 --radius:14px;--shadow:0 10px 30px rgba(26,39,67,.065);--shadow-lg:0 24px 60px rgba(20,31,54,.16)
}
*{box-sizing:border-box}
.page-transition{position:fixed;left:0;top:0;width:100%;height:3px;background:linear-gradient(90deg,transparent 0%,var(--accent) 18%,var(--accent-2) 50%,var(--accent) 82%,transparent 100%);background-size:200% 100%;transform:scaleX(0);transform-origin:left center;opacity:0;z-index:9999;pointer-events:none}
body.is-navigating .page-transition{opacity:1;transform:scaleX(1);animation:cm-page-progress .85s ease-in-out infinite}
@keyframes cm-page-progress{0%{background-position:200% 0;opacity:.7}50%{background-position:0 0;opacity:1}100%{background-position:-200% 0;opacity:.7}}
html{scroll-behavior:smooth}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased}a{text-decoration:none;color:inherit}button,input,select,textarea{font:inherit}
.app-shell{min-height:100vh;display:grid;grid-template-columns:86px 220px minmax(0,1fr)}
.primary-rail{background:var(--nav);color:#fff;display:flex;flex-direction:column;align-items:center;padding:14px 10px;position:sticky;top:0;height:100vh;border-right:1px solid rgba(255,255,255,.05);z-index:50}
.rail-brand{display:flex;flex-direction:column;align-items:center;gap:8px;padding:2px 0 14px;width:100%;border-bottom:1px solid rgba(255,255,255,.06)}
.brand-mark{width:40px;height:40px;border-radius:12px;background:linear-gradient(135deg,#5b7cff,#3558e8);display:grid;place-items:center;font-weight:900;color:#fff;box-shadow:0 10px 22px rgba(55,88,232,.26);font-size:18px}.rail-brand-name{font-size:9px;font-weight:750;line-height:1.1;text-align:center;color:#f6f8fd}
.rail-nav{display:grid;gap:7px;width:100%;padding-top:15px}.rail-item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-height:67px;padding:8px 4px;border-radius:13px;color:var(--nav-text);font-size:9px;font-weight:760;text-align:center;transition:.16s ease}.rail-item:hover{background:rgba(255,255,255,.055);color:#fff}.rail-item.active{background:#1b2a48;color:#fff;box-shadow:inset 3px 0 0 var(--accent),0 8px 18px rgba(0,0,0,.12)}.rail-icon{display:grid;place-items:center}.cm-icon{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.rail-user{margin-top:auto;padding-top:15px}.user-avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#24324d;color:#fff;font-size:12px;font-weight:850;border:1px solid rgba(255,255,255,.07)}
.workspace-nav{background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;min-width:0;position:sticky;top:0;height:100vh;z-index:40}.workspace-nav-head{padding:21px 18px 16px;border-bottom:1px solid var(--line);display:grid;gap:5px}.workspace-kicker{font-size:9px;letter-spacing:.14em;text-transform:uppercase;color:#9aa4b5;font-weight:850}.workspace-nav-head strong{font-size:15px;letter-spacing:-.01em}.workspace-menu{display:grid;gap:4px;padding:15px 10px}.workspace-link{display:flex;align-items:center;gap:10px;min-height:40px;padding:9px 10px;border-radius:10px;color:#5f6b80;font-size:12px;font-weight:700;transition:.15s ease}.workspace-link:hover{background:#f4f7fc;color:var(--text)}.workspace-link.active{background:#edf2ff;color:#254ecc;box-shadow:inset 3px 0 0 var(--accent)}.workspace-dot{width:6px;height:6px;border-radius:50%;background:#bbc3d0;flex:0 0 6px}.workspace-link.active .workspace-dot{background:var(--accent);box-shadow:0 0 0 4px rgba(59,102,246,.1)}
.workspace-quick{padding:16px 14px;border-top:1px solid var(--line);display:grid;gap:6px}.workspace-quick>a{display:flex;align-items:center;gap:8px;padding:8px 8px;border-radius:8px;color:#5e6a80;font-size:11px;font-weight:700}.workspace-quick>a:hover{background:#f6f8fc;color:#24324b}.quick-plus{width:19px;height:19px;border-radius:6px;background:#eef2ff;color:#365cf0;display:grid;place-items:center;font-weight:900;font-size:13px}.workspace-user{margin-top:auto;padding:15px 18px;border-top:1px solid var(--line);display:grid;gap:2px}.workspace-user strong{font-size:12px}.workspace-user a{font-size:11px;color:#6f7a8d;margin-top:4px}.tiny{font-size:9px}
.main{min-width:0}.topbar{min-height:72px;display:flex;align-items:center;justify-content:space-between;padding:0 30px;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:30}.topbar-title{display:grid;gap:2px}.eyebrow{font-size:9px;letter-spacing:.14em;text-transform:uppercase;color:#9ba5b5;font-weight:850}.topbar h1{margin:0;font-size:23px;letter-spacing:-.03em;line-height:1.12}.topbar-actions{display:flex;align-items:center;gap:14px}.topbar-date{display:grid;gap:1px;text-align:right;font-size:10px;font-weight:750;color:#5e697c}.topbar-date span{font-size:8px;letter-spacing:.1em;text-transform:uppercase;color:#a5adba}.content{padding:28px 34px 48px;max-width:1550px}.flash{padding:13px 15px;border-radius:11px;margin-bottom:16px;background:var(--accent-soft);border:1px solid #dce4ff;color:#3955a9;font-size:12px}.flash.error{background:var(--danger-soft);border-color:#f0d5d5;color:var(--danger)}.flash.success{background:var(--success-soft);border-color:#d6eedf;color:var(--success)}
.grid{display:grid;gap:18px}.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-6{grid-template-columns:repeat(6,minmax(0,1fr))}.card{background:var(--surface);border:1px solid var(--line);border-radius:15px;box-shadow:var(--shadow);padding:22px}.card:hover{box-shadow:0 14px 32px rgba(26,39,67,.08)}.stat-label{color:var(--muted);font-size:13px;font-weight:650}.stat{font-size:31px;font-weight:850;margin-top:6px;letter-spacing:-.03em}.section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:13px}.section-head h2{margin:0;font-size:17px}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:41px;border:1px solid transparent;border-radius:10px;padding:9px 14px;font-size:12px;font-weight:780;cursor:pointer;transition:.14s ease}.btn:hover{transform:translateY(-1px)}.btn-primary{background:var(--accent);color:#fff;box-shadow:0 7px 17px rgba(59,102,246,.18)}.btn-primary:hover{box-shadow:0 9px 20px rgba(59,102,246,.23)}.btn-secondary{background:#f5f7fa;border-color:#e1e6ee;color:#273246}.btn-secondary:hover{background:#eef2f7}.btn-danger{background:var(--danger-soft);border-color:#f0d5d5;color:var(--danger)}.btn-sm{min-height:32px;padding:6px 10px;font-size:10px}
.table-wrap{overflow:auto}.table{width:100%;border-collapse:separate;border-spacing:0}.table th,.table td{padding:13px 11px;border-bottom:1px solid var(--line);text-align:left;white-space:nowrap;font-size:13px}.table th{font-size:10px;color:#8792a5;text-transform:uppercase;letter-spacing:.07em;font-weight:850}.table tbody tr:hover td{background:#fbfcff}.badge{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;font-size:10px;font-weight:850;background:#eef1f5;color:#576276}.badge.success{background:var(--success-soft);color:var(--success)}.badge.warning{background:var(--warning-soft);color:var(--warning)}.badge.danger{background:var(--danger-soft);color:var(--danger)}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.field{display:grid;gap:7px}.field.full{grid-column:1/-1}.field label{font-size:12px;font-weight:780;color:#354157}.field input,.field textarea,.field select{width:100%;padding:13px 13px;border:1px solid var(--line-2);border-radius:10px;background:#fff;color:var(--text);font-size:13px;outline:none;transition:.14s ease}.field input:focus,.field textarea:focus,.field select:focus,.search:focus{border-color:#9fb1ff;box-shadow:0 0 0 4px rgba(59,102,246,.08)}.field textarea{min-height:112px;resize:vertical;line-height:1.5}.actions{display:flex;gap:8px;justify-content:flex-end;margin-top:18px}.page-row{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}.page-row form.inline{display:flex;gap:8px;align-items:center;padding:5px 6px 5px 12px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 5px 18px rgba(25,39,68,.055)}.page-row form.inline:before{content:'⌕';color:#99a3b3;font-size:15px}.page-row form.inline .search{border:0;box-shadow:none;width:300px;height:32px;padding:0;background:transparent}.page-row form.inline .search:focus{box-shadow:none}.page-row form.inline .btn{min-height:32px;padding:6px 11px;border-radius:8px}.search{width:320px;max-width:44vw;height:40px;padding:0 13px;border:1px solid var(--line-2);border-radius:10px;background:#fff;color:var(--text);font-size:13px;outline:none;box-shadow:0 4px 12px rgba(20,30,60,.03)}.search::placeholder{color:#9ca5b3}.muted{color:var(--muted)}.empty{padding:34px 18px;text-align:center;color:#97a0ae;font-size:11px}.stack{display:grid;gap:9px}.inline{display:flex;gap:8px;align-items:center}.small{font-size:10px}.row-actions{display:flex;gap:6px;justify-content:flex-end}.timeline{display:grid;gap:8px}.timeline-item{border-left:3px solid #dbe4ff;padding:9px 11px;background:#fbfcff;border-radius:0 8px 8px 0}.danger-text{color:var(--danger)}.success-text{color:var(--success)}.kpi-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:10px 0;border-bottom:1px solid var(--line);font-size:11px}.kpi-row:last-child{border-bottom:0}
.settings-tabs{display:flex;gap:4px;flex-wrap:wrap;margin:0 0 18px;padding:4px;background:#ecf0f6;border:1px solid #e0e5ed;border-radius:12px;width:max-content;max-width:100%}.settings-tabs a{padding:10px 13px;border-radius:9px;font-size:11px;font-weight:760;color:#6e7890;white-space:nowrap}.settings-tabs a.active{background:#fff;color:#20293a;box-shadow:0 3px 10px rgba(21,32,53,.08);border:1px solid #e4e8ef}.asset-card{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 0;border-top:1px solid var(--line)}.asset-preview{max-width:180px;max-height:72px;object-fit:contain;border:1px solid var(--line);background:#fff;border-radius:9px;padding:5px}.signature-preview{max-height:55px}.asset-upload{margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}.check-row{display:flex;gap:8px;align-items:center;padding:10px 11px;border:1px solid var(--line);border-radius:10px;background:#fafbfd;font-size:10px;font-weight:650}
.notification{position:relative}.notification-button{position:relative;border:1px solid var(--line);background:#fff;color:#1d2431;border-radius:11px;width:40px;height:40px;cursor:pointer;font-size:16px;box-shadow:0 4px 12px rgba(20,30,60,.05)}.notification-button span{position:absolute;right:-4px;top:-4px;min-width:17px;height:17px;padding:0 4px;border-radius:999px;background:var(--danger);color:#fff;font-size:8px;font-weight:900;display:grid;place-items:center;border:2px solid #fff}.notification-panel{display:none;position:absolute;right:0;top:48px;width:370px;max-height:520px;overflow:auto;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow-lg);z-index:80}.notification-panel.open{display:block}.notification-head{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid var(--line);font-size:11px}.notification-item{display:grid;gap:4px;padding:13px 15px;border-bottom:1px solid var(--line);border-left:4px solid transparent}.notification-item:hover{background:#f9fbff}.notification-item strong{font-size:11px}.notification-item span{font-size:10px;color:var(--muted);line-height:1.4}.notification-item.danger{border-left-color:var(--danger)}.notification-item.warning{border-left-color:#e1a42c}.notification-empty{padding:26px;text-align:center;color:var(--muted);font-size:11px}.notification-list{display:grid;gap:0}.notification-list .notification-item{border:1px solid var(--line);border-left-width:4px;border-radius:9px;margin-bottom:7px}.payment-context{display:grid;gap:3px;background:#f8f9fc;border:1px solid var(--line);border-radius:10px;padding:11px;margin-bottom:10px}.payment-context span{font-size:10px;color:var(--muted)}
.mobile-menu-toggle,.mobile-drawer{display:none}
@media(max-width:1150px){.app-shell{grid-template-columns:78px 190px minmax(0,1fr)}.content{padding:24px 24px 42px}.topbar{padding:0 24px}.grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}.page-row form.inline .search{width:240px}}
@media(max-width:900px){.app-shell{grid-template-columns:72px minmax(0,1fr)}.workspace-nav{display:none}.rail-brand-name{display:none}.rail-item{font-size:8px}.content{padding:22px 20px 38px}}
@media(max-width:720px){
  /* Unified responsive shell — same components, mobile presentation */
  body{background:#f4f0e9}
  .app-shell{display:block;min-height:100vh}
  .primary-rail,.workspace-nav{display:none}

  .mobile-drawer{
    position:fixed;left:0;right:0;top:auto;bottom:0;
    width:100%;max-height:82vh;
    background:#fffaf5;
    display:block;
    transform:translateY(105%);
    transition:transform .22s cubic-bezier(.2,.75,.25,1);
    z-index:90;
    border-radius:24px 24px 0 0;
    box-shadow:0 -18px 50px rgba(20,30,50,.18);
    overflow:auto;
    padding-bottom:calc(18px + env(safe-area-inset-bottom));
  }
  .nav-open .mobile-drawer{transform:translateY(0)}
  body.nav-open:before{
    content:"";position:fixed;inset:0;
    background:rgba(18,25,39,.38);
    z-index:85;
  }
  .mobile-drawer-head{
    position:sticky;top:0;z-index:2;
    display:flex;justify-content:space-between;align-items:center;
    padding:18px 18px 14px;
    background:rgba(255,255,255,.96);
    backdrop-filter:blur(12px);
    border-bottom:1px solid #edf0f3;
  }
  .mobile-drawer-head:before{
    content:"";position:absolute;top:8px;left:50%;
    transform:translateX(-50%);
    width:38px;height:4px;border-radius:4px;background:#d9dde3;
  }
  .mobile-drawer-head strong{display:block;font-size:16px;letter-spacing:-.02em}
  .mobile-drawer-head span{display:block;color:#8992a0;font-size:10px;margin-top:3px}
  .mobile-close{
    border:0;background:#f1f3f5;color:#606b7b;border-radius:50%;
    width:34px;height:34px;font-size:20px;cursor:pointer;
  }
  .mobile-group{padding:13px 14px 3px}
  .mobile-group-label{
    padding:5px 8px;color:#a0a7b1;font-size:9px;
    letter-spacing:.13em;text-transform:uppercase;font-weight:850;
  }
  .mobile-group a{
    display:flex;align-items:center;gap:11px;
    min-height:46px;padding:10px 12px;
    border-radius:12px;color:#566173;font-size:13px;font-weight:720;
  }
  .mobile-group a.active{
    background:#edf2ff;color:#274fca;
    box-shadow:inset 3px 0 0 var(--accent);
  }
  .mobile-group a .cm-icon{width:18px;height:18px}

  .mobile-menu-toggle{display:none}

  .topbar{
    min-height:66px;padding:0 15px;gap:10px;
    background:rgba(255,251,246,.96);
    backdrop-filter:blur(14px);
    border-bottom:1px solid #e9e2d8;
  }
  .topbar:before{
    content:"C";display:grid;place-items:center;
    width:34px;height:34px;flex:0 0 34px;
    border-radius:11px;
    background:linear-gradient(135deg,#5b7cff,#3558e8);
    color:#fff;font-size:15px;font-weight:900;
    box-shadow:0 7px 16px rgba(55,88,232,.2);
  }
  .topbar-title{gap:1px;min-width:0}
  .eyebrow{font-size:8px;letter-spacing:.12em}
  .topbar h1{font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .topbar-actions,.topbar-actions button,.topbar-actions a,.topbar-actions input{font-family:inherit}
  .topbar{justify-content:flex-start}
  .topbar-actions{gap:7px;margin-left:8px;justify-content:flex-start;flex:0 0 auto}
  .topbar-title{flex:0 0 auto}
  .global-search{width:40px!important;height:40px;overflow:hidden;border-radius:12px;padding:0;justify-content:center}
  .global-search input{display:none}
  .global-search-icon{font-size:20px}
  .notification-button,.topbar-avatar{width:40px;height:40px}
  .topbar-date{display:none}
  .notification-panel{position:fixed;left:10px;right:10px;top:62px;width:auto;max-height:calc(100vh - 78px)}

  .content{
    padding:18px 14px calc(92px + env(safe-area-inset-bottom));
    max-width:none;
  }
  .flash{border-radius:14px;padding:13px 14px}
  .card{
    padding:17px;border-radius:18px;
    box-shadow:0 8px 26px rgba(54,49,42,.055);
    border-color:#e8e1d7;
  }
  .grid-4,.grid-3,.grid-2,.form-grid{grid-template-columns:1fr}
  .page-row{flex-direction:column;align-items:stretch;gap:10px}
  .page-row form.inline{width:100%;padding-left:0}
  .page-row form.inline .search{width:100%;max-width:none}
  .page-row>a.btn,.page-row .btn-primary{width:100%}
  .search{max-width:none;width:100%}
  .btn{min-height:44px;border-radius:12px}
  .field input,.field textarea,.field select{font-size:14px;min-height:46px;border-radius:11px}
  .field textarea{min-height:110px}
  .table-wrap{overflow-x:auto;border-radius:13px}
  .table th,.table td{font-size:12px;padding:11px 9px}

  /* Dashboard: keep the same data/components, make the cards mobile-first. */
  .dashboard-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .dashboard-kpis .card{min-height:112px;padding:14px}
  .dashboard-intro{align-items:flex-start;flex-direction:column;gap:12px}
  .dashboard-intro h2{font-size:22px}
  .dashboard-date{display:none}

  .payment-center-head{align-items:stretch;flex-direction:column}
  .payment-center-head h2{font-size:24px}
  .payment-center-head .btn{width:100%}
  .payment-kpis{grid-template-columns:1fr}
  .payment-layout{grid-template-columns:1fr}
  .payment-side{display:block}
  .modern-payment-context{align-items:flex-start;flex-direction:column}
  .payment-context-amount{text-align:left}
  .payment-form-footer{align-items:stretch;flex-direction:column}
  .payment-form-footer .btn{width:100%}
  .payment-filters{width:100%;overflow:auto;flex-wrap:nowrap;padding-bottom:2px}
  .payment-filters .filter-pill{flex:0 0 auto}
  .payment-search-row{align-items:stretch;flex-direction:column}
  .payment-search-row .btn{width:100%}
  .payment-table{min-width:880px}
  .payment-history-item{padding:12px 0}

  .settings-tabs{width:100%;overflow:auto;flex-wrap:nowrap}
  .email-history-filters{align-items:stretch;gap:8px}
  .email-history-filters .search-field,.email-history-filters .vault-filter,.email-history-filters .btn{flex:1 1 100%;min-width:0;width:100%}
  .vault-filter{flex:1;min-width:0}
  .document-row{align-items:flex-start}
  .document-row strong{white-space:normal}
  .document-row .btn{align-self:center}

  /* Floating mobile navigation — inspired by the supplied reference, not a copy. */
  .mobile-bottom-nav{
    position:fixed;left:12px;right:12px;bottom:10px;
    height:70px;z-index:80;
    display:grid;grid-template-columns:repeat(5,minmax(0,1fr));
    align-items:center;
    padding:6px 8px calc(6px + env(safe-area-inset-bottom));
    background:rgba(255,252,247,.98);
    backdrop-filter:blur(18px);
    border:1px solid #e7dfd5;
    border-radius:22px;
    box-shadow:0 16px 38px rgba(45,42,35,.14);
    overflow:visible;
  }
  .mobile-bottom-item{
    position:relative;min-width:0;height:58px;
    display:flex;flex-direction:column;align-items:center;justify-content:flex-end;
    gap:4px;border:0;background:transparent;color:#858276;
    font-family:inherit;font-size:8px;font-weight:800;line-height:1;
    cursor:pointer;border-radius:16px;padding:7px 2px 4px;
    transition:transform .22s ease,color .22s ease;
  }
  .mobile-bottom-item.active,
  .mobile-bottom-item.active-more{color:#1e2d45;background:transparent;font-weight:900}
  .mobile-bottom-icon{
    position:relative;z-index:2;
    width:34px;height:34px;display:grid;place-items:center;
    border-radius:50%;color:#7d7b74;
    transition:transform .28s cubic-bezier(.2,.8,.2,1),background .28s ease,color .2s ease,box-shadow .28s ease;
  }
  .mobile-bottom-icon .cm-icon{width:18px;height:18px;stroke-width:1.8}
  .mobile-bottom-item.active .mobile-bottom-icon,
  .mobile-bottom-item.active-more .mobile-bottom-icon{
    width:44px;height:44px;
    margin-top:-24px;
    background:var(--accent);
    color:#fff;
    box-shadow:0 10px 23px rgba(59,102,246,.30);
    border:5px solid #fffaf5;
    animation:mobileNavSelected .38s cubic-bezier(.2,.8,.2,1) both;
  }
  .mobile-bottom-item.active:before,
  .mobile-bottom-item.active-more:before{
    content:"";
    position:absolute;
    top:-8px;left:50%;
    width:54px;height:32px;
    transform:translateX(-50%);
    border-radius:0 0 28px 28px;
    background:#fffaf5;
    box-shadow:0 -5px 0 #fffaf5;
    z-index:1;
  }
  .mobile-bottom-item.active span:last-child,
  .mobile-bottom-item.active-more span:last-child{position:relative;z-index:3}
  .mobile-bottom-item:active{transform:scale(.96)}
  .mobile-bottom-item.active:active,.mobile-bottom-item.active-more:active{transform:translateY(-1px) scale(.97)}
  .mobile-more-button{font-family:inherit;font-size:8px;line-height:1}
  @keyframes mobileNavSelected{
    0%{transform:translateY(8px) scale(.78);opacity:.35}
    65%{transform:translateY(-3px) scale(1.07);opacity:1}
    100%{transform:translateY(0) scale(1)}
  }

  /* Keep every data-table action group on one horizontal line. The table
     already scrolls horizontally, so actions should never stack vertically. */
  .table-wrap{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}
  .table .row-actions{flex-wrap:nowrap;width:max-content;min-width:max-content;justify-content:flex-start;gap:6px}
  .table .row-actions .btn,.table .row-actions .badge{flex:0 0 auto;white-space:nowrap}
  .table td:last-child{white-space:nowrap}
  .table td:last-child:has(.row-actions){min-width:1px;width:1%}


  /* Mobile header: title left, search centered, alerts/profile right. */
  .topbar{
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    align-items:center;
    justify-content:initial;
  }
  .topbar-title{min-width:0}
  .topbar-actions{
    min-width:0;
    margin-left:0;
    display:grid;
    grid-template-columns:minmax(0,1fr) 40px 40px;
    align-items:center;
    gap:7px;
    justify-content:initial;
  }
  .global-search{
    justify-self:center;
    width:40px!important;
    height:40px;
    margin:0;
  }
  .notification{justify-self:end}
  .topbar-avatar{justify-self:end}

  /* Make inner page search a true single-line control on narrow screens. */
  .page-row form.inline{
    display:flex;
    flex-wrap:nowrap;
    align-items:center;
    gap:7px;
    min-width:0;
    padding:6px 7px 6px 12px;
  }
  .page-row form.inline:before{flex:0 0 auto}
  .page-row form.inline .search{
    flex:1 1 auto;
    min-width:0;
    width:auto;
    max-width:none;
    height:34px;
  }
  .page-row form.inline .btn{
    flex:0 0 auto;
    white-space:nowrap;
  }

  /* Selected bottom-nav item: clearly lifted above the bar. */
  .mobile-bottom-item{
    justify-content:center;
    padding:0 2px;
    overflow:visible;
  }
  .mobile-bottom-item .mobile-bottom-icon{
    flex:0 0 34px;
    margin:0;
    transform:translateY(0);
  }
  .mobile-bottom-item.active .mobile-bottom-icon,
  .mobile-bottom-item.active-more .mobile-bottom-icon{
    flex:0 0 44px;
    width:44px;height:44px;
    margin:0;
    transform:translateY(-17px);
  }
  .mobile-bottom-item.active span:last-child,
  .mobile-bottom-item.active-more span:last-child{
    position:absolute;
    left:50%;
    bottom:7px;
    transform:translateX(-50%);
    white-space:nowrap;
  }
  .mobile-bottom-item.active:before,
  .mobile-bottom-item.active-more:before{
    top:-10px;
    width:58px;
    height:38px;
    border-radius:0 0 30px 30px;
    background:#fffaf5;
    box-shadow:0 -2px 0 #fffaf5;
  }


  /* v12 mobile header/nav refinements */
  .topbar{
    position:relative;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto minmax(76px,auto);
    align-items:center;
  }
  .topbar-title{
    min-width:0;
    justify-self:start;
  }
  .topbar .global-search{
    position:absolute !important;
    left:50% !important;
    top:50% !important;
    transform:translate(-50%,-50%) !important;
    width:142px !important;
    max-width:42vw !important;
    height:40px !important;
    display:flex !important;
    align-items:center !important;
    padding:0 10px !important;
    z-index:3;
  }
  .topbar .global-search input{
    display:block !important;
    width:100% !important;
    min-width:0 !important;
    border:0 !important;
    outline:0 !important;
    background:transparent !important;
    font-size:10px !important;
    padding:0 !important;
  }
  .topbar .topbar-actions{
    grid-column:3;
    justify-self:end;
    display:flex !important;
    align-items:center !important;
    gap:7px !important;
    margin-left:0 !important;
    z-index:4;
  }

  /* Notification dropdown: anchor it to the bell, not to the page/content. */
  .topbar .notification-panel{
    position:absolute !important;
    top:calc(100% + 8px) !important;
    right:8px !important;
    left:auto !important;
    width:min(310px,calc(100vw - 24px)) !important;
    max-width:calc(100vw - 24px) !important;
    max-height:min(62vh,420px) !important;
    margin:0 !important;
    transform:none !important;
    z-index:120 !important;
  }

  /* Selected bottom-nav item: slightly larger than the inactive items. */
  .mobile-bottom-item.active{
    font-size:10px !important;
    font-weight:850 !important;
  }
  .mobile-bottom-item.active .mobile-bottom-icon .cm-icon{
    width:22px !important;
    height:22px !important;
  }
  .mobile-bottom-item.active .mobile-bottom-icon{
    transform:translateY(-1px) scale(1.05);
  }
}

@media(min-width:721px){
  .mobile-bottom-nav{display:none}
}

/* Universal search + dashboard refinements */
.global-search{display:flex;align-items:center;gap:8px;width:min(480px,36vw);height:42px;padding:0 12px;border:1px solid var(--line);background:#fff;border-radius:12px;box-shadow:0 4px 16px rgba(20,30,60,.035)}
.global-search-icon{color:#98a2b2;font-size:17px;line-height:1}.global-search input{border:0;outline:0;background:transparent;width:100%;min-width:0;color:var(--text);font-size:12px}.global-search input::placeholder{color:#9ca6b5}
.search-hero{max-width:860px;margin:6vh auto 0;background:var(--surface);border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow);padding:34px}.search-hero h2{margin:4px 0 8px;font-size:30px;letter-spacing:-.03em}.search-hero p{max-width:620px}.universal-search-form{margin-top:22px;display:flex;align-items:center;gap:10px;padding:7px 8px 7px 14px;background:#f8faff;border:1px solid var(--line-2);border-radius:14px}.universal-search-form>span{color:#8f99a9;font-size:18px}.universal-search-form input{flex:1;min-width:0;border:0;outline:0;background:transparent;font-size:14px}.search-results-head{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:20px}.search-results-head h2{margin:3px 0 0;font-size:28px;letter-spacing:-.03em}.search-group{margin-bottom:18px}.search-result-list{display:grid;gap:8px}.search-result{display:flex;align-items:center;justify-content:space-between;gap:18px;background:#fff;border:1px solid var(--line);border-radius:13px;padding:14px 16px;box-shadow:0 4px 15px rgba(20,30,60,.03);transition:.14s ease}.search-result:hover{border-color:#cbd7fa;background:#fbfcff;transform:translateY(-1px)}.search-result div{display:grid;gap:4px;min-width:0}.search-result strong{font-size:13px}.search-result span{font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis}.search-result em{font-size:10px;font-style:normal;font-weight:800;color:#4968d8;white-space:nowrap}
.kpi-card{position:relative;overflow:hidden}.kpi-card:before{content:'';position:absolute;left:0;top:0;right:0;height:4px}.kpi-card.kpi-blue:before{background:#4e74ff}.kpi-card.kpi-violet:before{background:#8b65e8}.kpi-card.kpi-amber:before{background:#e0a233}.kpi-card.kpi-green:before{background:#35a574}.kpi-note{margin-top:10px;color:#8a94a5;font-size:10px}.kpi-blue{background:linear-gradient(180deg,#fff,#fbfcff)}.kpi-violet{background:linear-gradient(180deg,#fff,#fdfbff)}.kpi-amber{background:linear-gradient(180deg,#fff,#fffdf9)}.kpi-green{background:linear-gradient(180deg,#fff,#fbfffd)}.dashboard-big-number{font-size:34px;font-weight:880;letter-spacing:-.04em;margin:4px 0 2px}.dashboard-card{min-height:170px}.multiline{white-space:normal;line-height:1.55}
@media(max-width:1100px){.global-search{width:330px}.grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){.global-search{width:min(100%,calc(100vw - 110px));height:40px}.topbar-actions{flex:1;min-width:0}.search-hero{margin:2vh auto 0;padding:22px;border-radius:16px}.search-hero h2{font-size:24px}.universal-search-form{flex-wrap:wrap}.universal-search-form input{min-width:70%}.universal-search-form .btn{width:100%}.search-results-head{align-items:start}.search-results-head h2{font-size:22px}.search-result{align-items:flex-start;padding:13px}.search-result em{font-size:9px}.kpi-grid{grid-template-columns:1fr}.dashboard-card{min-height:0}}

/* Brand image safety: keep uploaded logo/profile images inside their UI containers. */
.brand-mark{overflow:hidden;position:relative;flex:0 0 auto}
.brand-mark.has-logo{display:grid;place-items:center}
.brand-mark img{display:block;width:auto;height:auto;max-width:82%;max-height:82%;object-fit:contain}
.user-avatar{overflow:hidden;position:relative}
.user-avatar.has-photo{display:grid;place-items:center}
.user-avatar img{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:cover;border-radius:50%}
.topbar-avatar{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:#24324d;color:#fff;font-size:12px;font-weight:850;border:1px solid rgba(255,255,255,.08);overflow:hidden;flex:0 0 38px}
.topbar-avatar.has-photo img{display:block;width:100%;height:100%;object-fit:cover;border-radius:50%}
.profile-avatar-large{width:88px;height:88px;border-radius:50%;overflow:hidden;display:grid;place-items:center;background:#eef2ff;color:#3156cd;font-size:28px;font-weight:850}
.profile-avatar-large img{display:block;width:100%;height:100%;object-fit:cover;border-radius:50%}
.asset-preview{display:block;width:auto;height:auto;max-width:180px;max-height:72px;object-fit:contain}

/* Payment Center */
.payment-center-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px}.payment-center-head h2{margin:3px 0 4px;font-size:30px;letter-spacing:-.035em}.payment-center-head p{margin:0;max-width:760px;font-size:12px}.payment-kpis{align-items:stretch}.payment-kpi{display:flex;flex-direction:column;gap:5px;position:relative;overflow:hidden}.payment-kpi:before{content:'';position:absolute;inset:0 0 auto 0;height:4px;background:#4e74ff}.payment-kpi strong{font-size:29px;letter-spacing:-.035em;line-height:1.05}.payment-kpi small{font-size:10px;color:#8e98a8}.payment-kpi.kpi-red:before{background:#d95353}.payment-kpi.kpi-green:before{background:#35a574}.payment-kpi.kpi-purple:before{background:#8a67df}.payment-layout{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(300px,.85fr);gap:18px;align-items:start}.payment-main{min-width:0}.payment-side{min-width:0}.payment-form-card{overflow:hidden}.modern-payment-context{display:flex;align-items:center;justify-content:space-between;gap:20px;background:#f8faff;border:1px solid #dde5f6;border-radius:13px;padding:15px 16px;margin-bottom:12px}.modern-payment-context>div{display:grid;gap:4px;min-width:0}.modern-payment-context strong{font-size:17px}.payment-context-amount{text-align:right}.payment-context-amount strong{font-size:22px}.payment-effect{padding:11px 13px;border-left:4px solid var(--accent);border-radius:0 9px 9px 0;background:#eef3ff;color:#53627b;font-size:10px;line-height:1.5;margin-bottom:14px}.payment-form-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:17px;padding-top:14px;border-top:1px solid var(--line)}.payment-filters{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.filter-pill{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:6px 10px;border:1px solid transparent;border-radius:999px;color:#718096;font-size:10px;font-weight:800;background:#f4f6fa}.filter-pill:hover{background:#eef2f9;color:#25304a}.filter-pill.active{background:#edf2ff;border-color:#cfdaff;color:#3156cb}.payment-search-row{display:flex;align-items:center;gap:8px;margin-bottom:14px}.search-field{display:flex;align-items:center;gap:9px;flex:1;min-width:0;background:#fbfcff;border:1px solid var(--line-2);border-radius:11px;padding:0 12px;height:41px}.search-field span{color:#99a2b1;font-size:16px}.search-field input{width:100%;border:0;outline:0;background:transparent;color:var(--text);font-size:12px}.payment-table th,.payment-table td{vertical-align:middle}.payment-table td:nth-child(5),.payment-table td:nth-child(6),.payment-table td:nth-child(7){text-align:right}.payment-history-list{display:grid;gap:2px}.payment-history-item{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:11px 0;border-bottom:1px solid var(--line)}.payment-history-item:last-child{border-bottom:0}.payment-history-item>div{display:grid;gap:2px;min-width:0}.payment-history-item strong{font-size:11px}.payment-history-item span{font-size:10px;color:#5e6a7e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.payment-history-item small{font-size:9px;color:#a0a8b7}.payment-rule-card{background:linear-gradient(180deg,#fff,#fbfcff)}.workflow-mini{display:grid;gap:0}.workflow-mini>div{position:relative;display:grid;grid-template-columns:16px 1fr;column-gap:9px;padding:10px 0 12px}.workflow-mini>div:not(:last-child):after{content:'';position:absolute;left:7px;top:24px;bottom:-2px;width:2px;background:#e7ebf3}.workflow-mini strong{font-size:10px}.workflow-mini span:not(.workflow-dot){grid-column:2;font-size:9px;color:#8993a5;line-height:1.35}.workflow-dot{width:12px;height:12px;border-radius:50%;display:block;margin-top:2px;border:3px solid #fff;box-shadow:0 0 0 1px #dce2ec;z-index:1}.workflow-dot.blue{background:#4e74ff}.workflow-dot.amber{background:#e0a233}.workflow-dot.green{background:#35a574}.workflow-dot.purple{background:#8a67df}.badge.purple{background:#f1eafe;color:#7451b8}
@media(max-width:1080px){.payment-layout{grid-template-columns:1fr}.payment-side{display:grid;grid-template-columns:1fr 1fr;gap:18px}.payment-side>.card{margin-top:0!important}.payment-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){.payment-center-head{align-items:stretch;flex-direction:column}.payment-center-head h2{font-size:24px}.payment-center-head .btn{width:100%}.payment-kpis{grid-template-columns:1fr}.payment-layout{grid-template-columns:1fr}.payment-side{display:block}.modern-payment-context{align-items:flex-start;flex-direction:column}.payment-context-amount{text-align:left}.payment-form-footer{align-items:stretch;flex-direction:column}.payment-form-footer .btn{width:100%}.payment-filters{width:100%;overflow:auto;flex-wrap:nowrap;padding-bottom:2px}.payment-filters .filter-pill{flex:0 0 auto}.payment-search-row{align-items:stretch;flex-direction:column}.payment-search-row .btn{width:100%}.payment-table{min-width:880px}.payment-history-item{padding:12px 0}}

/* Notification action-center refinement */
.notification-item{display:grid;grid-template-columns:auto 1fr;column-gap:8px;row-gap:2px;align-items:start}
.notification-item .notification-kind{grid-column:1/2;font-size:10px;line-height:16px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;opacity:.65}
.notification-item strong,.notification-item>span:not(.notification-kind){grid-column:2/3}
.notification-item strong{margin-top:0}

/* Document Vault */
.vault-filter{min-height:40px;border:1px solid var(--line-2);border-radius:10px;background:#fff;padding:0 11px;color:var(--text);font-size:12px;outline:none}.document-list{display:grid;gap:2px}.document-row{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:11px 0;border-bottom:1px solid var(--line)}.document-row:last-child{border-bottom:0}.document-row>div:first-child{display:grid;grid-template-columns:auto 1fr;column-gap:8px;row-gap:3px;min-width:0}.document-row .badge{grid-row:1/3;align-self:start}.document-row strong{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.document-row .muted{grid-column:2}.document-row .btn{flex:0 0 auto}@media(max-width:720px){.page-row form.inline{flex-wrap:wrap;width:100%;padding:8px}.page-row form.inline .search{width:100%;max-width:none}.vault-filter{flex:1;min-width:0}.page-row>a.btn-primary{width:100%}.document-row{align-items:flex-start}.document-row strong{white-space:normal}.document-row .btn{align-self:center}}


.inline-form{display:inline-flex;align-items:center;margin:0}.row-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:center}.row-actions .badge{white-space:nowrap}

/* Dashboard final workspace */
.dashboard-intro{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:18px}.dashboard-intro h2{margin:3px 0 4px;font-size:26px;letter-spacing:-.035em}.dashboard-intro p{margin:0;color:var(--muted);font-size:12px}.dashboard-date{padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;color:#6e7890;font-size:10px;font-weight:750;white-space:nowrap}.eyebrow{font-size:9px;font-weight:850;letter-spacing:.14em;color:#8e98a8}.dashboard-kpis{grid-template-columns:repeat(6,minmax(0,1fr));gap:14px}.dashboard-kpis .kpi-card{padding:18px 17px;min-width:0}.dashboard-kpis .stat{font-size:27px}.dashboard-kpis .stat-label{font-size:11px}.kpi-card.kpi-cyan:before{background:#3da5c7}.kpi-card.kpi-rose:before{background:#d67a98}.kpi-cyan{background:linear-gradient(180deg,#fff,#f8fdff)}.kpi-rose{background:linear-gradient(180deg,#fff,#fff9fb)}.dashboard-main-grid{grid-template-columns:minmax(0,1.5fr) minmax(270px,.75fr);align-items:start}.dashboard-attention{grid-row:span 2}.dashboard-side-card{min-height:0}.quick-actions{display:grid;gap:9px}.quick-action{display:flex;align-items:center;gap:11px;padding:11px 12px;border:1px solid var(--line);border-radius:11px;background:#fff;text-decoration:none;color:var(--text);transition:.14s ease}.quick-action:hover{transform:translateY(-1px);box-shadow:0 8px 20px rgba(25,39,68,.06)}.quick-action>span{display:grid;place-items:center;width:30px;height:30px;border-radius:9px;font-size:16px;font-weight:850}.quick-action div{display:grid;gap:2px}.quick-action strong{font-size:11px}.quick-action small{font-size:9px;color:var(--muted)}.action-blue>span{background:#edf3ff;color:#3f66d9}.action-violet>span{background:#f3edff;color:#7954c3}.action-green>span{background:#ebfaf3;color:#2c9a70}.action-amber>span{background:#fff6e7;color:#c7891b}.snapshot-list{display:grid;gap:0}.snapshot-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px solid var(--line)}.snapshot-row:last-child{border-bottom:0}.snapshot-row div{display:grid;gap:2px}.snapshot-row strong{font-size:11px}.snapshot-row span{font-size:9px;color:var(--muted);line-height:1.35}.notification-item{grid-template-columns:auto minmax(0,1fr) auto;align-items:center}.notification-kind{display:inline-flex;align-items:center;justify-content:center;min-width:58px;padding:5px 7px;border-radius:999px;background:#f3f5f9;color:#7a8496;font-size:8px;font-weight:800;text-transform:uppercase;letter-spacing:.06em}.notification-item em{font-size:9px;font-style:normal;font-weight:800;color:#7b8799}.dashboard-empty{display:grid;place-items:center;gap:5px;padding:52px 18px}.dashboard-empty strong{font-size:13px;color:#4b566a}.dashboard-empty span{font-size:10px;color:#969faf;text-align:center;max-width:340px}.empty-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#eaf8f0;color:#2c9a70;font-size:16px;font-weight:900;margin-bottom:2px}.dashboard-activity{grid-column:1/-1}.dashboard-timeline{max-height:240px;overflow:auto;padding-right:4px}@media(max-width:1180px){.dashboard-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:900px){.dashboard-main-grid{grid-template-columns:1fr}.dashboard-attention,.dashboard-activity{grid-row:auto;grid-column:auto}.dashboard-intro{align-items:flex-start;flex-direction:column}}@media(max-width:720px){.dashboard-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-intro h2{font-size:22px}.dashboard-date{display:none}}
/* Email history toolbar - modern compact workspace treatment */
.email-history-filters{display:flex;align-items:center;gap:10px;flex-wrap:wrap;width:100%;padding:4px}.email-history-filters .search-field{flex:1 1 360px;min-width:240px;height:44px;background:#fff;border:1px solid #dbe2ee;border-radius:12px;box-shadow:0 3px 12px rgba(30,44,75,.05)}.email-history-filters .search-field input{font-size:12px}.email-history-filters .search-field:focus-within{border-color:#9db2ff;box-shadow:0 0 0 4px rgba(59,102,246,.08)}.email-history-filters .vault-filter{min-width:150px;min-height:42px;border-radius:11px;background:#fff;border:1px solid #dbe2ee;box-shadow:0 2px 8px rgba(30,44,75,.03)}.email-history-filters .btn{min-height:42px;border-radius:11px;padding:9px 14px}.email-history-filters .btn-secondary{background:#f6f8fc;border-color:#dbe2ee}.email-history-filters .btn-ghost{min-height:42px}@media(max-width:720px){.email-history-filters{align-items:stretch;gap:8px}.email-history-filters .search-field,.email-history-filters .vault-filter,.email-history-filters .btn{flex:1 1 100%;min-width:0;width:100%}}

/* Email template header */
#load-email-defaults{white-space:nowrap}


/* Automation Run Status — presentation only */
.automation-run-status-card{
  position:relative;
  overflow:hidden;
  background:linear-gradient(180deg,#fff 0%,#fbfcff 100%);
  border:1px solid #e1e7f1;
  box-shadow:0 12px 32px rgba(28,42,70,.07);
}
.automation-run-status-card:before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:3px;
  background:linear-gradient(180deg,#4c70f5,#7d94ff);
}
.automation-run-status-card .section-head{
  align-items:center;
  gap:14px;
  margin-bottom:18px;
}
.automation-run-status-card .section-head > div{min-width:0}
.automation-run-status-card .section-head h2{
  margin:0;
  font-size:18px;
  letter-spacing:-.025em;
}
.automation-run-status-card .section-head .small{
  display:block;
  margin-top:4px;
  line-height:1.45;
}
.automation-run-status-card .section-head .badge{
  flex:0 0 auto;
  padding:6px 10px;
  border-radius:999px;
  font-size:9px;
  font-weight:850;
  letter-spacing:.02em;
  border:1px solid #dfe5ef;
  background:#f5f7fb;
  color:#69758a;
}
.automation-run-status-card .section-head .badge.success{
  background:#eaf8f1;
  border-color:#ccebdc;
  color:#17835a;
}
.automation-run-status-card .section-head .badge.danger{
  background:#fff0f0;
  border-color:#f1d2d2;
  color:#c43f3f;
}
.automation-run-status-card .snapshot-list{
  display:grid;
  gap:10px;
}
.automation-run-status-card .snapshot-row{
  position:relative;
  display:block;
  padding:14px 15px 14px 17px;
  border:1px solid #e5eaf2;
  border-radius:12px;
  background:#fff;
  box-shadow:0 3px 10px rgba(29,43,70,.025);
}
.automation-run-status-card .snapshot-row:before{
  content:"";
  position:absolute;
  left:0;
  top:12px;
  bottom:12px;
  width:3px;
  border-radius:3px;
  background:#d9e1ef;
}
.automation-run-status-card .snapshot-row:first-child:before{background:#5b79e8}
.automation-run-status-card .snapshot-row:last-child:before{background:#7d8ca6}
.automation-run-status-card .snapshot-row div{
  display:grid;
  gap:5px;
  min-width:0;
}
.automation-run-status-card .snapshot-row strong{
  color:#667187;
  font-size:9px;
  line-height:1.2;
  text-transform:uppercase;
  letter-spacing:.075em;
  font-weight:850;
}
.automation-run-status-card .snapshot-row span{
  color:#253148;
  font-size:11px;
  line-height:1.5;
  overflow-wrap:anywhere;
}
.automation-run-status-card > form:not(.inline-form){margin-top:16px !important}
.automation-run-status-card > form .btn{
  width:100%;
  min-height:42px;
  border-radius:11px;
  font-weight:800;
  box-shadow:0 6px 16px rgba(39,66,150,.08);
}
.automation-run-status-card > form .btn-secondary{
  background:#f6f8fc;
  border-color:#d9e0ec;
  color:#33415b;
}
.automation-run-status-card > form .btn-secondary:hover{
  background:#eef2f9;
  border-color:#cbd5e5;
}
.automation-run-status-card .settings-help{
  margin-top:14px !important;
  padding:12px 13px;
  border:1px solid #e5eaf2;
  border-radius:11px;
  background:#f8faff;
  line-height:1.55;
}
.automation-run-status-card .settings-help strong{
  display:block;
  margin-bottom:5px;
  color:#5d6980;
  font-size:9px;
  text-transform:uppercase;
  letter-spacing:.07em;
}
.automation-run-status-card .settings-help code{
  display:block;
  margin-top:5px;
  padding:7px 8px;
  border:1px solid #e1e7f1;
  border-radius:7px;
  background:#fff;
  color:#536078;
  font-size:9px;
  line-height:1.45;
  overflow-wrap:anywhere;
}
@media(max-width:720px){
  .automation-run-status-card .section-head{align-items:flex-start}
  .automation-run-status-card .section-head .badge{margin-top:1px}
}


/* Mobile v5 — header alignment, page search, selected navigation, login shell */
@media(max-width:720px){
  /* Header: title/logo left; search centered in the available middle; bell/profile right. */
  .topbar{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto !important;
    column-gap:8px;
    min-width:0;
  }
  .topbar-title{
    min-width:0;
    overflow:hidden;
  }
  .topbar-actions{
    display:grid !important;
    grid-template-columns:40px 40px 40px !important;
    align-items:center;
    gap:6px;
    width:132px;
    margin-left:0 !important;
    flex:0 0 132px !important;
  }
  .topbar-actions .global-search{
    grid-column:1;
    width:40px !important;
    height:40px;
    justify-self:center;
    display:flex !important;
    align-items:center;
    justify-content:center;
    margin:0;
  }
  .topbar-actions .notification{
    grid-column:2;
    justify-self:center;
  }
  .topbar-actions .topbar-avatar{
    grid-column:3;
    justify-self:center;
  }
  .topbar-actions .global-search input{display:none}
  .topbar-actions .topbar-date{display:none}

  /* Inner list/search form: input and Search button stay on one line. */
  .content .page-row form.inline{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    width:100% !important;
    box-sizing:border-box;
    padding:5px 6px 5px 12px !important;
    gap:7px !important;
    min-height:46px;
  }
  .content .page-row form.inline .search{
    display:block !important;
    flex:1 1 auto !important;
    width:auto !important;
    max-width:none !important;
    min-width:0 !important;
    height:34px !important;
    padding:0 !important;
  }
  .content .page-row form.inline .btn{
    display:inline-flex !important;
    flex:0 0 auto !important;
    width:auto !important;
    min-height:32px !important;
    height:32px;
    padding:5px 10px !important;
    white-space:nowrap;
  }
  .content .page-row>a.btn{
    width:100% !important;
  }

  /* Make the active bottom item unmistakable. */
  .mobile-bottom-item.active .mobile-bottom-icon,
  .mobile-bottom-item.active-more .mobile-bottom-icon{
    width:46px !important;
    height:46px !important;
    flex-basis:46px !important;
    transform:translateY(-19px) !important;
    background:var(--accent) !important;
    color:#fff !important;
    border:5px solid #fffaf5 !important;
    box-shadow:0 9px 22px rgba(59,102,246,.34),0 0 0 1px rgba(59,102,246,.08);
  }
  .mobile-bottom-item.active span:last-child,
  .mobile-bottom-item.active-more span:last-child{
    color:#315de9 !important;
    font-weight:900 !important;
    bottom:6px !important;
  }
}

/* Login is a first-class responsive screen, not a desktop form stretched across the viewport. */
.login{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
  background:linear-gradient(145deg,#f5f7fc 0%,#f7f1ea 100%);
}
.login-card{
  width:min(430px,100%);
  padding:34px;
  background:#fff;
  border:1px solid #e3e7ef;
  border-radius:22px;
  box-shadow:0 20px 55px rgba(25,35,55,.10);
}
.login-card .brand{
  display:flex;
  align-items:center;
  gap:11px;
  margin-bottom:30px;
}
.login-card .brand-mark{
  width:42px;height:42px;
  display:grid;place-items:center;
  border-radius:12px;
  background:linear-gradient(135deg,#5b7cff,#3558e8);
  color:#fff;
  font-size:18px;
  font-weight:900;
  box-shadow:0 8px 18px rgba(55,88,232,.20);
}
.login-card .brand strong{display:block;font-size:15px;color:#172238}
.login-card .brand small{display:block;margin-top:2px;color:#8791a2;font-size:10px}
.login-card h1{margin:0 0 22px;font-size:28px;letter-spacing:-.035em;color:#172238}
.login-card form{margin:0}
.login-card .stack{gap:16px}
.login-card .field{gap:7px}
.login-card .field label{font-size:11px;font-weight:800;color:#536078}
.login-card .field input{
  min-height:46px;
  box-sizing:border-box;
  border-radius:11px;
  background:#fbfcff;
}
.login-card .btn-primary{
  width:100%;
  min-height:46px;
  border-radius:12px;
  margin-top:2px;
}
@media(max-width:520px){
  .login{padding:16px}
  .login-card{
    padding:25px 20px;
    border-radius:19px;
  }
  .login-card .brand{margin-bottom:24px}
  .login-card h1{font-size:25px;margin-bottom:20px}
}


/* Mobile v6 — final shell alignment and logout */
@media(max-width:720px){
  /* Keep logo + page title on the left, search centered, alerts/profile right. */
  .topbar{
    position:sticky !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    min-height:64px !important;
    padding:0 10px !important;
    column-gap:8px !important;
    overflow:visible !important;
  }
  .topbar:before{
    position:relative !important;
    left:auto !important;
    top:auto !important;
    flex:0 0 34px !important;
    width:34px !important;
    height:34px !important;
    margin:0 !important;
    transform:none !important;
  }
  .topbar-title{
    flex:1 1 auto !important;
    min-width:0 !important;
    max-width:calc(100% - 130px) !important;
  }
  .topbar-actions{
    display:contents !important;
    width:auto !important;
    margin:0 !important;
  }
  .topbar-actions .global-search{
    position:absolute !important;
    left:50% !important;
    top:50% !important;
    transform:translate(-50%,-50%) !important;
    width:38px !important;
    height:38px !important;
    margin:0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
  }
  .topbar-actions .notification{
    position:absolute !important;
    right:58px !important;
    top:50% !important;
    transform:translateY(-50%) !important;
  }
  .topbar-actions .topbar-avatar{
    position:absolute !important;
    right:10px !important;
    top:50% !important;
    transform:translateY(-50%) !important;
    width:38px !important;
    height:38px !important;
  }
  .topbar-actions .topbar-date{display:none !important}

  /* Never let the active bottom item paint a rectangular selection box. */
  .mobile-bottom-item,
  .mobile-bottom-item.active,
  .mobile-bottom-item.active-more{
    background:transparent !important;
    box-shadow:none !important;
  }
  .mobile-bottom-item.active:before,
  .mobile-bottom-item.active-more:before{
    background:transparent !important;
    box-shadow:none !important;
    width:0 !important;
    height:0 !important;
  }
  .mobile-bottom-item.active .mobile-bottom-icon,
  .mobile-bottom-item.active-more .mobile-bottom-icon{
    background:var(--accent) !important;
    border:4px solid #fffaf5 !important;
    box-shadow:0 9px 22px rgba(59,102,246,.34) !important;
  }

  /* Local list/search controls always remain one clean horizontal control. */
  .content .page-row form.inline{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:nowrap !important;
    align-items:center !important;
    width:100% !important;
    min-width:0 !important;
    box-sizing:border-box !important;
    padding:5px 6px 5px 11px !important;
    gap:7px !important;
  }
  .content .page-row form.inline:before{
    flex:0 0 auto !important;
  }
  .content .page-row form.inline .search{
    display:block !important;
    flex:1 1 auto !important;
    min-width:0 !important;
    width:auto !important;
    max-width:none !important;
    height:34px !important;
    padding:0 !important;
    margin:0 !important;
  }
  .content .page-row form.inline .btn{
    display:inline-flex !important;
    flex:0 0 auto !important;
    width:auto !important;
    min-height:32px !important;
    height:32px !important;
    padding:5px 10px !important;
    white-space:nowrap !important;
  }

  .mobile-logout-link{
    color:#c54a4a !important;
  }
  .mobile-logout-link .mobile-logout-icon{
    width:18px;
    height:18px;
    display:grid;
    place-items:center;
    border-radius:6px;
    background:#fff0f0;
    color:#c54a4a;
    font-size:13px;
    font-weight:900;
  }
}

/* Mobile v7 — usable global search, taller header, larger mobile type */
@media(max-width:720px){
  .topbar{
    min-height:76px !important;
    height:76px !important;
    padding:0 12px !important;
  }
  .topbar:before{
    width:38px !important;
    height:38px !important;
    flex-basis:38px !important;
    border-radius:11px !important;
  }
  .topbar-title{max-width:calc(100% - 190px) !important}
  .topbar h1{font-size:19px !important}
  .eyebrow{font-size:9px !important}

  /* The global search is a real, tappable search field on mobile. */
  .topbar-actions .global-search{
    left:50% !important;
    width:min(190px,42vw) !important;
    height:42px !important;
    padding:0 11px !important;
    justify-content:flex-start !important;
    gap:7px !important;
    background:#fff !important;
    border:1px solid #e0e5ee !important;
    box-shadow:0 4px 14px rgba(28,42,70,.05) !important;
    border-radius:12px !important;
    z-index:2 !important;
  }
  .topbar-actions .global-search .global-search-icon{
    display:block !important;
    flex:0 0 auto !important;
    font-size:17px !important;
    line-height:1 !important;
  }
  .topbar-actions .global-search input{
    display:block !important;
    width:100% !important;
    min-width:0 !important;
    height:34px !important;
    padding:0 !important;
    font-size:11px !important;
  }
  .topbar-actions .global-search input::placeholder{font-size:10px !important}
  .topbar-actions .notification-button{
    width:40px !important;height:40px !important;font-size:16px !important;
  }
  .topbar-actions .topbar-avatar{width:40px !important;height:40px !important}

  /* Make the mobile application text easier to read without making it bulky. */
  .content{font-size:13px !important}
  .content .card{font-size:13px !important}
  .content .card h2,.content .card h3{font-size:17px !important}
  .content .small,.content .muted{font-size:11px !important}
  .content .field label{font-size:11px !important}
  .content .field input,.content .field select,.content .field textarea{font-size:14px !important}
  .content .btn{font-size:12px !important}
  .dashboard-kpis .card{padding:16px !important}
  .dashboard-kpis .card strong,.dashboard-kpis .card .value{font-size:inherit}

  /* Local page search: readable text and vertically centered controls. */
  .content .page-row form.inline{
    min-height:48px !important;
    padding:5px 7px 5px 13px !important;
    gap:8px !important;
    border-radius:12px !important;
  }
  .content .page-row form.inline .search{
    height:36px !important;
    font-size:13px !important;
    line-height:36px !important;
  }
  .content .page-row form.inline .search::placeholder{font-size:12px !important}
  .content .page-row form.inline .btn{
    height:34px !important;
    min-height:34px !important;
    padding:5px 11px !important;
    font-size:11px !important;
    border-radius:9px !important;
  }
}


/* Mobile v8 — notification panel positioning */
@media(max-width:720px){
  .topbar .notification{position:relative !important;}
  .topbar .notification-panel,
  .topbar .notification-panel.open{
    position:fixed !important;
    top:84px !important;
    left:auto !important;
    right:12px !important;
    width:min(340px, calc(100vw - 24px)) !important;
    max-width:calc(100vw - 24px) !important;
    max-height:calc(100vh - 104px) !important;
    overflow:auto !important;
    display:none !important;
    z-index:200 !important;
    padding:0 !important;
    background:#fff !important;
    border:1px solid #e1e5ec !important;
    border-radius:16px !important;
    box-shadow:0 18px 45px rgba(25,35,55,.18) !important;
  }
  .topbar .notification-panel.open{display:block !important;}
  .notification-head{
    position:sticky !important;
    top:0 !important;
    z-index:2 !important;
    padding:13px 15px !important;
    background:rgba(255,255,255,.97) !important;
    border-bottom:1px solid #edf0f4 !important;
  }
  .notification-item{
    display:grid !important;
    grid-template-columns:auto 1fr !important;
    column-gap:9px !important;
    padding:12px 14px !important;
    border-bottom:1px solid #edf0f4 !important;
  }
  .notification-item:last-child{border-bottom:0 !important;}
  .notification-empty{padding:22px 15px !important;}
}


/* Mobile v9 — notification panel anchored to the bell */
@media(max-width:720px){
  .topbar .notification{
    position:static !important;
  }
  .topbar .notification-panel{
    position:fixed !important;
    top:76px !important;
    right:12px !important;
    left:auto !important;
    width:300px !important;
    max-width:calc(100vw - 24px) !important;
    height:auto !important;
    max-height:calc(100vh - 96px) !important;
    margin:0 !important;
    transform:none !important;
    visibility:hidden !important;
    opacity:0 !important;
    display:block !important;
    overflow:auto !important;
    z-index:9999 !important;
    background:#fff !important;
    border:1px solid #e4e7ec !important;
    border-radius:16px !important;
    box-shadow:0 18px 45px rgba(25,35,55,.20) !important;
    pointer-events:none !important;
  }
  .topbar .notification-panel.open{
    visibility:visible !important;
    opacity:1 !important;
    pointer-events:auto !important;
  }
  .topbar .notification-panel .notification-head{
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    min-height:48px !important;
    padding:13px 15px !important;
    background:#fff !important;
  }
  .topbar .notification-panel .notification-item{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:4px !important;
    min-height:0 !important;
    padding:13px 15px !important;
  }
}


/* Mobile v11 topbar alignment fix */
@media(max-width:720px){
  .topbar{position:relative !important; display:flex !important; align-items:center !important; min-height:76px !important; padding:10px 12px !important; box-sizing:border-box !important; overflow:visible !important;}
  .topbar-title{position:relative !important; z-index:2 !important; flex:0 0 auto !important; min-width:0 !important; max-width:46% !important; margin:0 !important; padding:0 !important;}
  .topbar-actions{position:absolute !important; inset:0 !important; width:auto !important; height:100% !important; margin:0 !important; padding:0 !important; display:block !important; pointer-events:none !important; z-index:4 !important;}
  .topbar-actions .global-search{position:absolute !important; left:50% !important; top:50% !important; transform:translate(-50%,-50%) !important; width:150px !important; height:42px !important; margin:0 !important; display:flex !important; pointer-events:auto !important; box-sizing:border-box !important;}
  .topbar-actions .global-search input{display:block !important; width:100% !important; min-width:0 !important; height:100% !important; padding:0 12px 0 30px !important; font-size:10px !important; border:0 !important; outline:0 !important; background:transparent !important;}
  .topbar-actions .global-search-icon{position:absolute !important; left:11px !important; top:50% !important; transform:translateY(-50%) !important; font-size:13px !important; z-index:2 !important; pointer-events:none !important;}
  .topbar-actions .notification{position:absolute !important; right:54px !important; top:50% !important; transform:translateY(-50%) !important; margin:0 !important; width:40px !important; height:40px !important; pointer-events:auto !important;}
  .topbar-actions .notification-button{display:grid !important; place-items:center !important; width:40px !important; height:40px !important; margin:0 !important;}
  .topbar-actions .topbar-avatar{position:absolute !important; right:8px !important; top:50% !important; transform:translateY(-50%) !important; width:40px !important; height:40px !important; margin:0 !important; pointer-events:auto !important;}
  .topbar-actions .topbar-date{display:none !important;}
  .topbar-actions .notification-panel{z-index:120 !important;}
}


/* Mobile v13 — final responsive containment and header layout */
html, body{max-width:100%;}

@media(max-width:720px){
  html, body{
    width:100%;
    max-width:100%;
    overflow-x:hidden !important;
  }
  .app-shell,
  .main,
  .content,
  .topbar{
    max-width:100% !important;
    min-width:0 !important;
    box-sizing:border-box !important;
  }
  .main{overflow-x:hidden !important;}
  .content{
    width:100% !important;
    overflow-x:hidden !important;
  }

  /* One stable mobile header grid: title | centered search | bell + profile. */
  .topbar{
    position:relative !important;
    display:block !important;
    height:76px !important;
    min-height:76px !important;
    padding:10px 12px !important;
    overflow:visible !important;
  }
  .topbar:before{
    position:absolute !important;
    left:12px !important;
    top:19px !important;
    width:38px !important;
    height:38px !important;
    margin:0 !important;
    transform:none !important;
  }
  .topbar-title{
    position:absolute !important;
    left:58px !important;
    top:18px !important;
    width:calc(100% - 190px) !important;
    max-width:none !important;
    min-width:0 !important;
    z-index:5 !important;
  }
  .topbar h1{
    font-size:18px !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }

  .topbar-actions{
    position:absolute !important;
    inset:0 !important;
    display:block !important;
    width:100% !important;
    height:100% !important;
    margin:0 !important;
    padding:0 !important;
    pointer-events:none !important;
    z-index:10 !important;
  }

  .topbar-actions .global-search{
    position:absolute !important;
    left:50% !important;
    top:50% !important;
    transform:translate(-50%,-50%) !important;
    width:132px !important;
    max-width:132px !important;
    height:40px !important;
    margin:0 !important;
    padding:0 9px !important;
    display:flex !important;
    align-items:center !important;
    pointer-events:auto !important;
    box-sizing:border-box !important;
    z-index:11 !important;
  }
  .topbar-actions .global-search input{
    display:block !important;
    width:100% !important;
    min-width:0 !important;
    height:34px !important;
    padding:0 !important;
    font-size:10px !important;
  }

  .topbar-actions .notification{
    position:absolute !important;
    right:55px !important;
    top:50% !important;
    transform:translateY(-50%) !important;
    width:40px !important;
    height:40px !important;
    margin:0 !important;
    pointer-events:auto !important;
    z-index:13 !important;
  }
  .topbar-actions .notification-button{
    width:40px !important;
    height:40px !important;
    display:grid !important;
    place-items:center !important;
  }
  .topbar-actions .topbar-avatar{
    position:absolute !important;
    right:9px !important;
    top:50% !important;
    transform:translateY(-50%) !important;
    width:40px !important;
    height:40px !important;
    margin:0 !important;
    pointer-events:auto !important;
    z-index:13 !important;
  }
  .topbar-actions .topbar-date{display:none !important;}

  /* Keep the notification card inside the viewport and below the header.
     It aligns visually with the right-side alert area without causing page width. */
  .topbar .notification-panel,
  .topbar .notification-panel.open{
    position:fixed !important;
    top:82px !important;
    left:auto !important;
    right:12px !important;
    width:min(310px,calc(100vw - 24px)) !important;
    max-width:calc(100vw - 24px) !important;
    max-height:calc(100vh - 98px) !important;
    margin:0 !important;
    transform:none !important;
    box-sizing:border-box !important;
    z-index:9999 !important;
  }

  /* Tables scroll inside their own container; never make the whole page wider. */
  .table-wrap{
    width:100% !important;
    max-width:100% !important;
    overflow-x:auto !important;
    overflow-y:hidden !important;
    -webkit-overflow-scrolling:touch;
  }
  .table-wrap .table{
    max-width:none !important;
  }

  /* Selected item: slightly larger, with no rectangular background. */
  .mobile-bottom-item.active,
  .mobile-bottom-item.active-more{
    background:transparent !important;
    box-shadow:none !important;
  }
  .mobile-bottom-item.active span:last-child,
  .mobile-bottom-item.active-more span:last-child{
    font-size:10px !important;
    font-weight:900 !important;
  }
  .mobile-bottom-item.active .mobile-bottom-icon .cm-icon,
  .mobile-bottom-item.active-more .mobile-bottom-icon .cm-icon{
    width:22px !important;
    height:22px !important;
  }
}


/* Mobile v14 — logo header + breadcrumb + clean global search */
.mobile-top-brand,
.mobile-breadcrumb{display:none;}

@media(max-width:720px){
  .mobile-top-brand{
    display:block !important;
    position:absolute !important;
    left:12px !important;
    top:50% !important;
    transform:translateY(-50%) !important;
    width:38px !important;
    height:38px !important;
    z-index:15 !important;
  }
  .mobile-brand-mark{
    display:grid !important;
    place-items:center !important;
    width:38px !important;
    height:38px !important;
    border-radius:11px !important;
    background:linear-gradient(135deg,#5b7cff,#3558e8) !important;
    color:#fff !important;
    font-size:16px !important;
    font-weight:900 !important;
    box-shadow:0 7px 16px rgba(55,88,232,.20) !important;
    overflow:hidden !important;
  }
  .mobile-brand-mark.has-logo{
    background:#fff !important;
    border:1px solid #e3e7ee !important;
  }
  .mobile-brand-mark img{
    width:100% !important;
    height:100% !important;
    object-fit:cover !important;
    display:block !important;
  }

  /* The old title is replaced by the breadcrumb below the header. */
  .topbar-title{display:none !important;}
  .topbar:before{display:none !important;}

  .topbar{
    height:62px !important;
    min-height:62px !important;
    padding:8px 10px !important;
  }

  .topbar-actions .global-search{
    left:50% !important;
    width:150px !important;
    max-width:calc(100vw - 170px) !important;
    height:38px !important;
    padding:0 10px !important;
    gap:6px !important;
  }
  .topbar-actions .global-search-icon{
    position:static !important;
    flex:0 0 auto !important;
    transform:none !important;
    font-size:12px !important;
    line-height:1 !important;
  }
  .topbar-actions .global-search input{
    display:block !important;
    width:100% !important;
    height:32px !important;
    min-width:0 !important;
    padding:0 !important;
    font-size:9px !important;
    line-height:1 !important;
  }
  .topbar-actions .global-search input::placeholder{
    font-size:9px !important;
  }

  .mobile-breadcrumb{
    display:flex !important;
    align-items:center !important;
    gap:6px !important;
    min-height:34px !important;
    padding:7px 14px 8px !important;
    background:#f8f6f0 !important;
    border-bottom:1px solid #ebe8df !important;
    color:#7f8998 !important;
    font-size:9px !important;
    line-height:1.2 !important;
    white-space:nowrap !important;
    overflow:hidden !important;
  }
  .mobile-breadcrumb span{
    color:#9aa2ae !important;
    font-size:8px !important;
    font-weight:800 !important;
    letter-spacing:.07em !important;
    text-transform:uppercase !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }
  .mobile-breadcrumb b{
    color:#c1c6cd !important;
    font-weight:600 !important;
  }
  .mobile-breadcrumb strong{
    color:#263247 !important;
    font-size:10px !important;
    font-weight:850 !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }

  /* Give the content a little less top padding because the breadcrumb now
     carries the page context. */
  .content{padding-top:14px !important;}
}

/* v15 visual system: Apple-inspired neutral palette + system dark mode. */
:root{
 --bg:#f5f5f7;
 --surface:#ffffff;
 --surface-2:#f5f5f7;
 --text:#1d1d1f;
 --muted:#6e6e73;
 --line:#e1e1e3;
 --line-2:#d2d2d7;
 --nav:#1d1d1f;
 --nav-2:#252526;
 --nav-text:#aaaaaa;
 --nav-soft:#2f2f31;
 --accent:#007aff;
 --accent-2:#147efb;
 --accent-soft:#eaf3ff;
 --success:#16834f;
 --success-soft:#e8f7ef;
 --danger:#c93434;
 --danger-soft:#fff0f0;
 --warning:#9a6500;
 --warning-soft:#fff6df;
 --radius:14px;
 --shadow:0 10px 30px rgba(29,29,31,.065);
 --shadow-lg:0 24px 60px rgba(29,29,31,.16)
}
html{font-family:Inter,-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif}
body,button,input,select,textarea{font-family:inherit}
.topbar h1,.section-head h2,.dashboard-title,.page-title{letter-spacing:-.035em}
.stat{letter-spacing:-.045em}

.theme-toggle{width:40px;height:40px;border:1px solid var(--line);border-radius:11px;background:var(--surface);color:var(--text);display:grid;place-items:center;cursor:pointer;box-shadow:0 4px 12px rgba(20,30,60,.05);font-size:16px;transition:.18s ease}
.theme-toggle:hover{transform:translateY(-1px);background:var(--surface-2)}
.theme-toggle-icon{line-height:1}
.mobile-theme-toggle{width:100%;display:flex;align-items:center;gap:11px;min-height:46px;padding:10px 12px;border:0;border-radius:12px;background:transparent;color:#566173;font-size:13px;font-weight:720;text-align:left;cursor:pointer}
.mobile-theme-toggle:hover{background:var(--surface-2)}
.mobile-theme-icon{width:18px;text-align:center}
.mobile-theme-state{margin-left:auto;color:var(--muted);font-size:10px;font-weight:800}

html[data-theme="dark"] body{background:#1d1d1f;color:#f5f5f7}
html[data-theme="dark"] .workspace-nav,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .card,
html[data-theme="dark"] .notification-panel,
html[data-theme="dark"] .search,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .notification-button,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .page-row form.inline{background:#252526;color:#f5f5f7;border-color:#3a3a3c}
html[data-theme="dark"] .workspace-nav{border-right-color:#3a3a3c}
html[data-theme="dark"] .topbar{border-bottom-color:#3a3a3c;background:rgba(37,37,38,.94)}
html[data-theme="dark"] .workspace-nav-head strong,
html[data-theme="dark"] .workspace-link.active,
html[data-theme="dark"] .field label,
html[data-theme="dark"] .section-head h2,
html[data-theme="dark"] .notification-head strong,
html[data-theme="dark"] .notification-item strong,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .topbar h1{color:#f5f5f7}
html[data-theme="dark"] .workspace-link{color:#aaaaaa}
html[data-theme="dark"] .workspace-link:hover{background:#2d2d2f;color:#f5f5f7}
html[data-theme="dark"] .workspace-link.active{background:#202a39;color:#fff}
html[data-theme="dark"] .workspace-user{border-top-color:#3a3a3c}
html[data-theme="dark"] .card{box-shadow:0 12px 32px rgba(0,0,0,.22)}
html[data-theme="dark"] .table th,
html[data-theme="dark"] .table td{border-bottom-color:#3a3a3c}
html[data-theme="dark"] .table tbody tr:hover td{background:#2b2b2d}
html[data-theme="dark"] .btn-secondary{background:#303033;border-color:#454549;color:#f5f5f7}
html[data-theme="dark"] .page-row form.inline:before{color:#aaaaaa}
html[data-theme="dark"] .search::placeholder,
html[data-theme="dark"] .field input::placeholder,
html[data-theme="dark"] .field textarea::placeholder{color:#8e8e93}
html[data-theme="dark"] .settings-tabs{background:#2a2a2c;border-color:#3a3a3c}
html[data-theme="dark"] .settings-tabs a{color:#aaaaaa}
html[data-theme="dark"] .settings-tabs a.active{background:#353537;color:#f5f5f7;border-color:#46464a}
html[data-theme="dark"] .check-row,
html[data-theme="dark"] .payment-context,
html[data-theme="dark"] .timeline-item{background:#2b2b2d;border-color:#3a3a3c}
html[data-theme="dark"] .mobile-drawer{background:#252526}
html[data-theme="dark"] .mobile-drawer-head{background:rgba(37,37,38,.96);border-bottom-color:#3a3a3c}
html[data-theme="dark"] .mobile-group a,
html[data-theme="dark"] .mobile-theme-toggle{color:#d1d1d6}
html[data-theme="dark"] .mobile-group a.active{background:#202a39;color:#fff}
html[data-theme="dark"] .mobile-bottom-nav{background:rgba(37,37,38,.96);border-color:#3a3a3c}
html[data-theme="dark"] .mobile-bottom-item{color:#8e8e93}
html[data-theme="dark"] .mobile-bottom-item.active{color:#fff;background:transparent}
html[data-theme="dark"] .mobile-breadcrumb{background:#252526!important;border-bottom-color:#3a3a3c!important}
html[data-theme="dark"] .mobile-breadcrumb strong{color:#f5f5f7!important}
html[data-theme="dark"] .mobile-breadcrumb span{color:#8e8e93!important}
html[data-theme="dark"] .flash{background:#202a39;border-color:#34445e;color:#cbd9ff}
html[data-theme="dark"] .flash.error{background:#351f21;border-color:#5a3033;color:#ffb4b4}
html[data-theme="dark"] .flash.success{background:#1e3028;border-color:#31513f;color:#a8e6c5}
html[data-theme="dark"] .asset-preview{background:#252526;border-color:#3a3a3c}
html[data-theme="dark"] .empty,.html[data-theme="dark"] .muted{color:#8e8e93}
html[data-theme="dark"] .page-row form.inline .search{background:transparent;border-color:transparent}

@media(max-width:720px){
  .theme-toggle{width:38px;height:38px;border-radius:11px;font-size:15px}
  .topbar-actions{gap:6px}
  .topbar-actions .theme-toggle{order:1}
  .topbar-actions .notification{order:2}
  .topbar-actions .topbar-avatar{order:3}
}


/* v16 — robust theme layer */
html.theme-dark, html[data-theme="dark"]{color-scheme:dark;}
html:not(.theme-dark):not([data-theme="dark"]){color-scheme:light;}
html.theme-dark body, html[data-theme="dark"] body{background:#1d1d1f !important;color:#f5f5f7 !important;}
html.theme-dark .main, html[data-theme="dark"] .main{background:#1d1d1f !important;color:#f5f5f7 !important;}
html.theme-dark .content, html[data-theme="dark"] .content{background:transparent !important;color:#f5f5f7 !important;}
html.theme-dark .workspace-nav, html.theme-dark .topbar, html.theme-dark .card,
html.theme-dark .notification-panel, html.theme-dark .mobile-bottom-nav,
html.theme-dark .mobile-drawer, html.theme-dark .settings-tabs,
html.theme-dark .search, html.theme-dark .field input, html.theme-dark .field textarea,
html.theme-dark .field select, html.theme-dark .notification-button, html.theme-dark .theme-toggle,
html[data-theme="dark"] .workspace-nav, html[data-theme="dark"] .topbar, html[data-theme="dark"] .card,
html[data-theme="dark"] .notification-panel, html[data-theme="dark"] .mobile-bottom-nav,
html[data-theme="dark"] .mobile-drawer, html[data-theme="dark"] .settings-tabs,
html[data-theme="dark"] .search, html[data-theme="dark"] .field input, html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .field select, html[data-theme="dark"] .notification-button, html[data-theme="dark"] .theme-toggle{
  background:#252526 !important;color:#f5f5f7 !important;border-color:#3a3a3c !important;
}
html.theme-dark .mobile-breadcrumb, html[data-theme="dark"] .mobile-breadcrumb{background:#252526 !important;border-color:#3a3a3c !important;}
html.theme-dark .mobile-breadcrumb strong, html[data-theme="dark"] .mobile-breadcrumb strong{color:#f5f5f7 !important;}
html.theme-dark .mobile-breadcrumb span, html[data-theme="dark"] .mobile-breadcrumb span{color:#aaaaaa !important;}
html.theme-dark .mobile-group-label, html[data-theme="dark"] .mobile-group-label{color:#8e8e93 !important;}
html.theme-dark .mobile-group a, html[data-theme="dark"] .mobile-group a{color:#d1d1d6 !important;}
html.theme-dark .muted, html[data-theme="dark"] .muted{color:#8e8e93 !important;}
html.theme-dark .field label, html.theme-dark .section-head h2, html.theme-dark .notification-head strong,
html.theme-dark .notification-item strong, html.theme-dark .stat, html.theme-dark .topbar h1,
html.theme-dark .workspace-nav-head strong,
html[data-theme="dark"] .field label, html[data-theme="dark"] .section-head h2,
html[data-theme="dark"] .notification-head strong, html[data-theme="dark"] .notification-item strong,
html[data-theme="dark"] .stat, html[data-theme="dark"] .topbar h1,
html[data-theme="dark"] .workspace-nav-head strong{color:#f5f5f7 !important;}
html.theme-dark .table th, html.theme-dark .table td,
html[data-theme="dark"] .table th, html[data-theme="dark"] .table td{border-color:#3a3a3c !important;color:#e5e5e7 !important;}
html.theme-dark .table tbody tr:hover td, html[data-theme="dark"] .table tbody tr:hover td{background:#2b2b2d !important;}
html.theme-dark .btn-secondary, html[data-theme="dark"] .btn-secondary{background:#303033 !important;border-color:#454549 !important;color:#f5f5f7 !important;}
html.theme-dark .mobile-theme-toggle, html[data-theme="dark"] .mobile-theme-toggle{color:#d1d1d6 !important;}
html.theme-dark .mobile-group a.active, html[data-theme="dark"] .mobile-group a.active{background:#202a39 !important;color:#fff !important;}
html.theme-dark .mobile-bottom-item, html[data-theme="dark"] .mobile-bottom-item{color:#8e8e93 !important;}
html.theme-dark .mobile-bottom-item.active, html[data-theme="dark"] .mobile-bottom-item.active{color:#fff !important;background:transparent !important;}
html.theme-dark .notification-empty, html[data-theme="dark"] .notification-empty{color:#8e8e93 !important;}

/* v17 — theme switching fallback: mirror theme state on body */
body.theme-dark,
body[data-theme="dark"]{background:#1d1d1f !important;color:#f5f5f7 !important;}
body.theme-dark .main,
body[data-theme="dark"] .main{background:#1d1d1f !important;color:#f5f5f7 !important;}
body.theme-dark .content,
body[data-theme="dark"] .content{background:transparent !important;color:#f5f5f7 !important;}
body.theme-dark .workspace-nav,
body.theme-dark .topbar,
body.theme-dark .card,
body.theme-dark .notification-panel,
body.theme-dark .mobile-bottom-nav,
body.theme-dark .mobile-drawer,
body.theme-dark .settings-tabs,
body.theme-dark .search,
body.theme-dark .field input,
body.theme-dark .field textarea,
body.theme-dark .field select,
body.theme-dark .notification-button,
body.theme-dark .theme-toggle,
body[data-theme="dark"] .workspace-nav,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .card,
body[data-theme="dark"] .notification-panel,
body[data-theme="dark"] .mobile-bottom-nav,
body[data-theme="dark"] .mobile-drawer,
body[data-theme="dark"] .settings-tabs,
body[data-theme="dark"] .search,
body[data-theme="dark"] .field input,
body[data-theme="dark"] .field textarea,
body[data-theme="dark"] .field select,
body[data-theme="dark"] .notification-button,
body[data-theme="dark"] .theme-toggle{
  background:#252526 !important;color:#f5f5f7 !important;border-color:#3a3a3c !important;
}
body.theme-dark .mobile-breadcrumb,
body[data-theme="dark"] .mobile-breadcrumb{background:#252526 !important;border-color:#3a3a3c !important;}
body.theme-dark .mobile-breadcrumb strong,
body[data-theme="dark"] .mobile-breadcrumb strong{color:#f5f5f7 !important;}
body.theme-dark .mobile-theme-toggle,
body[data-theme="dark"] .mobile-theme-toggle{color:#d1d1d6 !important;}
body.theme-dark .field label,
body.theme-dark .section-head h2,
body.theme-dark .notification-head strong,
body.theme-dark .notification-item strong,
body.theme-dark .stat,
body.theme-dark .topbar h1,
body[data-theme="dark"] .field label,
body[data-theme="dark"] .section-head h2,
body[data-theme="dark"] .notification-head strong,
body[data-theme="dark"] .notification-item strong,
body[data-theme="dark"] .stat,
body[data-theme="dark"] .topbar h1{color:#f5f5f7 !important;}

/* v18 — desktop theme parity */
html[data-theme="dark"] body,
html.theme-dark body{
  background:#1d1d1f !important;
  color:#f5f5f7 !important;
}
html[data-theme="dark"] .app-shell,
html.theme-dark .app-shell{
  background:#1d1d1f !important;
}
html[data-theme="dark"] .primary-rail,
html[data-theme="dark"] .workspace-nav,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .content,
html.theme-dark .primary-rail,
html.theme-dark .workspace-nav,
html.theme-dark .topbar,
html.theme-dark .content{
  color:#f5f5f7 !important;
}
html[data-theme="dark"] .primary-rail,
html[data-theme="dark"] .workspace-nav,
html.theme-dark .primary-rail,
html.theme-dark .workspace-nav{
  background:#161617 !important;
  border-color:#3a3a3c !important;
}
html[data-theme="dark"] .topbar,
html.theme-dark .topbar{
  background:#252526 !important;
  border-color:#3a3a3c !important;
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .section,
html[data-theme="dark"] .table-card,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .notification-panel,
html.theme-dark .card,
html.theme-dark .panel,
html.theme-dark .section,
html.theme-dark .table-card,
html.theme-dark .modal,
html.theme-dark .notification-panel{
  background:#252526 !important;
  color:#f5f5f7 !important;
  border-color:#3a3a3c !important;
}
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .search,
html.theme-dark input,
html.theme-dark textarea,
html.theme-dark select,
html.theme-dark .search{
  background:#1d1d1f !important;
  color:#f5f5f7 !important;
  border-color:#3a3a3c !important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder,
html.theme-dark input::placeholder,
html.theme-dark textarea::placeholder{
  color:#8e8e93 !important;
}
html[data-theme="dark"] .topbar h1,
html[data-theme="dark"] .section-head h2,
html[data-theme="dark"] .card h2,
html[data-theme="dark"] .card h3,
html[data-theme="dark"] .field label,
html[data-theme="dark"] .table th,
html[data-theme="dark"] .table td,
html[data-theme="dark"] .notification-item strong,
html.theme-dark .topbar h1,
html.theme-dark .section-head h2,
html.theme-dark .card h2,
html.theme-dark .card h3,
html.theme-dark .field label,
html.theme-dark .table th,
html.theme-dark .table td,
html.theme-dark .notification-item strong{
  color:#f5f5f7 !important;
}
html[data-theme="dark"] .table tr,
html.theme-dark .table tr{
  border-color:#3a3a3c !important;
}
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-light,
html.theme-dark .btn-secondary,
html.theme-dark .btn-light{
  background:#3a3a3c !important;
  color:#f5f5f7 !important;
  border-color:#4a4a4c !important;
}
html[data-theme="dark"] .settings-tabs,
html.theme-dark .settings-tabs{
  background:#252526 !important;
  border-color:#3a3a3c !important;
}

@media(min-width:721px){
  .theme-toggle{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    cursor:pointer !important;
  }
}

/* Targeted dark-mode fixes: global topbar search + notification hover only. */
html[data-theme="dark"] .topbar .global-search,
html.theme-dark .topbar .global-search,
body[data-theme="dark"] .topbar .global-search,
body.theme-dark .topbar .global-search{
  background:#252526 !important;
  color:#f5f5f7 !important;
  border-color:#3a3a3c !important;
  box-shadow:0 4px 16px rgba(0,0,0,.18) !important;
}

html[data-theme="dark"] .topbar .global-search input,
html.theme-dark .topbar .global-search input,
body[data-theme="dark"] .topbar .global-search input,
body.theme-dark .topbar .global-search input{
  background:#252526 !important;
  color:#f5f5f7 !important;
  border:0 !important;
  box-shadow:none !important;
}

html[data-theme="dark"] .notification-panel .notification-item:hover,
html.theme-dark .notification-panel .notification-item:hover,
body[data-theme="dark"] .notification-panel .notification-item:hover,
body.theme-dark .notification-panel .notification-item:hover,
html[data-theme="dark"] .dashboard-attention .notification-item:hover,
html.theme-dark .dashboard-attention .notification-item:hover,
body[data-theme="dark"] .dashboard-attention .notification-item:hover,
body.theme-dark .dashboard-attention .notification-item:hover{
  background:#2b2b2d !important;
  color:#f5f5f7 !important;
}
