body.rankdesk-body{
  margin:0; padding:0; background:#F3F5F8;
}
#rankdesk-root, #rankdesk-root *{ box-sizing:border-box; }
#rankdesk-root{
  --bg:#F3F5F8; --surface:#FFFFFF; --surface-2:#F8F9FB; --ink:#161B26; --muted:#66707E; --faint:#98A2B3;
  --border:#E4E7EC; --accent:#2B5FE0; --accent-ink:#EAF0FE; --accent-dark:#1D46B8;
  --good:#0F8A6B; --good-bg:#E7F7F1; --warn:#C77700; --warn-bg:#FDF1DD; --bad:#D2444C; --bad-bg:#FBE9EA;
  --hold:#8A5CF6; --hold-bg:#F1EBFE; --radius:12px;
  --shadow:0 1px 2px rgba(20,24,34,0.04), 0 8px 24px -12px rgba(20,24,34,0.12);
  font-family:'Inter',sans-serif; color:var(--ink); min-height:100vh; display:flex; flex-direction:column;
  -webkit-font-smoothing:antialiased;
}
#rankdesk-root h1,#rankdesk-root h2,#rankdesk-root h3,#rankdesk-root .display{ font-family:'Sora',sans-serif; }
#rankdesk-root .mono{ font-family:'JetBrains Mono',monospace; }

.rd-login-wrap{
  min-height:100vh; width:100%; display:flex; align-items:center; justify-content:center;
  background:
    radial-gradient(1100px 500px at 15% -10%, #E3ECFE 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #E7F7F1 0%, transparent 55%),
    var(--bg);
  padding:24px;
}
.rd-login-card{
  width:100%; max-width:400px; background:var(--surface); border:1px solid var(--border);
  border-radius:20px; padding:36px 32px; box-shadow:var(--shadow);
}
.rd-mark{
  width:44px; height:44px; border-radius:12px; background:linear-gradient(135deg,var(--accent),#5B8CFF);
  display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-family:'Sora'; font-size:18px;
  margin-bottom:18px;
}
.rd-login-card h1{ font-size:22px; margin:0 0 4px; letter-spacing:-0.02em; }
.rd-login-card p.rd-sub{ color:var(--muted); font-size:13.5px; margin:0 0 26px; }
.rd-field{ margin-bottom:16px; }
.rd-field label{ display:block; font-size:12.5px; font-weight:600; color:var(--muted); margin-bottom:6px; }
.rd-field input, .rd-field select{
  width:100%; padding:11px 13px; border-radius:10px; border:1.5px solid var(--border);
  font-size:14.5px; font-family:'Inter'; background:var(--surface-2); color:var(--ink); outline:none;
}
.rd-field input:focus, .rd-field select:focus{ border-color:var(--accent); background:#fff; }
.rd-btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:11px 18px; border-radius:10px; border:none; cursor:pointer;
  font-family:'Inter'; font-weight:600; font-size:14px; transition:transform .06s ease, background .15s, opacity .15s;
}
.rd-btn:active{ transform:scale(0.98); }
.rd-btn-primary{ background:var(--accent); color:#fff; width:100%; padding:12px; font-size:14.5px;}
.rd-btn-primary:hover{ background:var(--accent-dark); }
.rd-btn-ghost{ background:transparent; color:var(--muted); border:1.5px solid var(--border); }
.rd-btn-ghost:hover{ background:var(--surface-2); }
.rd-btn-sm{ padding:7px 12px; font-size:13px; border-radius:8px;}
.rd-login-error{ background:var(--bad-bg); color:var(--bad); font-size:13px; padding:9px 12px; border-radius:8px; margin-bottom:16px; display:none; }
.rd-login-hint{ margin-top:18px; font-size:12px; color:var(--faint); text-align:center; }

.rd-topbar{
  height:60px; flex-shrink:0; background:var(--surface); border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between; padding:0 20px; gap:16px;
}
.rd-brand{ display:flex; align-items:center; gap:10px; }
.rd-brand .rd-mark2{ width:32px; height:32px; border-radius:9px; background:linear-gradient(135deg,var(--accent),#5B8CFF); color:#fff; display:flex; align-items:center; justify-content:center; font-family:'Sora'; font-weight:800; font-size:14px;}
.rd-brand .rd-name{ font-family:'Sora'; font-weight:700; font-size:16.5px; letter-spacing:-0.01em;}
.rd-topbar-right{ display:flex; align-items:center; gap:14px; }
.rd-role-pill{ font-size:11.5px; font-weight:700; padding:5px 10px; border-radius:100px; background:var(--accent-ink); color:var(--accent-dark); text-transform:uppercase; letter-spacing:.04em; }
.rd-user-chip{ display:flex; align-items:center; gap:9px; }
.rd-avatar{ width:30px; height:30px; border-radius:100px; background:var(--surface-2); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12.5px; color:var(--accent-dark); font-family:'Sora'; }
.rd-user-name{ font-size:13.5px; font-weight:600; }

.rd-main{ flex:1; display:flex; min-height:0; }
.rd-content{ flex:1; padding:22px 24px 40px; overflow-y:auto; min-width:0; }

.rd-sidebar{
  width:216px; flex-shrink:0; background:var(--surface); border-right:1px solid var(--border);
  padding:14px 10px; overflow-y:auto; display:flex; flex-direction:column; gap:2px;
}
.rd-nav-item{
  display:block; width:100%; text-align:left; padding:9px 12px; border-radius:8px; border:none;
  background:transparent; color:var(--muted); font-family:'Inter'; font-size:13.5px; font-weight:500;
  cursor:pointer; transition:background .12s, color .12s;
}
.rd-nav-item:hover{ background:var(--surface-2); color:var(--ink); }
.rd-nav-item.rd-nav-active{ background:var(--accent-ink); color:var(--accent-dark); font-weight:700; }
@media(max-width:820px){
  .rd-sidebar{ width:168px; }
  .rd-nav-item{ font-size:12px; padding:9px 8px; }
}

.rd-page-head{ display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:18px; flex-wrap:wrap; gap:12px;}
.rd-page-head h2{ font-size:20px; margin:0 0 3px; letter-spacing:-0.01em; }
.rd-page-head .rd-sub{ color:var(--muted); font-size:13px; }

.rd-stats-row{ display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; margin-bottom:20px;}
.rd-stat-card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:15px 16px; }
.rd-stat-card .rd-num{ font-family:'Sora'; font-weight:700; font-size:24px; letter-spacing:-0.02em;}
.rd-stat-card .rd-lbl{ font-size:12px; color:var(--muted); margin-top:2px; font-weight:500;}
.rd-stat-card.rd-accent .rd-num{ color:var(--accent); }
.rd-stat-card.rd-good .rd-num{ color:var(--good); }
.rd-stat-card.rd-hold .rd-num{ color:var(--hold); }

.rd-toolbar{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:14px; }
.rd-toolbar input[type=text], .rd-toolbar select{
  padding:9px 12px; border-radius:9px; border:1.5px solid var(--border); font-size:13.5px; background:var(--surface); font-family:'Inter'; outline:none;
}
.rd-toolbar input[type=text]{ min-width:220px; }
.rd-toolbar input:focus, .rd-toolbar select:focus{ border-color:var(--accent); }
.rd-spacer{ flex:1; }

#rankdesk-root table{ border-collapse:collapse; width:100%; font-size:13px; }
.rd-table-wrap{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:auto; box-shadow:var(--shadow); }
#rankdesk-root thead th{
  position:sticky; top:0; background:var(--surface-2); text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.04em;
  color:var(--muted); font-weight:700; padding:11px 14px; border-bottom:1px solid var(--border); white-space:nowrap;
}
#rankdesk-root tbody td{ padding:11px 14px; border-bottom:1px solid var(--border); white-space:nowrap; vertical-align:middle; }
#rankdesk-root tbody tr:last-child td{ border-bottom:none; }
#rankdesk-root tbody tr:hover{ background:var(--surface-2); }
.rd-proj-name{ font-weight:600; color:var(--ink); }
.rd-proj-name .rd-url{ display:block; font-size:11.5px; color:var(--faint); font-weight:400; margin-top:1px;}

.rd-pill{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; padding:4px 10px; border-radius:100px; }
.rd-dot{ width:6px; height:6px; border-radius:100px; display:inline-block; }
.rd-st-running{ background:var(--good-bg); color:var(--good); } .rd-st-running .rd-dot{ background:var(--good); }
.rd-st-hold{ background:var(--hold-bg); color:var(--hold); } .rd-st-hold .rd-dot{ background:var(--hold); }
.rd-st-completed{ background:var(--accent-ink); color:var(--accent-dark); } .rd-st-completed .rd-dot{ background:var(--accent); }
.rd-st-restart{ background:var(--warn-bg); color:var(--warn); } .rd-st-restart .rd-dot{ background:var(--warn); }

.rd-delta{ font-weight:700; font-size:12.5px; }
.rd-delta.rd-up{ color:var(--good); } .rd-delta.rd-down{ color:var(--bad); } .rd-delta.rd-flat{ color:var(--faint); }

.rd-row-actions{ display:flex; gap:6px; }
.rd-icon-btn{
  width:29px; height:29px; border-radius:8px; border:1px solid var(--border); background:var(--surface);
  display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--muted); transition:all .12s;
}
.rd-icon-btn:hover{ background:var(--surface-2); color:var(--ink); border-color:var(--faint); }
.rd-icon-btn.rd-danger:hover{ color:var(--bad); border-color:var(--bad); }

.rd-empty-state{ text-align:center; padding:60px 20px; color:var(--muted); }
.rd-empty-state .rd-em-mark{ width:52px; height:52px; border-radius:14px; background:var(--surface-2); display:flex; align-items:center;justify-content:center; margin:0 auto 14px; font-size:22px;}
.rd-empty-state h3{ font-size:16px; margin:0 0 4px; color:var(--ink); }
.rd-empty-state p{ font-size:13px; margin:0 0 18px; }

.rd-overlay{ position:fixed; inset:0; background:rgba(20,24,34,0.45); backdrop-filter:blur(2px); display:none; align-items:flex-start; justify-content:center; z-index:100; padding:40px 16px; overflow-y:auto;}
.rd-overlay.rd-show{ display:flex; }
.rd-modal{ background:var(--surface); border-radius:18px; width:100%; max-width:720px; box-shadow:0 30px 60px -20px rgba(10,15,30,0.35); margin-bottom:40px;}
.rd-modal-head{ display:flex; align-items:center; justify-content:space-between; padding:20px 24px; border-bottom:1px solid var(--border); }
.rd-modal-head h3{ margin:0; font-size:17px; }
.rd-modal-close{ width:30px; height:30px; border-radius:8px; border:none; background:var(--surface-2); cursor:pointer; color:var(--muted); font-size:16px; display:flex; align-items:center; justify-content:center;}
.rd-modal-close:hover{ background:var(--border); color:var(--ink); }
.rd-modal-body{ padding:22px 24px; max-height:70vh; overflow-y:auto; }
.rd-modal-foot{ padding:16px 24px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:10px; }
.rd-grid2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.rd-grid3{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; }
@media(max-width:640px){ .rd-grid2,.rd-grid3{ grid-template-columns:1fr; } }
.rd-form-section-title{ font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--faint); margin:22px 0 10px; }
.rd-form-section-title:first-child{ margin-top:0; }

.rd-detail-row{ display:flex; justify-content:space-between; padding:9px 0; border-bottom:1px solid var(--border); font-size:13.5px; gap:16px;}
.rd-detail-row:last-child{ border-bottom:none; }
.rd-detail-row .rd-k{ color:var(--muted); font-weight:500; flex-shrink:0; }
.rd-detail-row .rd-v{ font-weight:600; text-align:right; word-break:break-word; }
.rd-detail-row .rd-v a{ color:var(--accent); text-decoration:none; }

.rd-comment-item{ background:var(--surface-2); border-radius:10px; padding:10px 13px; margin-bottom:8px; }
.rd-comment-item .rd-meta{ font-size:11px; color:var(--faint); margin-bottom:3px; font-weight:600; }
.rd-comment-item .rd-txt{ font-size:13.5px; }
.rd-comment-input-row{ display:flex; gap:8px; margin-top:12px; }
.rd-comment-input-row input{ flex:1; padding:10px 12px; border-radius:9px; border:1.5px solid var(--border); font-size:13.5px; outline:none; font-family:'Inter';}
.rd-comment-input-row input:focus{ border-color:var(--accent); }

.rd-user-row{ display:flex; align-items:center; justify-content:space-between; padding:12px 0; border-bottom:1px solid var(--border); }
.rd-user-row:last-child{ border-bottom:none; }
.rd-user-row .rd-u-left{ display:flex; align-items:center; gap:11px; }

.rd-toast{ position:fixed; bottom:22px; left:50%; transform:translateX(-50%); background:var(--ink); color:#fff; padding:11px 20px; border-radius:10px; font-size:13.5px; font-weight:500; box-shadow:0 10px 30px rgba(0,0,0,.25); z-index:200; opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; }
.rd-toast.rd-show{ opacity:1; transform:translateX(-50%) translateY(-6px); }

.rd-kv-badge{ font-size:11px; font-weight:700; padding:2px 7px; border-radius:6px; background:var(--surface-2); color:var(--muted); }
.rd-file-row{ display:flex; align-items:center; gap:10px; }
.rd-file-row input[type=file]{ font-size:12.5px; }

/* ============== DASHBOARD ============== */
.rd-dash-greet{
  display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap;
  background:
    radial-gradient(700px 220px at 0% 0%, var(--accent-ink) 0%, transparent 70%),
    var(--surface);
  border:1px solid var(--border); border-radius:18px; padding:22px 26px; margin-bottom:20px; box-shadow:var(--shadow);
}
.rd-dash-greet-eyebrow{ font-size:12px; font-weight:700; color:var(--accent); text-transform:uppercase; letter-spacing:.06em; margin-bottom:4px; }
.rd-dash-greet h2{ margin:0 0 4px; font-size:24px; letter-spacing:-0.01em; }
.rd-dash-date{ font-size:13px; color:var(--muted); font-weight:500; white-space:nowrap; }

.rd-dash-grid{ display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:stretch; }
@media(max-width:900px){ .rd-dash-grid{ grid-template-columns:1fr; } }
.rd-panel{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:20px 22px; box-shadow:var(--shadow); }
.rd-panel-title{ font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--faint); margin:0 0 16px; }

.rd-donut-row{ display:flex; align-items:center; gap:26px; flex-wrap:wrap; }
.rd-donut-wrap{ position:relative; width:132px; height:132px; flex-shrink:0; }
.rd-donut-wrap svg circle{ transition:stroke-dasharray .4s ease; }
.rd-donut-center{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.rd-donut-num{ font-family:'Sora'; font-weight:800; font-size:22px; letter-spacing:-0.02em; }
.rd-donut-lbl{ font-size:11px; color:var(--faint); font-weight:600; }
.rd-legend{ display:flex; flex-direction:column; gap:10px; flex:1; min-width:140px; }
.rd-legend-item{ display:flex; align-items:center; gap:9px; font-size:13px; }
.rd-legend-dot{ width:9px; height:9px; border-radius:100px; flex-shrink:0; }
.rd-legend-lbl{ flex:1; color:var(--muted); font-weight:500; }
.rd-legend-val{ font-weight:700; font-family:'Sora'; }

.rd-ne-row{ display:flex; gap:26px; margin-bottom:12px; }
.rd-ne-num{ font-family:'Sora'; font-weight:800; font-size:26px; letter-spacing:-0.02em; }
.rd-ne-lbl{ font-size:12px; color:var(--muted); font-weight:600; margin-top:2px; }
.rd-split-bar{ height:9px; border-radius:100px; background:var(--surface-2); overflow:hidden; }
.rd-split-fill{ height:100%; border-radius:100px; transition:width .4s ease; }

.rd-bar-list{ display:flex; flex-direction:column; gap:10px; }
.rd-bar-row{ display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:10px; font-size:12.5px; }
.rd-bar-lbl{ color:var(--muted); font-weight:500; white-space:nowrap; max-width:150px; overflow:hidden; text-overflow:ellipsis; }
.rd-bar-track{ height:8px; border-radius:100px; background:var(--surface-2); overflow:hidden; }
.rd-bar-fill{ height:100%; border-radius:100px; background:linear-gradient(90deg,var(--accent),#5B8CFF); transition:width .4s ease; }
.rd-bar-val{ font-weight:700; font-family:'Sora'; font-size:12.5px; min-width:16px; text-align:right; }

.rd-quick-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:12px; margin-bottom:8px; }
.rd-quick-card{
  display:flex; align-items:center; gap:12px; text-align:left; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:14px 16px; cursor:pointer; transition:border-color .15s, transform .1s, box-shadow .15s;
  font-family:'Inter';
}
.rd-quick-card:hover{ border-color:var(--accent); box-shadow:var(--shadow); transform:translateY(-1px); }
.rd-quick-icon{ width:38px; height:38px; border-radius:10px; background:var(--accent-ink); display:flex; align-items:center; justify-content:center; font-size:17px; flex-shrink:0; }
.rd-quick-lbl{ font-weight:700; font-size:13.5px; color:var(--ink); }
.rd-quick-desc{ font-size:11.5px; color:var(--faint); margin-top:1px; }
