
  :root{
    --bg: #0B1420;
    --surface: #101C2B;
    --surface-2: #16273A;
    --border: #22374B;
    --text: #E7EEF4;
    --text-dim: #7E93A7;
    --text-faint: #506679;
    --signal: #33D6B0;
    --signal-dim: #1E4A42;
    --credit: #E7B24C;
    --credit-dim: #4A3D22;
    --tier: #9086E0;
    --danger: #E15B5B;
    --danger-dim: #4A2424;
    --radius-sm: 5px;
    --radius-md: 8px;
  }
  *{box-sizing:border-box; margin:0; padding:0;}
  a{ text-decoration:none; color:inherit; }
  body{
    background: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
  }
  .mono{ font-family: 'IBM Plex Mono', monospace; }

  /* ---------- LOGIN VIEW ---------- */
  #login-view{
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
      radial-gradient(ellipse 900px 500px at 50% -10%, rgba(51,214,176,0.08), transparent),
      var(--bg);
    position: relative;
    overflow: hidden;
  }
  .signal-lines{
    position: absolute; inset: 0;
    background-image: repeating-linear-gradient(180deg, transparent, transparent 39px, rgba(51,214,176,0.035) 40px);
    pointer-events: none;
  }
  .login-box{
    width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 40px 36px 32px;
    position: relative;
    z-index: 1;
  }
  .login-mark{
    display:flex; align-items:center; justify-content:center; gap:10px; margin-bottom: 28px;
  }
  .login-mark .dot{
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 0 4px var(--signal-dim);
  }
  .login-mark span{
    font-weight: 600; font-size: 15px; letter-spacing: 0.2px;
  }
  .login-box h1{
    font-size: 20px; font-weight: 600; margin-bottom: 6px;
  }
  .login-box p.sub{
    color: var(--text-dim); font-size: 13px; margin-bottom: 26px;
  }
  .field{ margin-bottom: 16px; }
  .field label{
    display:block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px;
  }
  .field label.access-row{ display:flex; margin-bottom:0; }
  .field input{
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
  }
  .field input:focus{ outline: none; border-color: var(--signal); }
  .btn-primary{
    width: 100%;
    background: var(--signal);
    color: #06231D;
    border: none;
    border-radius: var(--radius-sm);
    padding: 11px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    margin-top: 6px;
  }
  .btn-primary:hover{ filter: brightness(1.08); }
  .login-foot{
    margin-top: 22px; text-align:center; font-size: 12px; color: var(--text-faint);
  }

  /* ---------- APP SHELL ---------- */
  #app-view{ display:none; min-height: 100vh; }

  .hamburger{
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
    cursor:pointer; padding:8px 9px;
    display:flex; flex-direction:column; gap:4px; justify-content:center;
    flex-shrink: 0;
  }
  .hamburger span{ width:14px; height:2px; background: var(--text-dim); border-radius:2px; }
  .hamburger:hover span{ background: var(--text); }
  .sidebar-brand{ display:flex; align-items:center; justify-content:center; gap:9px; padding: 18px 8px 24px; flex-shrink:0; min-height:104px; }
  .sidebar-brand .dot{ width:10px; height:10px; border-radius:50%; background: var(--signal); box-shadow: 0 0 0 3px var(--signal-dim); flex-shrink:0; }
  .sidebar-brand span{ font-weight:600; font-size:14.5px; white-space:nowrap; }
  .shell.collapsed .sidebar-brand span{ display:none; }

  .util-bar{
    display:flex; align-items:center; justify-content:space-between;
    background: var(--surface); border-bottom: 1px solid var(--border);
    margin: -26px -32px 22px; padding: 12px 32px;
    position: sticky; top: 0; z-index: 20;
  }
  .topnav-right{ display:flex; align-items:center; gap:12px; }
  .icon-btn{
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
    width: 34px; height: 34px; border-radius: 50%; cursor:pointer; font-size: 14px;
    display:flex; align-items:center; justify-content:center;
  }
  .icon-btn:hover{ color: var(--text); border-color: var(--signal); }
  .topnav-avatar{ cursor:pointer; }

  .breadcrumb{
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 8px 14px;
    font-size: 12px; color: var(--text-faint); font-family: 'IBM Plex Mono', monospace;
  }
  .breadcrumb span{ margin: 0 4px; color: var(--text-faint); opacity: 0.5; }
  .credit-pill.sm{ padding: 6px 14px; }

  .alert-banner{
    display:flex; align-items:center; gap:10px;
    border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 12px;
    font-size: 13px; color: #fff;
  }
  .alert-banner.info{ background: #4550C9; }
  .alert-banner.success{ background: #1E9E5A; }
  .alert-ico{ flex-shrink:0; opacity:0.9; }
  .alert-banner span:nth-child(2){ flex:1; }
  .alert-close{
    background:none; border:none; color:rgba(255,255,255,0.7); cursor:pointer; font-size:13px;
    flex-shrink:0;
  }
  .alert-close:hover{ color:#fff; }

  .shell{ display: grid; grid-template-columns: 220px 1fr; align-items: start; transition: grid-template-columns 0.18s ease; }
  .shell.collapsed{ grid-template-columns: 64px 1fr; }

  .sidebar{
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 16px 14px;
    display:flex; flex-direction:column;
    transition: padding 0.18s ease;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }
  .sidebar::-webkit-scrollbar{ width: 6px; }
  .sidebar::-webkit-scrollbar-thumb{ background: var(--border); border-radius: 4px; }
  .shell.collapsed .sidebar{ padding: 16px 8px; }
  .shell.collapsed .nav-group-label span:first-child,
  .shell.collapsed .chev,
  .shell.collapsed .nav-item-inner span,
  .shell.collapsed .nav-count,
  .shell.collapsed .user-chip div:not(.avatar){ display:none; }
  .shell.collapsed .nav-item-inner{ justify-content:center; }
  .shell.collapsed .nav-item{ justify-content:center; }

  .nav-group-label{
    display:flex; align-items:center; justify-content:space-between;
    font-size: 10.5px; color: var(--text-faint); padding: 16px 10px 8px;
    letter-spacing: 0.3px; cursor:pointer; user-select:none;
    flex-shrink: 0;
  }
  .nav-group-label:hover{ color: var(--text-dim); }
  .nav-group-label .chev{ font-size:11px; transition: transform 0.15s ease; }
  .nav-group-label.closed .chev{ transform: rotate(-90deg); }
  .nav-group{ overflow:hidden; max-height: 400px; transition: max-height 0.18s ease; flex-shrink: 0; }
  .nav-group.closed{ max-height: 0; }
  .nav-item{
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding: 10px 10px; border-radius: var(--radius-sm);
    color: var(--text-dim); font-size: 13px; cursor:pointer; margin-bottom: 3px;
    flex-shrink: 0;
  }
  .nav-item:hover{ background: var(--surface-2); color: var(--text); }
  .nav-item.active{ background: var(--surface-2); color: var(--text); }
  .nav-item.active .nav-ico{ background: var(--signal); }
  .nav-ico{ width:6px; height:6px; border-radius:50%; background: var(--text-faint); flex-shrink:0; }
  .nav-item-inner{ display:flex; align-items:center; gap:9px; }
  .nav-count{ font-family:'IBM Plex Mono',monospace; font-size:11px; color: var(--text-faint); }

  .sidebar-foot{
    margin-top: auto; padding-top: 20px; border-top: 1px solid var(--border);
    flex-shrink: 0;
  }
  .user-chip{ display:flex; align-items:center; gap:9px; padding: 8px 10px; }
  .avatar{
    width: 28px; height:28px; border-radius: 50%;
    background: var(--surface-2); border: 1px solid var(--border);
    display:flex; align-items:center; justify-content:center;
    font-size: 11px; font-weight: 600; color: var(--text-dim);
  }
  .user-chip .who{ font-size: 12.5px; }
  .user-chip .role{ font-size: 11px; color: var(--text-faint); }

  .main{ padding: 26px 32px 40px; }

  .topbar{
    display:flex; align-items:center; justify-content:space-between; margin-bottom: 26px;
  }
  .topbar h1{ font-size: 19px; font-weight: 600; }
  .topbar .path{ font-size: 12px; color: var(--text-faint); margin-top: 3px; }

  .credit-pill{
    display:flex; align-items:center; gap: 10px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 9px 16px;
  }
  .credit-pill .label{ font-size: 11px; color: var(--text-dim); }
  .credit-pill .value{ font-family:'IBM Plex Mono',monospace; font-weight:600; font-size:15px; color: var(--credit); }

  .stat-grid{
    display:grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px;
  }
  .stat-card{
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 16px 18px;
  }
  .stat-card .label{ font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
  .stat-card .value{ font-family:'IBM Plex Mono',monospace; font-size: 24px; font-weight: 600; }
  .stat-card .delta{ font-size: 11.5px; margin-top: 6px; }
  .delta.up{ color: var(--signal); }
  .delta.warn{ color: var(--credit); }
  .delta.down{ color: var(--danger); }

  .panel{
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); overflow: visible; margin-bottom: 20px;
  }
  .panel-head{
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display:flex; align-items:center; justify-content:space-between;
    padding: 15px 18px; border-bottom: 1px solid var(--border);
  }
  .panel-head h2{ font-size: 14.5px; font-weight: 600; }
  .panel-head .hint{ font-size: 12px; color: var(--text-faint); margin-top: 2px; }
  .btn-add{
    background: var(--signal-dim); color: var(--signal);
    border: 1px solid var(--signal); border-radius: var(--radius-sm);
    padding: 7px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  }
  .btn-add:hover{ background: rgba(51,214,176,0.16); }

  table{ width: 100%; border-collapse: collapse; }
  thead th{
    text-align: left; font-size: 11px; color: var(--text-faint);
    font-weight: 500; padding: 10px 18px; border-bottom: 1px solid var(--border);
  }
  tbody td{
    padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 13px;
    vertical-align: middle;
  }
  tbody tr:last-child td{ border-bottom: none; }
  tbody tr:hover{ background: rgba(255,255,255,0.015); }

  .entity-name{ display:flex; align-items:center; gap: 10px; }
  .tier-line{ width: 3px; height: 22px; border-radius: 2px; flex-shrink:0; }
  .tier-line.t-admin{ background: var(--tier); }
  .tier-line.t-rev{ background: var(--signal); }
  .tier-line.t-sub{ background: var(--credit); }
  .tier-line.t-cli{ background: var(--text-faint); }
  .entity-name .indent{ width: 18px; flex-shrink:0; }
  .entity-name .nm{ font-weight: 500; }
  .entity-name .un{ font-size: 11.5px; color: var(--text-faint); font-family:'IBM Plex Mono',monospace; }

  .badge{
    display:inline-block; font-size: 10.5px; font-weight: 600; padding: 3px 8px;
    border-radius: 20px; letter-spacing: 0.2px;
  }
  .badge.rev{ background: var(--signal-dim); color: var(--signal); }
  .badge.sub{ background: var(--credit-dim); color: var(--credit); }
  .badge.cli{ background: rgba(126,147,167,0.15); color: var(--text-dim); }

  .status-dot{ display:inline-flex; align-items:center; gap:6px; font-size: 12.5px; }
  .status-dot i{ width:7px; height:7px; border-radius:50%; display:inline-block; }
  .status-dot.on i{ background: var(--signal); }
  .status-dot.off i{ background: var(--danger); }
  .status-dot.exp i{ background: var(--credit); }

  .pay-tag{ font-size: 11.5px; color: var(--text-dim); }
  #hierarchy-table th:last-child, #hierarchy-table td:last-child{ width: 1%; white-space: nowrap; }
  .row-actions{ display:flex; gap: 0; position:relative; align-items:center; justify-content:flex-end; }
  .row-actions button{
    background: none; border: none; color: var(--text-faint);
    font-size: 12px; cursor: pointer; font-family: 'IBM Plex Sans', sans-serif;
  }
  .row-actions button:hover{ color: var(--text); }

  .row-menu-btn{
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
    width: 30px; height: 26px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
  }
  .row-menu-btn:hover{ color: var(--text); border-color: var(--signal); }
  .row-menu{
    display:none; position:absolute; right:0; bottom: calc(100% + 6px); z-index: 25;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); min-width: 200px; padding: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  }
  .row-menu.flip-down{ bottom:auto; top: calc(100% + 6px); }
  .row-menu.show{ display:block; }
  .row-menu button, .row-menu a{
    display:block; width:100%; text-align:left; background:none; border:none;
    color: var(--text-dim); font-size: 12.5px; padding: 8px 10px; border-radius: var(--radius-sm);
    cursor:pointer; font-family:'IBM Plex Sans', sans-serif;
  }
  .row-menu button:hover, .row-menu a:hover{ background: var(--bg); color: var(--text); }
  .row-menu button.danger{ color: var(--danger); }
  .row-menu button.danger:hover{ background: var(--danger-dim); }

  .icon-action{
    width:32px; height:32px; border-radius:9px; border:1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04); color: var(--text-dim); cursor:pointer; font-size:14px;
    display:inline-flex; align-items:center; justify-content:center;
    flex-shrink:0; transition: all 0.12s ease;
  }
  .row-actions{ gap: 8px; }
  .icon-action:hover{ color:#fff; border-color:var(--signal); background: var(--signal-dim); transform: translateY(-1px); }
  .icon-action.on{ color: var(--credit); border-color: rgba(231,178,76,0.4); background: var(--credit-dim); }

  .table-toolbar{
    display:flex; align-items:center; justify-content:space-between; gap:16px;
    padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap:wrap;
  }
  .filter-tabs{ display:flex; gap:6px; }
  .filter-tab{
    background:none; border:1px solid var(--border); color: var(--text-dim);
    padding: 6px 13px; border-radius: 20px; font-size: 12.5px; cursor:pointer;
  }
  .filter-tab:hover{ color: var(--text); }
  .filter-tab.active{ background: var(--signal-dim); color: var(--signal); border-color: var(--signal); }
  .table-search{
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px 12px; color: var(--text); font-size: 12.5px; min-width: 220px;
  }
  .table-search:focus{ outline:none; border-color: var(--signal); }

  .empty-state{ text-align:center; padding: 46px 20px; }
  .empty-title{ font-size: 14px; font-weight:600; margin-bottom: 6px; }
  .empty-sub{ font-size: 12.5px; color: var(--text-faint); }

  .two-col{ display:grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }

  .mini-list{ padding: 6px 0; }
  .mini-row{
    display:flex; align-items:center; justify-content:space-between;
    padding: 11px 18px; border-bottom: 1px solid var(--border); font-size: 13px;
  }
  .mini-row:last-child{ border-bottom:none; }
  .mini-row .nm{ font-weight: 500; }
  .mini-row .when{ font-size: 11.5px; color: var(--text-faint); }
  .mini-row .amt{ font-family:'IBM Plex Mono',monospace; font-size: 12.5px; }
  .amt.plus{ color: var(--signal); }
  .amt.minus{ color: var(--danger); }

  /* Modal preview */
  .modal-overlay{
    position: fixed; inset:0; background: rgba(5,10,15,0.7);
    display:none; align-items:center; justify-content:center; z-index: 50;
  }
  .modal-overlay.show{ display:flex; }
  .modal{
    width: 420px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 22px 24px 20px;
    max-height: 88vh; overflow-y: auto;
  }
  .modal h3{ font-size: 15.5px; font-weight:600; margin-bottom: 4px; }
  .modal p.sub{ font-size:12px; color: var(--text-dim); margin-bottom: 18px; }
  .modal .field{ margin-bottom: 14px; }
  .modal .field select, .modal .field input:not([type="checkbox"]):not([type="radio"]){
    width: 100%; background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 9px 11px; color: var(--text); font-size: 13px;
  }
  .modal .field input[type="checkbox"], .modal .field input[type="radio"]{
    width: auto; margin-right: 6px; vertical-align: middle;
  }
  .modal-actions{ display:flex; gap:10px; margin-top: 18px; }
  .btn-ghost{
    flex:1; background: none; border: 1px solid var(--border); color: var(--text-dim);
    border-radius: var(--radius-sm); padding: 10px; font-size: 13px; cursor:pointer;
  }
  .btn-confirm{
    flex:1; background: var(--signal); color:#06231D; border:none;
    border-radius: var(--radius-sm); padding: 10px; font-weight:600; font-size:13px; cursor:pointer;
  }

  .preview-tag{
    position: fixed; bottom: 16px; right: 16px;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text-faint); font-size: 11px; padding: 7px 12px;
    border-radius: 20px; z-index: 40; font-family:'IBM Plex Mono',monospace;
  }

  .head-actions{ display:flex; gap:8px; }
  .btn-add.ghost{ background: none; border: 1px solid var(--border); color: var(--text-dim); }
  .btn-add.ghost:hover{ background: var(--surface-2); color: var(--text); }
  .btn-add.credit{ background: var(--credit-dim); color: var(--credit); border: 1px solid var(--credit); }

  .modal.wide{ width: 460px; }
  .access-box{
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 14px 16px; margin-bottom: 14px;
  }
  .access-row{ display:flex; justify-content:space-between; padding: 5px 0; font-size: 13px; }
  .access-row .k{ color: var(--text-dim); }
  .access-row .v{ font-family:'IBM Plex Mono',monospace; }
  .msg-preview{
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px 14px; font-size: 12.5px; color: var(--text-dim); line-height:1.6;
    white-space: pre-wrap; margin-bottom: 14px; max-height: 340px; overflow-y:auto;
  }
  .copy-row{ display:flex; gap:10px; }
  .btn-copy{
    flex:1; background: var(--signal-dim); color: var(--signal); border: 1px solid var(--signal);
    border-radius: var(--radius-sm); padding: 10px; font-weight:600; font-size:13px; cursor:pointer;
  }
  .btn-wpp{
    flex:1; background: #1F3A2E; color: #4CD97B; border: 1px solid #2E5A44;
    border-radius: var(--radius-sm); padding: 10px; font-weight:600; font-size:13px; cursor:pointer;
  }
  .tier-select{ display:flex; gap:8px; margin-bottom:14px; }
  .tier-opt{
    flex:1; text-align:center; padding: 9px 6px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size:12.5px; color: var(--text-dim); cursor:pointer;
  }
  .tier-opt.sel{ border-color: var(--signal); color: var(--signal); background: var(--signal-dim); }

  .upload-row{ display:flex; gap: 24px; padding: 18px; flex-wrap: wrap; }
  .upload-card{
    flex: 1; min-width: 220px;
    background: var(--bg); border: 1px dashed var(--border);
    border-radius: var(--radius-md); padding: 20px; text-align:center;
  }
  .upload-card .preview-box{
    width: 100%; height: 84px; display:flex; align-items:center; justify-content:center;
    background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 14px;
    border: 1px solid var(--border);
  }
  .upload-card.fav .preview-box{ width: 56px; height: 56px; margin: 0 auto 14px; }
  .upload-card .logo-mark{ display:flex; align-items:center; gap:8px; }
  .upload-card .logo-mark .dot{ width:10px; height:10px; border-radius:50%; background: var(--signal); box-shadow: 0 0 0 3px var(--signal-dim); }
  .upload-card .logo-mark span{ font-weight:600; font-size:15px; }
  .upload-card .fav-dot{ width:20px; height:20px; border-radius:6px; background: var(--signal); }
  .upload-card h4{ font-size: 13px; font-weight:600; margin-bottom: 4px; }
  .upload-card p{ font-size: 11.5px; color: var(--text-faint); margin-bottom: 12px; }
  .upload-btn{
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
    border-radius: var(--radius-sm); padding: 8px 14px; font-size: 12.5px; cursor:pointer;
  }
  .upload-btn:hover{ color: var(--text); border-color: var(--signal); }

  /* ================= RESPONSIVO (celular) ================= */
  .sidebar-overlay{
    display:none; position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:39;
  }
  .sidebar-overlay.show{ display:block; }

  @media (max-width: 860px){
    .shell{ grid-template-columns: 1fr; }
    .sidebar{
      position: fixed; left:0; top:0; width: 250px; height: 100vh;
      transform: translateX(-100%); transition: transform 0.22s ease; z-index: 40;
    }
    .sidebar.mobile-open{ transform: translateX(0); }
    .shell.collapsed{ grid-template-columns: 1fr; }
    .shell.collapsed .sidebar{ width:250px; padding:16px 14px; }
    .shell.collapsed .nav-group-label span:first-child,
    .shell.collapsed .chev,
    .shell.collapsed .nav-item-inner span,
    .shell.collapsed .nav-count,
    .shell.collapsed .user-chip div:not(.avatar){ display:initial; }
    .shell.collapsed .nav-item-inner{ justify-content:flex-start; }
    .shell.collapsed .nav-item{ justify-content:flex-start; }

    .main{ padding: 16px; }
    .util-bar{ margin: -16px -16px 16px; padding: 12px 16px; }
    .stat-grid{ grid-template-columns: repeat(2, 1fr) !important; gap:10px; }
    .topbar{ flex-direction:column; align-items:flex-start; gap:12px; }
    .breadcrumb{ display:none; }
    .table-toolbar{ flex-direction:column; align-items:stretch; }
    .table-search{ width:100%; }
    .filter-tabs{ overflow-x:auto; padding-bottom:4px; }

    /* tabela -> cards */
    #hierarchy-table thead{ display:none; }
    #hierarchy-table, #hierarchy-table tbody, #hierarchy-table tr, #hierarchy-table td{
      display:block; width:100%;
    }
    #hierarchy-table tbody tr{
      border: 1px solid var(--border); border-radius: var(--radius-md);
      margin-bottom: 10px; padding: 12px 14px; background: var(--bg);
    }
    #hierarchy-table td{
      border-bottom: none !important; padding: 5px 0 !important;
      display:flex; align-items:center; justify-content:space-between; gap:10px;
    }
    #hierarchy-table td[data-label]:not([data-label=""])::before{
      content: attr(data-label); color: var(--text-faint); font-size: 11px; flex-shrink:0;
    }
    #hierarchy-table td:first-child::before{ display:none; }
    #hierarchy-table td:first-child{ padding-bottom: 8px !important; border-bottom: 1px solid var(--border) !important; margin-bottom: 6px; }
    #hierarchy-table td:last-child{ width: auto; }
    #hierarchy-table .row-actions{
      justify-content:flex-end; position:relative;
      margin-top: 8px; padding-top: 10px !important;
      border-top: 1px solid var(--border);
    }
    #hierarchy-table .row-menu{ left:auto; right:0; top:auto; bottom: calc(100% + 6px); }

    .modal, .modal.wide{ width: 92vw; }
    .upload-row{ flex-direction:column; }
  }

  /* ===== TEMA GLASS/VIBRANTE (aplicado no painel inteiro) ===== */
  body{
    background:
      radial-gradient(900px 500px at 10% 0%, rgba(124,92,255,0.16), transparent),
      radial-gradient(700px 500px at 90% 10%, rgba(51,214,176,0.14), transparent),
      var(--bg);
  }
  .util-bar{ background: rgba(16,28,43,0.6); backdrop-filter: blur(10px); border-bottom:1px solid rgba(255,255,255,0.06); }
  .sidebar{ background: rgba(16,28,43,0.55); backdrop-filter: blur(14px); border-right:1px solid rgba(255,255,255,0.06); }
  .stat-card{
    background: rgba(22,39,58,0.55); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 16px;
  }
  .stat-card .value{
    font-size: 30px; background: linear-gradient(90deg, #33D6B0, #7C5CFF);
    -webkit-background-clip:text; background-clip:text; color:transparent;
  }
  .panel{ background: rgba(16,28,43,0.55); backdrop-filter: blur(10px); border-radius:18px; border:1px solid rgba(255,255,255,0.07); }
  .btn-add{ background: linear-gradient(90deg, #33D6B0, #7C5CFF); color:#06131a; border:none; font-weight:700; }
  .btn-add.ghost{ background: rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.12); color:#fff; }
  .btn-confirm{ background: linear-gradient(90deg, #33D6B0, #7C5CFF); color:#06131a; border:none; font-weight:700; }
  .filter-tab.active{ background: linear-gradient(90deg, #33D6B033, #7C5CFF33); border-color:#7C5CFF; color:#fff; }
  .badge.rev{ background: linear-gradient(90deg, #33D6B033, #7C5CFF33); color:#fff; }
  h1, h2{ letter-spacing: -0.3px; }

  .login-box{
    background: rgba(16,28,43,0.6); backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 20px;
  }
  .login-mark .dot{ box-shadow: 0 0 0 4px rgba(51,214,176,0.15), 0 0 20px rgba(124,92,255,0.35); }

  .modal{
    background: rgba(16,28,43,0.85); backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 18px;
  }
  .credit-pill{
    background: rgba(255,255,255,0.05); backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
  }
  .credit-pill .value{
    background: linear-gradient(90deg, #33D6B0, #E7B24C);
    -webkit-background-clip:text; background-clip:text; color:transparent;
  }
  .icon-btn{ background: rgba(255,255,255,0.05); backdrop-filter: blur(6px); border-color: rgba(255,255,255,0.12); }
  .row-menu{ background: rgba(22,39,58,0.9); backdrop-filter: blur(14px); }
  .breadcrumb{ background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }
  .sidebar-foot{ border-top-color: rgba(255,255,255,0.08); }

  /* ===== Fundo de posters (TMDB) no login ===== */
  .poster-bg{
    position:fixed; inset:0; z-index:0;
    display:grid; grid-template-columns: repeat(8, 1fr); gap:2px;
    opacity: 0.35;
  }
  .poster-bg div{ background-size:cover; background-position:center; aspect-ratio: 2/3; background-color: var(--surface); }
  .poster-bg::after{
    content:''; position:absolute; inset:0;
    background: radial-gradient(circle at 50% 50%, rgba(11,20,32,0.5), rgba(11,20,32,0.97) 70%);
  }
  #login-view{ position:relative; z-index:1; }
  @media (max-width: 700px){
    .poster-bg{ grid-template-columns: repeat(4, 1fr); }
  }

  /* ===== Login - painel dividido (Variante C) ===== */
  .login-box-split{
    display:flex; width: 720px; padding: 0; overflow:hidden;
  }
  .login-side{
    flex: 0 0 280px;
    background: linear-gradient(160deg, rgba(51,214,176,0.18), rgba(124,92,255,0.18));
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    padding: 40px 30px; border-right: 1px solid rgba(255,255,255,0.08);
    text-align:center;
  }
  .login-side p{ color: var(--text-dim); font-size:12.5px; margin-top:18px; line-height:1.5; }
  .login-side .login-mark{ justify-content:center; }
  .login-form-side{ flex:1; padding: 44px 40px 36px; min-width:0; }
  .login-form-side h1{ text-align:left; }

  @media (max-width: 760px){
    .login-box-split{ flex-direction:column; width: 92vw; max-width:420px; }
    .login-side{ flex: 0 0 auto; border-right:none; border-bottom: 1px solid rgba(255,255,255,0.08); padding: 30px; }
    .login-form-side{ padding: 32px 28px; }
    .login-form-side h1{ text-align:center; }
  }
