
    :root{
      --bg: #f5f7fb;
      --card: #ffffff;
      --text: #0f172a;
      --muted: #64748b;
      --primary: #2563eb;
      --primary-2: #1d4ed8;
      --border: #e2e8f0;
      --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
      --radius: 14px;
    }

    *{ box-sizing: border-box; }
    body{
      margin: 0;
      font-family: Arial, sans-serif;
      background: var(--bg);
      color: var(--text);
    }
    body.auth-page{
      min-height: 100vh;
      background:
        radial-gradient(circle at top left, rgba(37,99,235,0.16), transparent 35%),
        linear-gradient(135deg, #dbeafe 0%, #eff6ff 45%, #f8fafc 100%);
    }

    .app{ display: flex; min-height: 100vh; }

    .sidebar{
      width: 280px;
      background: #0b1220;
      color: #e5e7eb;
      padding: 18px 14px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      border-right: 1px solid rgba(255,255,255,0.06);
    }

    .brand{
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: var(--radius);
      padding: 14px 12px;
    }
    .brand h1{ margin: 0; font-size: 16px; letter-spacing: 0.2px; }
    .brand p{
      margin: 6px 0 0 0;
      font-size: 12px;
      color: rgba(229,231,235,0.75);
      line-height: 1.35;
    }

    .section-title{
      margin: 8px 8px 2px 8px;
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: rgba(229,231,235,0.65);
    }

    .nav{ display: flex; flex-direction: column; gap: 8px; }

    .nav button{
      width: 100%;
      text-align: left;
      background: rgba(255,255,255,0.05);
      color: #e5e7eb;
      border: 1px solid rgba(255,255,255,0.08);
      padding: 12px 12px;
      border-radius: 12px;
      cursor: pointer;
      font-size: 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      transition: 0.15s ease;
    }

    .nav button:hover{
      background: rgba(37,99,235,0.18);
      border-color: rgba(37,99,235,0.35);
    }

    .nav button.active{
      background: rgba(37,99,235,0.28);
      border-color: rgba(37,99,235,0.55);
      box-shadow: 0 10px 25px rgba(37,99,235,0.12);
    }

    .nav small{ color: rgba(229,231,235,0.65); font-size: 12px; }

    .main{
      flex: 1;
      padding: 22px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .topbar{
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 16px 18px;
      box-shadow: var(--shadow);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .topbar .title{ display: flex; flex-direction: column; gap: 4px; }
    .topbar h2{ margin: 0; font-size: 18px; }
    .topbar p{ margin: 0; color: var(--muted); font-size: 13px; }
    .topbar-actions{
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .content{
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 18px;
      box-shadow: var(--shadow);
    }

    .grid{
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-top: 14px;
    }

    label{
      font-size: 12px;
      color: var(--muted);
      display: block;
      margin-bottom: 6px;
    }

    input, select, textarea{
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 11px 12px;
      font-size: 14px;
      outline: none;
      background: #fff;
    }

    textarea{ min-height: 90px; resize: vertical; }

    .actions{
      display: flex;
      gap: 10px;
      margin-top: 16px;
      flex-wrap: wrap;
      align-items: center;
    }

    .btn{
      border: 0;
      border-radius: 12px;
      padding: 11px 14px;
      font-size: 14px;
      cursor: pointer;
      transition: 0.15s ease;
      white-space: nowrap;
    }
    .btn-primary{ background: var(--primary); color: #fff; }
    .btn-primary:hover{ background: var(--primary-2); }
    .btn-ghost{ background: #eef2ff; color: #1e40af; }
    .btn-ghost:hover{ filter: brightness(0.97); }

    .pill{
      padding: 7px 10px;
      border-radius: 999px;
      font-size: 12px;
      border: 1px solid var(--border);
      color: var(--muted);
      background: #f8fafc;
    }

    .hint{
      margin-top: 10px;
      padding: 12px;
      border-radius: 12px;
      background: #f1f5f9;
      border: 1px dashed #cbd5e1;
      color: #334155;
      font-size: 13px;
      line-height: 1.35;
    }

    .muted{ color: var(--muted); }
    .auth-shell{
      min-height: 100vh;
      display: grid;
      place-items: center;
      padding: 24px;
    }
    .auth-card{
      width: min(440px, 100%);
      background: rgba(255,255,255,0.96);
      border: 1px solid rgba(226,232,240,0.95);
      border-radius: 22px;
      box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
      padding: 28px;
    }
    .auth-brand h1{
      margin: 0;
      font-size: 28px;
    }
    .auth-brand p{
      margin: 8px 0 0 0;
      color: var(--muted);
      font-size: 14px;
    }
    .auth-form{
      display: grid;
      gap: 14px;
      margin-top: 22px;
    }
    .auth-submit{
      width: 100%;
      margin-top: 4px;
    }
    .auth-error{
      border: 1px solid #fecaca;
      background: #fef2f2;
      color: #b91c1c;
      padding: 12px;
      border-radius: 12px;
      font-size: 14px;
    }

    /* ===== MODAL (HistÃ³rico) ===== */
    .modal-backdrop{
      position: fixed;
      inset: 0;
      background: rgba(15,23,42,0.55);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 18px;
      z-index: 9999;
    }
    .modal{
      width: min(760px, 100%);
      background: #fff;
      border-radius: 16px;
      border: 1px solid var(--border);
      box-shadow: 0 20px 60px rgba(0,0,0,0.25);
      overflow: hidden;
    }
    .modal-header{
      padding: 14px 16px;
      background: #f8fafc;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }
    .modal-header h3{
      margin: 0;
      font-size: 16px;
    }
    .modal-body{
      padding: 16px;
      max-height: 70vh;
      overflow: auto;
    }
    .modal-footer{
      padding: 12px 16px;
      border-top: 1px solid var(--border);
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      background: #fff;
    }
    .history-card{
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 12px;
      background: #fff;
      margin-bottom: 10px;
    }
    .history-row{
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 10px;
      margin-bottom: 8px;
      color: #0f172a;
      font-size: 13px;
    }
    .history-row div span{
      display:block;
      color: var(--muted);
      font-size: 12px;
      margin-bottom: 2px;
    }
    .history-motivo{
      margin: 0;
      color: #0f172a;
      font-size: 14px;
      line-height: 1.35;
    }

    @media (max-width: 980px){
      .sidebar{ width: 240px; }
      .grid{ grid-template-columns: 1fr; }
      .history-row{ grid-template-columns: 1fr; }
    }
    @media (max-width: 760px){
      .app{ flex-direction: column; }
      .sidebar{ width: 100%; }
      .main{ padding: 14px; }
      .auth-card{ padding: 22px; }
    }
  
    /* ===== TABELA COM CABEÃ‡ALHO CONGELADO ===== */
    .sticky-table thead th{
      position: sticky !important;
      top: 0;
      background: #f8fafc !important;
      z-index: 10;
      position: sticky;
      top: 0;
      z-index: 5;
      background: #f8fafc;
    }
