:root{
    --primary:#06B36A;
    --primary-2:#10c577;
    --primary-soft:#dff5eb;
    --dark:#00282D;
    --dark-2:#063940;
    --bg:#F1F3F2;
    --surface:#ffffff;
    --surface-soft:#f7faf8;
    --ink:#173136;
    --muted:#708285;
    --stroke:#d9e4e0;
    --success:#08a765;
    --success-soft:#e7faf1;
    --shadow:0 10px 28px rgba(0,40,45,.06);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font:14px/1.5 system-ui,-apple-system,'Segoe UI',sans-serif;color:var(--ink);background:var(--bg)}
a{color:inherit;text-decoration:none}
.shell{display:flex;min-height:100vh}

/* Sidebar */
.sidebar{width:238px;flex:none;background:var(--surface);border-right:1px solid var(--stroke);padding:14px 12px 16px;display:flex;flex-direction:column;gap:14px}
.sidebar-logo-wrap{padding:2px 6px 8px}
.sidebar-logo{width:190px;max-width:100%;display:block}
.sidebar-quick-card{background:#f6f8f7;border:1px solid var(--stroke);border-radius:14px;padding:14px 14px 12px}
.quick-card-title{font-weight:800;color:var(--dark);margin-bottom:2px}
.quick-card-sub{font-size:12px;color:var(--success)}
.quick-action{display:flex;align-items:center;justify-content:center;background:var(--primary);color:#fff;font-weight:800;padding:12px 14px;border-radius:10px;box-shadow:0 10px 18px rgba(6,179,106,.16)}
.quick-action:hover{background:#07995b}
nav{display:flex;flex-direction:column;gap:6px}
.nav-label{color:#8d9ca0;font-weight:900;font-size:11px;padding:8px 10px 2px;letter-spacing:.6px;text-transform:uppercase}
nav a,nav .nav-disabled{display:flex;align-items:center;gap:10px;border-radius:12px;padding:10px 12px;color:#2c464c;transition:.18s ease}
nav a:hover{background:#eef4f2}
nav a.active{background:#eef6f2;color:var(--success);font-weight:800}
.nav-icon{width:28px;height:28px;border-radius:10px;display:inline-grid;place-items:center;background:#f3f8f6;border:1px solid #dce8e3;color:#20545a;flex:none}
.nav-icon svg{width:16px;height:16px;display:block}
.nav-text{min-width:0;line-height:1.2}
.nav-disabled{opacity:.7;cursor:default}
nav small{float:right;font-size:10px;color:#9eacaf}
.sidebar-user-box{margin-top:auto;background:#fafcfc;border:1px solid var(--stroke);border-radius:14px;padding:10px;display:flex;align-items:center;gap:10px}
.sidebar-user-avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#e8efed;font-size:15px}
.sidebar-user-meta{min-width:0;flex:1}
.sidebar-user-meta strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px}
.sidebar-user-meta span{display:block;color:var(--muted);font-size:12px}
.logout-icon{border:0;background:transparent;font-size:24px;line-height:1;color:#495f65;cursor:pointer}

/* Main */
.main{flex:1;min-width:0}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:14px 26px}
.ref-topbar{background:transparent;border-bottom:none}
.topbar strong{font-size:16px;color:#273f45}
.topbar-sub{font-size:12px;color:var(--muted);margin-top:2px}
.account{display:flex;gap:16px;align-items:center}
.user-chip{display:inline-flex;align-items:center;padding:8px 14px;border:1px solid var(--stroke);border-radius:999px;background:#fff;color:#375056;font-weight:600}
.content{padding:0 26px 30px;max-width:1600px;margin:auto}
.panel{background:var(--surface);border:1px solid var(--stroke);border-radius:16px;padding:18px;box-shadow:var(--shadow)}
.subtle-panel{box-shadow:none}
.heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
h1{font-size:20px;margin:0;color:#fff;line-height:1.1}
h2{font-size:24px;margin:0}
h3{font-size:15px;margin:0;color:var(--dark)}
.muted,.hint,.soft-label{color:var(--muted)}
.notice{border:1px solid #dce7bd;background:#fbfdef;border-radius:12px;padding:14px 16px;margin-bottom:18px}
.btn{background:var(--primary);border:0;border-radius:10px;padding:12px 16px;color:#fff;font-weight:800;cursor:pointer;box-shadow:0 10px 18px rgba(6,179,106,.18);transition:.18s ease}
.btn:hover{background:#059b5d}
.text-btn{background:none;border:0;color:var(--primary);cursor:pointer;font:inherit;font-weight:700}
.wide{width:100%}
label{display:flex;flex-direction:column;gap:7px;font-weight:700;color:var(--dark)}
input,select{width:100%;border:1px solid #cddcd6;border-radius:10px;padding:11px 12px;font:inherit;background:white;color:var(--ink);outline:none}
input:focus,select:focus{border-color:var(--primary);box-shadow:0 0 0 4px rgba(6,179,106,.12)}
.stack{display:grid;gap:15px}
.table-wrap{overflow:auto}
table{border-collapse:separate;border-spacing:0 8px;width:100%;white-space:nowrap}
.settings-panel{max-width:900px}
.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.settings-note{margin-top:8px;color:var(--muted);font-size:12px}

/* Dashboard refined */
.dashboard-hero{margin-bottom:16px}
.hero-main-card{background:linear-gradient(90deg,var(--dark),var(--dark-2));border-radius:22px;color:#fff;padding:20px 24px;display:flex;align-items:flex-start;justify-content:space-between;gap:18px}
.hero-main-card p{margin:6px 0 0;color:#3ce693;font-size:22px;font-weight:600;line-height:1;max-width:0;overflow:hidden;height:0} /* keep compact visually */
.hero-highlight-grid{display:flex;align-items:stretch;gap:22px;flex-wrap:wrap}
.hero-highlight-card{min-width:245px;border:1px solid rgba(255,255,255,.22);border-radius:14px;padding:10px 16px;background:rgba(255,255,255,.04)}
.hero-highlight-card span,.hero-highlight-percent span{display:block;text-transform:uppercase;font-size:12px;color:rgba(255,255,255,.72);letter-spacing:.3px}
.hero-highlight-card strong{display:block;font-size:34px;line-height:1.1;margin-top:6px}
.hero-highlight-percent{min-width:110px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start}
.hero-highlight-percent strong{font-size:52px;line-height:1;font-weight:900}
.info-strip{display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:12px;background:#eef7f7;border:1px solid #d7e9e9;margin-bottom:18px;color:#194249}
.info-strip p{margin:0}
.dashboard-controls{margin-bottom:14px}
.summary-title-row{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.summary-title-wrap{display:flex;align-items:center;gap:10px}
.summary-icon{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;border:1px solid var(--stroke);background:#fff;color:#223e44;font-size:14px}
.fake-filters{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}
.fake-filters label{gap:6px;font-size:12px;color:var(--muted);font-weight:600}
.fake-filters input{min-width:180px;background:#fff}
.action-btn{padding-inline:18px}
.dashboard-metric-row{display:grid;gap:16px;margin-bottom:18px}
.four-inline{grid-template-columns:repeat(4,minmax(0,1fr))}
.inline-summary-card{background:#fff;border:1px solid var(--stroke);border-radius:16px;padding:14px 16px;display:flex;align-items:center;gap:14px;box-shadow:none}
.icon-box{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;border:1px solid var(--stroke);background:#fff;color:#1f3f45;font-size:18px;flex:none}
.inline-summary-card strong{display:block;font-size:20px;line-height:1.1;color:#000;margin-bottom:4px}
.inline-summary-card span{color:#6d7f82;text-transform:uppercase;font-size:12px;font-weight:700}
.toolbar-row{display:flex;justify-content:space-between;gap:16px;margin-bottom:16px}
.search-fake,.select-fake{background:#fff;border:1px solid var(--stroke);border-radius:12px;height:42px;display:flex;align-items:center;color:#9aa9ac}
.search-fake{padding:0 14px;min-width:340px;flex:1;max-width:420px}
.select-fake{padding:0 14px;min-width:180px;justify-content:space-between}
.refined-table-panel{padding:10px 10px 14px}
.ref-table thead th{background:var(--dark);color:#fff;padding:13px 14px;font-size:13px;font-weight:800;border:0}
.ref-table thead th:first-child{border-radius:12px 0 0 12px}
.ref-table thead th:last-child{border-radius:0 12px 12px 0}
.ref-table tbody td{background:#fff;border-top:1px solid #e7efec;border-bottom:1px solid #e7efec;padding:14px;font-size:14px;color:#263f44}
.ref-table tbody td:first-child{border-left:1px solid #e7efec;border-radius:12px 0 0 12px;font-weight:600}
.ref-table tbody td:last-child{border-right:1px solid #e7efec;border-radius:0 12px 12px 0}
.table-positive{color:var(--success)!important;font-weight:800}

/* Login */
.login-wrap{min-height:100vh;display:grid;place-items:center;padding:28px;background:linear-gradient(180deg,#f7fbf9,#eef4f2)}
.login-shell{width:min(1180px,100%);display:grid;grid-template-columns:minmax(360px,460px) minmax(0,1fr);gap:28px;align-items:stretch}
.login-card{padding:34px;background:var(--surface);border:1px solid var(--stroke);border-radius:24px;box-shadow:0 24px 70px rgba(0,40,45,.08)}
.ref-login-card{display:flex;flex-direction:column;justify-content:center}
.login-logo-centered{text-align:center;margin-bottom:12px}
.login-logo-image{max-width:280px;width:100%;height:auto}
.login-copy h1{font-size:28px;margin:0 0 6px;color:var(--dark)}
.login-card form{display:grid;gap:17px;margin-top:20px}
.login-footer-notes{margin-top:18px}
.error{background:#fff1f1;color:#a12222;padding:12px;border:1px solid #eac4c4;border-radius:10px;margin-bottom:20px}
.ref-login-showcase{display:flex;flex-direction:column;justify-content:space-between;background:linear-gradient(135deg,var(--dark),var(--dark-2));color:#fff;overflow:hidden;border-radius:24px}
.ref-login-showcase h2{font-size:34px;line-height:1.15;margin:8px 0 12px;color:#fff}
.ref-login-showcase .muted{color:rgba(255,255,255,.72)}
.showcase-badge{display:inline-flex;padding:6px 10px;border-radius:999px;background:rgba(6,179,106,.15);color:#73f3ba;font-weight:700;font-size:12px;margin-bottom:10px}
.showcase-metrics{display:grid;grid-template-columns:1.4fr 1fr;gap:16px;margin:22px 0}
.mini-stat{padding:18px 20px;border-radius:16px;background:rgba(255,255,255,.09);border:1px solid rgba(255,255,255,.12)}
.mini-stat.dark{background:rgba(6,179,106,.18);border-color:rgba(6,179,106,.28)}
.mini-stat span{display:block;font-size:12px;letter-spacing:.4px;text-transform:uppercase;color:rgba(255,255,255,.74);margin-bottom:8px}
.mini-stat strong{font-size:32px;line-height:1}
.showcase-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:18px}
.showcase-card{height:122px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.1);border-radius:18px}
.showcase-card.large{height:180px}

/* Admin screens existing */
.inline-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.edit-user{border:1px solid var(--stroke);border-radius:12px;margin:12px 0;padding:12px;background:var(--surface-soft)}
.edit-user summary{cursor:pointer;font-weight:700;color:var(--dark)}
.edit-user form{max-width:600px;margin-top:16px}.permission-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}
.check-line{display:flex;flex-direction:row;align-items:flex-start;font-weight:400;gap:9px;border:1px solid var(--stroke);border-radius:12px;padding:12px;background:var(--surface-soft)}
.check-line input{width:auto;margin:4px 0}.check-line small{display:block;font-size:11px}

/* Settings */
.notice.slim{margin-top:0;margin-bottom:18px}

/* Dark theme */
body.theme-dark{--bg:#08181c;--surface:#0e2429;--surface-soft:#133239;--ink:#edf7f5;--muted:#9eb4b3;--stroke:#204149;--shadow:0 12px 32px rgba(0,0,0,.18);background:var(--bg)}
.theme-dark .sidebar{background:var(--surface)}
.theme-dark .sidebar-quick-card,.theme-dark .sidebar-user-box{background:#102b31;border-color:#27444b}
.theme-dark .quick-card-title,.theme-dark h3{color:#eff9f6}
.theme-dark nav a,.theme-dark nav .nav-disabled{color:#c8d6d4}
.theme-dark nav a.active,.theme-dark nav a:hover{background:#17393f;color:#82efb8}
.theme-dark .nav-icon{background:#143038;border-color:#285059;color:#c9efdf}
.theme-dark .topbar strong,.theme-dark .topbar-sub,.theme-dark .user-chip{color:#dbeeed}
.theme-dark .user-chip{background:#102b31;border-color:#27444b}
.theme-dark .panel,.theme-dark .inline-summary-card,.theme-dark .search-fake,.theme-dark .select-fake,.theme-dark .summary-icon{background:#0e2429;border-color:#274850;color:var(--ink)}
.theme-dark .inline-summary-card strong,.theme-dark .inline-summary-card span,.theme-dark .summary-title-wrap h3{color:var(--ink)}
.theme-dark .search-fake,.theme-dark .select-fake{color:#9cb2b0}
.theme-dark input,.theme-dark select{background:#0f2b31;color:var(--ink);border-color:#2b4f56}
.theme-dark .notice{background:#28311b;border-color:#526634;color:#f0f5d8}
.theme-dark .info-strip{background:#102f34;border-color:#20464c;color:#d6ece9}
.theme-dark .ref-table tbody td{background:#10272c;border-color:#24464d;color:#edf7f5}
.theme-dark .ref-table thead th{background:#03181c}
.theme-dark .edit-user,.theme-dark .check-line{background:#11292e;border-color:#274850}
.theme-dark .login-wrap{background:linear-gradient(180deg,#08181c,#0c2024)}
.theme-dark .login-card{background:var(--surface)}
.theme-dark .ref-login-showcase{background:linear-gradient(135deg,#041417,#0d3137)}

@media(max-width:1180px){.login-shell{grid-template-columns:1fr}.ref-login-showcase{order:2}}
@media(max-width:1100px){.four-inline{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){.hero-main-card,.summary-title-row,.toolbar-row{flex-direction:column;align-items:flex-start}.fake-filters{width:100%}.fake-filters label{flex:1}.fake-filters input{min-width:0;width:100%}.hero-highlight-grid{width:100%}.hero-highlight-card{flex:1}}
@media(max-width:760px){
  .shell{display:block}
  .sidebar{width:100%;padding:12px;border-right:0;border-bottom:1px solid var(--stroke)}
  .sidebar-logo{width:128px}
  .sidebar nav{display:flex;flex-direction:row;flex-wrap:wrap;gap:3px}
  .sidebar nav .nav-disabled,.nav-label,.sidebar-quick-card,.sidebar-user-box{display:none}
  .topbar{padding:12px 16px}.content{padding:0 16px 22px}
  .showcase-metrics,.showcase-grid,.four-inline,.settings-grid{grid-template-columns:1fr}
  .search-fake,.select-fake{max-width:none;width:100%;min-width:0}
}
@media(max-width:420px){.login-logo-image{max-width:220px}}

/* Identidade da empresa no card abaixo da logo CMV Plus */
.sidebar-quick-card{display:flex;align-items:center;gap:10px;min-height:72px;padding:10px}
.company-card-logo{height:50px;width:50px;max-width:50px;flex:0 0 50px;object-fit:contain;background:#fff;border:1px solid var(--stroke);border-radius:12px}
.company-card-placeholder{display:grid;place-items:center;height:50px;width:50px;flex:0 0 50px;border-radius:12px;background:#e8f3ed;font-size:22px}
.company-card-details{flex:1;min-width:0}
.company-card-details .quick-card-title{margin:0 0 3px;overflow-wrap:anywhere;line-height:1.2}
.company-card-details .quick-card-sub{line-height:1.35;overflow-wrap:anywhere}
.company-settings-photo{display:flex;align-items:center;gap:16px;margin:6px 0 14px}
.company-settings-photo img{width:76px;height:76px;object-fit:contain;border:1px solid var(--stroke);border-radius:16px;background:#fff}
.company-settings-photo .company-card-placeholder{width:76px;height:76px;flex-basis:76px;font-size:26px}
.settings-company-title{padding-bottom:4px;border-bottom:1px solid var(--stroke)}
.settings-company-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
@media(max-width:760px){.sidebar nav .nav-disabled,.nav-label,.sidebar-user-box{display:none}.sidebar-quick-card{display:flex}.settings-company-grid{grid-template-columns:1fr}.sidebar-logo{width:190px}}
