
  :root{
    --carvao:#1E1F24;
    --carvao-2:#2B2D33;
    --carvao-3:#3A3C44;
    --laranja:#FF6A2B;
    --laranja-dark:#E2571E;
    --laranja-light:#FFE4D6;
    --rosa:#F03C96;
    --rosa-dark:#D42E82;
    --rosa-light:#FFE1F0;
    --bg:#F4F3F6;
    --card:#FFFFFF;
    --text:#1E1F24;
    --text-2:#4B4D55;
    --gray:#8A8C94;
    --line:#E9E8EC;
    --green:#1FAE6E;
    --green-light:#E3F8EF;
    --shadow: 0 1px 2px rgba(30,31,36,0.04), 0 8px 24px -12px rgba(30,31,36,0.12);
    --radius: 16px;
  }
  *{box-sizing:border-box; margin:0; padding:0;}
  body{
    font-family:'Plus Jakarta Sans', sans-serif;
    background:var(--bg);
    color:var(--text);
    min-height:100vh;
    overflow-x:hidden;
  }
  ::selection{ background: var(--laranja-light); }
  .mono{ font-family:'DM Mono', monospace; }
  button{ font-family:inherit; cursor:pointer; border:none; }
  input, select, textarea{ font-family:inherit; }
  a{ color:inherit; text-decoration:none; }

  /* ========== LOGIN ========== */
  #login-screen{
    min-height:100vh;
    display:grid;
    grid-template-columns: 1.05fr 1fr;
  }
  @media (max-width: 900px){ #login-screen{ grid-template-columns: 1fr; } .login-visual{ display:none; } }

  .login-visual{
    background:
      radial-gradient(circle at 20% 15%, rgba(255,106,43,0.35), transparent 45%),
      radial-gradient(circle at 85% 80%, rgba(240,60,150,0.35), transparent 45%),
      var(--carvao);
    color:#fff;
    display:flex;
    flex-direction:column;
    padding:56px;
    position:relative;
    overflow:hidden;
  }
  .login-visual::before{
    content:"";
    position:absolute; inset:0;
    background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 42px 42px;
    -webkit-mask-image: radial-gradient(circle at 50% 40%, black, transparent 70%);
            mask-image: radial-gradient(circle at 50% 40%, black, transparent 70%);
  }
  .brand-mark{ display:flex; align-items:center; gap:12px; position:relative; z-index:1; flex-shrink:0; }
  .brand-mark .logo-box{
    width:40px; height:40px; border-radius:12px;
    background:linear-gradient(135deg, var(--laranja), var(--rosa));
    display:flex; align-items:center; justify-content:center;
    font-weight:800; font-size:18px;
  }
  .brand-mark span{ font-weight:800; font-size:20px; letter-spacing:0.5px; }

  .login-copy{
    position:relative; z-index:1; max-width:460px;
    flex:1;
    display:flex;
    flex-direction:column;
    justify-content:center;
  }
  .login-copy .eyebrow{
    display:inline-flex; align-items:center; gap:8px;
    background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.15);
    padding:6px 14px; border-radius:100px; font-size:12px; font-weight:600;
    color:var(--laranja-light); margin-bottom:22px; letter-spacing:0.3px;
  }
  .login-copy h1{ font-size:38px; line-height:1.15; font-weight:800; margin-bottom:16px; }
  .login-copy h1 em{ font-style:normal; background:linear-gradient(135deg, var(--laranja), var(--rosa)); -webkit-background-clip:text; background-clip:text; color:transparent; }
  .login-copy p{ color:#C9C9D2; font-size:15px; line-height:1.6; }

  .login-stats{ display:flex; gap:36px; position:relative; z-index:1; }
  .login-stats div b{ display:block; font-size:24px; font-weight:800; }
  .login-stats div span{ font-size:12px; color:#A6A6B0; }

  .login-form-panel{
    display:flex; align-items:center; justify-content:center; padding:40px;
  }
  .login-form{ width:100%; max-width:380px; }
  .login-form h2{ font-size:24px; font-weight:800; margin-bottom:6px; }
  .login-form > p.sub{ color:var(--gray); font-size:14px; margin-bottom:28px; }

  .role-toggle{
    display:flex; background:var(--bg); border:1px solid var(--line); border-radius:12px; padding:4px; margin-bottom:22px;
  }
  .role-toggle button{
    flex:1; padding:10px 12px; border-radius:9px; background:transparent; font-weight:700; font-size:13px; color:var(--gray);
    transition: all .15s ease;
  }
  .role-toggle button.active{ background:var(--carvao); color:#fff; box-shadow:var(--shadow); }

  .field{ margin-bottom:16px; }
  .field label{ display:block; font-size:12px; font-weight:700; color:var(--text-2); margin-bottom:6px; }
  .field input{
    width:100%; padding:12px 14px; border-radius:10px; border:1.5px solid var(--line); background:#fff;
    font-size:14px; color:var(--text); transition:border-color .15s ease;
  }
  .field input:focus{ outline:none; border-color:var(--laranja); }

  .btn-primary{
    width:100%; padding:13px; border-radius:12px; border:none;
    background:linear-gradient(135deg, var(--laranja), var(--rosa)); color:#fff; font-weight:700; font-size:14px;
    box-shadow:0 10px 20px -8px rgba(240,60,150,0.45);
    transition: transform .12s ease, box-shadow .12s ease;
  }
  .btn-primary:hover{ transform:translateY(-1px); box-shadow:0 14px 24px -8px rgba(240,60,150,0.55); }
  .btn-primary:active{ transform:translateY(0); }
  .btn-primary:focus-visible{ outline:2px solid var(--carvao); outline-offset:2px; }

  .divider-text{
    display:flex; align-items:center; gap:12px; color:var(--gray); font-size:12px; margin:20px 0;
  }
  .divider-text::before, .divider-text::after{ content:""; flex:1; height:1px; background:var(--line); }

  .quick-row{ display:flex; gap:10px; }
  .btn-quick{
    flex:1; padding:11px; border-radius:10px; border:1.5px solid var(--line); background:#fff; font-weight:700; font-size:12.5px;
    display:flex; align-items:center; justify-content:center; gap:6px; color:var(--text);
    transition: border-color .15s ease, background .15s ease;
  }
  .btn-quick:hover{ border-color:var(--carvao); background:var(--bg); }
  .btn-quick:focus-visible{ outline:2px solid var(--carvao); outline-offset:2px; }

  .login-foot{ margin-top:26px; font-size:12px; color:var(--gray); text-align:center; }
  .login-error{
    display:none; background:var(--rosa-light); color:var(--rosa-dark); border-radius:10px; padding:10px 12px;
    font-size:12.5px; font-weight:600; margin-bottom:16px;
  }

  #first-access-screen{
    display:none; min-height:100vh; align-items:center; justify-content:center; background:var(--bg); padding:20px;
  }
  #first-access-screen.show{ display:flex; }

  /* ========== APP SHELL ========== */
  #app{ display:none; min-height:100vh; }
  .shell{ display:grid; grid-template-columns: 240px 1fr; min-height:100vh; }
  @media (max-width: 860px){ .shell{ grid-template-columns: 1fr; } .sidebar{ display:none; } }

  .sidebar{
    background:var(--carvao); color:#fff; padding:26px 16px; display:flex; flex-direction:column;
    position:sticky; top:0; height:100vh;
  }
  .sidebar .brand-mark{ padding:0 10px; margin-bottom:8px; }
  .sidebar .role-pill{
    margin:14px 10px 22px; padding:8px 12px; border-radius:10px; background:var(--carvao-2);
    font-size:11px; font-weight:700; color:#B9BAC2; display:flex; align-items:center; gap:8px;
  }
  .sidebar .role-pill .dot{ width:7px; height:7px; border-radius:50%; background:var(--laranja); }
  .nav-item{
    display:flex; align-items:center; gap:12px; padding:11px 14px; border-radius:11px; margin-bottom:4px;
    color:#AEAFB8; font-weight:600; font-size:14px; background:transparent; width:100%; text-align:left;
    transition: background .15s ease, color .15s ease;
  }
  .nav-item svg{ width:18px; height:18px; flex-shrink:0; opacity:.85; }
  .nav-item:hover{ background:var(--carvao-2); color:#fff; }
  .nav-item.active{ background:linear-gradient(135deg, var(--laranja), var(--rosa)); color:#fff; }
  .nav-item:focus-visible{ outline:2px solid var(--laranja); outline-offset:2px; }
  .nav-spacer{ flex:1; }
  .sidebar-foot{
    background:var(--carvao-2); border-radius:14px; padding:14px; display:flex; align-items:center; gap:10px; margin-top:10px;
  }
  .sidebar-foot .av{ width:34px; height:34px; border-radius:9px; background:var(--rosa); display:flex; align-items:center; justify-content:center; font-weight:800; font-size:13px; }
  .sidebar-foot .who{ flex:1; min-width:0; }
  .sidebar-foot .who b{ display:block; font-size:12.5px; font-weight:700; }
  .sidebar-foot .who span{ font-size:11px; color:#9B9CA6; }
  .logout-btn{ background:transparent; color:#9B9CA6; padding:6px; border-radius:8px; }
  .logout-btn:hover{ color:#fff; background:rgba(255,255,255,0.08); }

  .main{ padding:28px 34px; max-width:1400px; }
  .topbar{ display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:26px; gap:20px; flex-wrap:wrap; }
  .topbar h1{ font-size:26px; font-weight:800; }
  .topbar .sub{ color:var(--gray); font-size:13.5px; margin-top:4px; }
  .topbar-right{ display:flex; align-items:center; gap:12px; }

  .bell-wrap{ position:relative; }
  .bell-btn{
    width:42px; height:42px; border-radius:12px; background:var(--card); border:1px solid var(--line);
    display:flex; align-items:center; justify-content:center; position:relative;
  }
  .bell-btn:focus-visible{ outline:2px solid var(--carvao); outline-offset:2px; }
  .bell-btn svg{ width:19px; height:19px; color:var(--carvao); }
  .bell-badge{
    position:absolute; top:-4px; right:-4px; background:var(--rosa); color:#fff; font-size:10px; font-weight:800;
    min-width:18px; height:18px; border-radius:50%; display:flex; align-items:center; justify-content:center; border:2px solid var(--bg);
  }
  .notif-panel{
    display:none; position:absolute; right:0; top:52px; width:340px; background:var(--card); border-radius:14px;
    box-shadow:var(--shadow); border:1px solid var(--line); overflow:hidden; z-index:40;
  }
  .notif-panel.open{ display:block; }
  .notif-panel .np-head{ padding:14px 16px; font-weight:800; font-size:13.5px; border-bottom:1px solid var(--line); }
  .notif-item{ padding:13px 16px; border-bottom:1px solid var(--line); display:flex; gap:10px; }
  .notif-item:last-child{ border-bottom:none; }
  .notif-dot{ width:8px; height:8px; border-radius:50%; margin-top:6px; flex-shrink:0; background:var(--laranja); }
  .notif-item p{ font-size:12.5px; color:var(--text); font-weight:600; line-height:1.4; }
  .notif-item span{ font-size:11px; color:var(--gray); }

  .avatar-btn{ width:42px; height:42px; border-radius:12px; background:var(--rosa); color:#fff; font-weight:800; display:flex; align-items:center; justify-content:center; font-size:13px; }

  /* Cards / grid utilities */
  .grid{ display:grid; gap:18px; }
  .g4{ grid-template-columns:repeat(4,1fr); }
  .g3{ grid-template-columns:repeat(3,1fr); }
  .g2{ grid-template-columns:2fr 1fr; }
  @media (max-width:1100px){ .g4{grid-template-columns:repeat(2,1fr);} .g3{grid-template-columns:1fr;} .g2{grid-template-columns:1fr;} }

  .card{ background:var(--card); border-radius:var(--radius); padding:22px; box-shadow:var(--shadow); }
  .card-head{ display:flex; align-items:center; gap:10px; margin-bottom:16px; }
  .card-head .bar{ width:5px; height:16px; border-radius:3px; background:var(--laranja); }
  .card-head h3{ font-size:15px; font-weight:800; }

  .kpi{ position:relative; padding-left:24px; }
  .kpi::before{ content:""; position:absolute; left:0; top:0; bottom:0; width:5px; border-radius:4px; background:var(--laranja); }
  .kpi.pink::before{ background:var(--rosa); }
  .kpi label{ display:block; font-size:12px; font-weight:700; color:var(--gray); margin-bottom:8px; }
  .kpi .val{ font-size:25px; font-weight:800; margin-bottom:8px; }
  .kpi .delta{ font-size:12px; font-weight:700; }
  .delta.up{ color:var(--green); }
  .delta.down{ color:var(--rosa); }

  table{ width:100%; border-collapse:collapse; }
  thead th{ text-align:left; font-size:11.5px; color:var(--gray); font-weight:700; padding:8px 12px; background:#FAFAFB; border-radius:8px; }
  tbody td{ padding:12px; font-size:13px; border-bottom:1px solid var(--line); color:var(--text-2); }
  tbody tr:last-child td{ border-bottom:none; }
  tbody td b{ color:var(--text); }

  .badge{ display:inline-flex; align-items:center; padding:4px 11px; border-radius:100px; font-size:11px; font-weight:800; color:#fff; }
  .b-green{ background:var(--green); }
  .b-laranja{ background:var(--laranja); }
  .b-rosa{ background:var(--rosa); }
  .b-carvao{ background:var(--carvao-3); }
  .b-danger{ background:#C0392B; }

  .bars{ display:flex; align-items:flex-end; gap:14px; height:180px; padding-top:10px; }
  .bars .col{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; gap:8px; }
  .bars .col .b{ width:100%; border-radius:8px 8px 4px 4px; transition:height .5s ease; }
  .bars .col span{ font-size:11px; color:var(--gray); font-weight:600; }

  .donut{ width:150px; height:150px; border-radius:50%; margin:0 auto; display:flex; align-items:center; justify-content:center; position:relative; }
  .donut .hole{ width:82px; height:82px; background:var(--card); border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:19px; }
  .legend{ display:flex; flex-direction:column; gap:8px; margin-top:16px; }
  .legend div{ display:flex; align-items:center; gap:8px; font-size:12px; color:var(--text-2); font-weight:600; }
  .legend .sq{ width:11px; height:11px; border-radius:3px; }

  .priobar{ margin-bottom:14px; }
  .priobar .lbl{ display:flex; justify-content:space-between; font-size:12px; font-weight:700; margin-bottom:6px; }
  .priobar .track{ height:9px; border-radius:6px; background:var(--line); overflow:hidden; }
  .priobar .fill{ height:100%; border-radius:6px; }

  .btn-mini{ padding:9px 16px; border-radius:10px; font-weight:700; font-size:12.5px; }
  .btn-mini.solid{ background:var(--laranja); color:#fff; }
  .btn-mini.solid:hover{ background:var(--laranja-dark); }
  .btn-mini.ghost{ background:var(--bg); border:1px solid var(--line); color:var(--text-2); }
  .btn-mini:focus-visible{ outline:2px solid var(--carvao); outline-offset:2px; }

  /* Personalização */
  .swatches{ display:flex; gap:12px; flex-wrap:wrap; }
  .swatch{ width:34px; height:34px; border-radius:50%; border:3px solid transparent; cursor:pointer; transition:transform .1s ease; }
  .swatch:hover{ transform:scale(1.08); }
  .swatch.selected{ border-color:var(--carvao); }
  .logo-upload{
    width:96px; height:96px; border-radius:16px; border:2px dashed var(--line); background:var(--bg);
    display:flex; align-items:center; justify-content:center; font-weight:800; color:var(--gray); font-size:13px; flex-shrink:0;
  }
  select.select-input, input.text-input{
    width:100%; padding:11px 14px; border-radius:10px; border:1.5px solid var(--line); background:#fff; font-size:13.5px; color:var(--text);
  }
  select.select-input:focus, input.text-input:focus{ outline:none; border-color:var(--laranja); }
  .preview-frame{ border:1px solid var(--line); border-radius:14px; overflow:hidden; background:var(--bg); }
  .preview-topbar{ display:flex; }
  .preview-side{ width:130px; padding:16px 10px; color:#fff; }
  .preview-main{ flex:1; padding:16px; }

  /* Client portal specifics */
  .hero-cta{
    border-radius:16px; padding:26px; color:#fff; display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap;
    background:linear-gradient(135deg, var(--laranja), var(--rosa));
  }
  .hero-cta h2{ font-size:19px; font-weight:800; margin-bottom:6px; }
  .hero-cta p{ font-size:13px; opacity:0.92; }
  .hero-cta button{ background:#fff; color:var(--laranja-dark); padding:12px 20px; border-radius:12px; font-weight:800; font-size:13.5px; white-space:nowrap; }
  .hero-cta button:hover{ transform:translateY(-1px); }

  .update-strip{ background:var(--rosa-light); color:var(--rosa-dark); border-radius:12px; padding:13px 16px; display:flex; align-items:center; gap:10px; font-size:12.5px; font-weight:700; margin:18px 0; }

  .ticket-tabs{ display:flex; gap:8px; margin-bottom:16px; }
  .ticket-tab{ padding:9px 16px; border-radius:10px; font-weight:700; font-size:13px; background:var(--bg); color:var(--text-2); }
  .ticket-tab.active{ background:var(--carvao); color:#fff; }

  .ticket-card{
    background:var(--bg); border:1px solid var(--line); border-radius:12px; padding:14px 16px; margin-bottom:10px;
    display:flex; align-items:center; justify-content:space-between; gap:12px;
  }
  .ticket-card .t-title{ font-weight:700; font-size:13.5px; margin-bottom:3px; }
  .ticket-card .t-meta{ font-size:11.5px; color:var(--gray); }

  .form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
  @media (max-width:700px){ .form-grid{ grid-template-columns:1fr; } }
  .field-l label{ display:block; font-size:12px; font-weight:700; color:var(--text-2); margin-bottom:7px; }
  textarea.text-input{ resize:vertical; min-height:110px; font-family:inherit; width:100%; box-sizing:border-box; }

  .toast{
    position:fixed; bottom:26px; right:26px; background:var(--carvao); color:#fff; padding:14px 20px; border-radius:12px;
    font-size:13px; font-weight:700; box-shadow:var(--shadow); display:flex; align-items:center; gap:10px;
    transform:translateY(20px); opacity:0; pointer-events:none; transition:all .25s ease; z-index:100;
  }
  .toast.show{ transform:translateY(0); opacity:1; }
  .toast .tdot{ width:8px; height:8px; border-radius:50%; background:var(--green); }

  .empty-note{ color:var(--gray); font-size:13px; padding:20px 4px; }

  /* ---- Sidebar submenu ---- */
  .nav-group{ margin-bottom:4px; }
  .nav-item .chev{ margin-left:auto; width:14px; height:14px; opacity:.75; transition:transform .2s ease; flex-shrink:0; }
  .nav-item .chev.open{ transform:rotate(180deg); }
  .nav-submenu{ max-height:0; overflow:hidden; transition:max-height .25s ease; }
  .nav-submenu.open{ max-height:260px; }
  .nav-subitem{
    display:flex; align-items:center; width:100%; text-align:left; padding:9px 14px 9px 36px;
    border-radius:9px; background:transparent; color:#9B9CA6; font-size:13px; font-weight:600;
    margin:2px 0; position:relative; transition:background .15s ease, color .15s ease;
  }
  .nav-subitem::before{ content:""; position:absolute; left:20px; width:5px; height:5px; border-radius:50%; background:#5A5B63; }
  .nav-subitem:hover{ background:var(--carvao-2); color:#fff; }
  .nav-subitem.active{ background:var(--carvao-2); color:#fff; }
  .nav-subitem.active::before{ background:var(--laranja); }
  .nav-subitem:focus-visible{ outline:2px solid var(--laranja); outline-offset:1px; }

  /* ---- Modal ---- */
  .modal-overlay{ display:none; position:fixed; inset:0; background:rgba(30,31,36,0.55); z-index:80; align-items:center; justify-content:center; padding:20px; }
  .modal-overlay.open{ display:flex; }
  .modal-box{ background:var(--card); border-radius:18px; max-width:560px; width:100%; padding:26px; max-height:88vh; overflow-y:auto; box-shadow:var(--shadow); position:relative; }
  .modal-box h3{ font-size:18px; font-weight:800; margin-bottom:4px; padding-right:36px; }
  .modal-box .m-sub{ color:var(--gray); font-size:12.5px; margin-bottom:18px; }
  .modal-close{ position:absolute; top:20px; right:20px; background:var(--bg); width:32px; height:32px; border-radius:9px; display:flex; align-items:center; justify-content:center; color:var(--text-2); }
  .modal-close:hover{ background:var(--line); }
  .kv-row{ display:flex; justify-content:space-between; gap:14px; padding:9px 0; border-bottom:1px solid var(--line); font-size:13px; }
  .kv-row span:first-child{ color:var(--gray); font-weight:600; }
  .kv-row span:last-child{ font-weight:700; text-align:right; }
  .history-item{ background:var(--bg); border-radius:10px; padding:10px 12px; font-size:12px; margin-bottom:8px; color:var(--text-2); }
  .history-item.interno{ background:#FFF7E0; border:1px solid #F0D889; }
  .history-item .interno-tag{ display:inline-block; font-size:10px; font-weight:800; color:#8A6D00; background:#FFEBB0; padding:2px 7px; border-radius:100px; margin-bottom:5px; }
  tr.row-atrasado{ background:var(--rosa-light); }
  tr.row-atrasado td{ border-color:#F8C6DE; }
  .link-btn{ background:none; border:none; padding:0; color:var(--laranja); font-weight:700; font-size:11.5px; cursor:pointer; text-decoration:underline; }
  .link-btn:hover{ color:var(--laranja-dark); }

  /* ---- Status select in tables ---- */
  .status-select{ padding:7px 10px; border-radius:8px; border:1.5px solid var(--line); font-size:11.5px; font-weight:700; background:#fff; color:var(--text); }
  .status-select:focus{ outline:none; border-color:var(--laranja); }

  /* ---- Stage progress (orçamentos) ---- */
  .stage-track{ height:7px; border-radius:5px; background:var(--line); overflow:hidden; margin-top:6px; width:120px; }
  .stage-fill{ height:100%; border-radius:5px; transition:width .3s ease; }

  /* ---- Client / cadastro rows ---- */
  .client-row{
    display:flex; align-items:center; gap:14px; padding:14px; border:1px solid var(--line); border-radius:12px; margin-bottom:10px;
  }
  .client-row .c-logo{ width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-size:15px; flex-shrink:0; }
  .client-row .c-info{ flex:1; min-width:0; }
  .client-row .c-info b{ font-size:13.5px; display:block; }
  .client-row .c-info span{ font-size:11.5px; color:var(--gray); }
  .swatch-mini{ width:14px; height:14px; border-radius:4px; display:inline-block; border:1px solid rgba(0,0,0,0.08); }
  .form-actions{ display:flex; gap:10px; margin-top:4px; }

  /* ---- React version additions ---- */
  .row-actions{ display:flex; gap:8px; }
  .icon-btn-sm{ padding:7px 12px; border-radius:8px; font-weight:700; font-size:11.5px; }
  .icon-btn-sm.danger{ background:var(--rosa-light); color:var(--rosa-dark); }
  .icon-btn-sm.danger:hover{ background:var(--rosa); color:#fff; }
  .icon-btn-sm.ghost{ background:var(--bg); color:var(--text-2); border:1px solid var(--line); }
  .icon-btn-sm.ghost:hover{ background:var(--line); }
  .notif-item.unread{ background:var(--bg); }
  .notif-item .notif-dot.read{ background:var(--line) !important; }
  textarea.text-input.wide{ min-height:170px; }
  .card.wide-form{ max-width:900px; }
  .empty-note-sm{ color:var(--gray); font-size:12px; padding:10px 4px; }
  .modal-box{ max-width:640px; }
