@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&family=Roboto+Mono:wght@400;500&display=swap');

:root {
  --bg: #0a0c10;
  --surface: #111318;
  --surface2: #181c24;
  --border: #1e2430;
  --accent: #00e5ff;
  --accent2: #ff4d6d;
  --accent3: #39d98a;
  --warn: #ffb800;
  --text: #e8eaf0;
  --text2: #7a8294;
  --text3: #4a5165;
  --red: #ff3b5c;
  --green: #39d98a;
  --fh: 'Roboto', sans-serif;
  --fb: 'Roboto', sans-serif;
  --fm: 'Roboto Mono', monospace;
  --r: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --grad-accent: linear-gradient(135deg, #00e5ff, #0099ff);
  --grad-green:  linear-gradient(135deg, #39d98a, #00c97a);
  --grad-red:    linear-gradient(135deg, #ff4d6d, #ff3b5c);
  --grad-warn:   linear-gradient(135deg, #ffb800, #ff8c00);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--fb);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* ── LOGIN ──────────────────────────────────────── */
.login-body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(0,229,255,0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(255,77,109,0.07) 0%, transparent 55%);
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
}

.login-box {
  width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  box-shadow: var(--shadow), 0 0 80px rgba(0,229,255,0.04);
  animation: fadeUp .5s cubic-bezier(.16,1,.3,1);
}

@keyframes fadeUp { from{opacity:0;transform:translateY(24px)} to{opacity:1;transform:none} }

.login-logo { text-align:center; margin-bottom:32px; }
.brand { font-family:var(--fh); font-size:30px; font-weight:800; letter-spacing:-1px; }
.brand span { color:var(--accent); }
.login-logo p { font-family:var(--fm); font-size:11px; color:var(--text3); letter-spacing:3px; text-transform:uppercase; margin-top:6px; }

.login-error {
  background: rgba(255,59,92,.1);
  border: 1px solid rgba(255,59,92,.3);
  border-radius:8px; padding:10px 14px;
  font-size:13px; color:var(--red);
  margin-bottom:16px;
  display:flex; align-items:center; gap:8px;
}

.login-field { margin-bottom:16px; }
.login-field label { display:block; font-size:11px; font-weight:600; color:var(--text2); margin-bottom:8px; text-transform:uppercase; letter-spacing:1px; }
.login-field input {
  width:100%; background:var(--bg); border:1px solid var(--border); border-radius:10px;
  padding:13px 16px; font-size:14px; color:var(--text); font-family:var(--fb); outline:none; transition:border-color .2s;
}
.login-field input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(0,229,255,.08); }

.btn-login {
  width:100%; background:var(--accent); color:var(--bg); border:none; border-radius:10px;
  padding:14px; font-family:var(--fh); font-size:15px; font-weight:700; cursor:pointer;
  margin-top:8px; transition:all .2s; letter-spacing:.5px; display:flex; align-items:center; justify-content:center; gap:8px;
}
.btn-login:hover { background:#00cfea; transform:translateY(-1px); }

.login-hint { margin-top:18px; text-align:center; font-size:11px; color:var(--text3); font-family:var(--fm); }

/* ── LAYOUT ─────────────────────────────────────── */
.sidebar {
  position:fixed; left:0; top:0; bottom:0; width:240px;
  background:var(--surface); border-right:1px solid var(--border);
  display:flex; flex-direction:column; z-index:100; overflow-y:auto;
}

.sidebar-logo { padding:22px 24px 18px; border-bottom:1px solid var(--border); }
.sidebar-logo .brand { font-size:21px; }
.sidebar-logo small { font-family:var(--fm); font-size:10px; color:var(--text3); letter-spacing:2px; text-transform:uppercase; }

.nav-section { padding:16px 24px 6px; font-size:10px; font-weight:600; color:var(--text3); letter-spacing:2px; text-transform:uppercase; font-family:var(--fm); }

.nav-item {
  display:flex; align-items:center; gap:11px; padding:10px 24px;
  font-size:13.5px; font-weight:500; color:var(--text2); cursor:pointer;
  border-left:3px solid transparent; transition:all .15s; margin:1px 0;
}
.nav-item i { width:17px; text-align:center; font-size:14px; }
.nav-item:hover { background:var(--surface2); color:var(--text); }
.nav-item.active { background:var(--surface2); color:var(--accent); border-left-color:var(--accent); }

.sidebar-bottom { margin-top:auto; padding:16px 24px; border-top:1px solid var(--border); }
.user-info { display:flex; align-items:center; gap:10px; }
.user-avatar { width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-family:var(--fh); font-size:13px; font-weight:800; color:var(--bg); }
.user-name { font-size:13px; font-weight:600; }
.user-role { font-size:10px; color:var(--text3); font-family:var(--fm); text-transform:uppercase; letter-spacing:1px; }
.btn-logout { margin-top:10px; width:100%; background:transparent; border:1px solid var(--border); border-radius:8px; padding:8px; font-size:12px; color:var(--text2); cursor:pointer; transition:all .2s; font-family:var(--fb); }
.btn-logout:hover { border-color:var(--red); color:var(--red); }

.main { margin-left:240px; min-height:100vh; }

.topbar {
  height:62px; background:var(--surface); border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between; padding:0 32px;
  position:sticky; top:0; z-index:50;
}
.topbar-title { font-family:var(--fh); font-size:18px; font-weight:700; }
.topbar-right { display:flex; align-items:center; gap:14px; }

.clock-widget { font-family:var(--fm); font-size:13px; color:var(--text2); background:var(--bg); padding:6px 14px; border-radius:8px; border:1px solid var(--border); }

.office-status { display:flex; align-items:center; gap:7px; font-size:12px; font-weight:600; padding:6px 13px; border-radius:8px; }
.office-status.open { background:rgba(57,217,138,.12); color:var(--green); }
.office-status.closed { background:rgba(255,59,92,.12); color:var(--red); }
.office-status .dot { width:6px; height:6px; border-radius:50%; background:currentColor; }

/* ── ALERTS ─────────────────────────────────────── */
.alert-banner {
  background:rgba(255,59,92,.1); border:1px solid rgba(255,59,92,.3);
  border-radius:var(--r); padding:14px 20px;
  display:flex; align-items:flex-start; gap:14px; margin-bottom:20px;
  animation: shakeAlert .5s ease;
}
@keyframes shakeAlert { 0%,100%{transform:none} 20%{transform:translateX(-5px)} 60%{transform:translateX(4px)} }
.alert-icon { color:var(--red); font-size:20px; margin-top:2px; }
.alert-text strong { color:var(--red); font-size:14px; display:block; margin-bottom:3px; }
.alert-text span { font-size:13px; color:var(--text2); }

/* ── PAGE CONTENT ────────────────────────────────── */
.page { display:none; padding:28px 32px; }
.page.active { display:block; }

/* ── STATS GRID ──────────────────────────────────── */
.stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:24px; }

.stat-card {
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r);
  padding:22px; position:relative; overflow:hidden; transition:transform .2s, border-color .2s;
}
.stat-card:hover { transform:translateY(-2px); border-color:rgba(0,229,255,.3); }
.stat-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background:var(--sc-grad, var(--grad-accent)); border-radius:var(--r) var(--r) 0 0; }
.stat-card::after { content:''; position:absolute; top:0; right:0; width:90px; height:90px; background:var(--sc,var(--accent)); opacity:.06; border-radius:0 12px 0 100%; }
.stat-card[style*="--sc:var(--accent)"]  { --sc-grad: var(--grad-accent); }
.stat-card[style*="--sc:var(--green)"]   { --sc-grad: var(--grad-green); }
.stat-card[style*="--sc:var(--red)"]     { --sc-grad: var(--grad-red); }
.stat-card[style*="--sc:var(--warn)"]    { --sc-grad: var(--grad-warn); }

.stat-label { font-size:10px; font-weight:500; color:var(--text3); letter-spacing:2px; text-transform:uppercase; font-family:var(--fm); margin-bottom:10px; }
.stat-value { font-family:var(--fh); font-size:38px; font-weight:700; line-height:1; margin-bottom:5px; }
.stat-sub { font-size:12px; color:var(--text2); }
.stat-icon { position:absolute; top:18px; right:18px; font-size:22px; opacity:.15; }

/* ── CARDS ───────────────────────────────────────── */
.card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:22px; }
.card-title { font-family:var(--fh); font-size:15px; font-weight:700; margin-bottom:18px; display:flex; align-items:center; gap:8px; }
.card-title i { color:var(--accent); font-size:14px; }

.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-bottom:22px; }
.grid-3 { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; margin-bottom:22px; }

/* ── TEAM CARDS ──────────────────────────────────── */
.team-card {
  background:var(--surface); border:1px solid var(--border); border-radius:var(--r);
  padding:22px; text-align:center; transition:all .2s;
}
.team-card:hover { border-color:rgba(0,229,255,.25); transform:translateY(-2px); }
.team-avatar-lg { width:56px; height:56px; border-radius:50%; margin:0 auto 12px; display:flex; align-items:center; justify-content:center; font-family:var(--fh); font-size:20px; font-weight:800; color:var(--bg); }
.team-name { font-family:var(--fh); font-size:17px; font-weight:700; margin-bottom:3px; }
.team-role { font-size:11px; color:var(--text3); font-family:var(--fm); text-transform:uppercase; letter-spacing:1px; margin-bottom:14px; }

.progress-bar { height:5px; background:var(--surface2); border-radius:3px; overflow:hidden; margin-top:6px; }
.progress-fill { height:100%; border-radius:3px; background:linear-gradient(90deg,#00e5ff,#0099ff,#6a5aff); transition:width .6s ease; }

.team-stats { display:flex; justify-content:center; gap:20px; margin-top:14px; padding-top:14px; border-top:1px solid var(--border); }
.team-stat .val { font-family:var(--fh); font-size:22px; font-weight:800; }
.team-stat .lbl { font-size:10px; color:var(--text3); font-family:var(--fm); text-transform:uppercase; }

/* ── TABLE ───────────────────────────────────────── */
.table-wrap { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); overflow:hidden; margin-bottom:24px; }
table { width:100%; border-collapse:collapse; }
thead th { background:var(--surface2); padding:11px 16px; font-size:10px; font-weight:600; color:var(--text3); text-align:left; letter-spacing:1.5px; text-transform:uppercase; font-family:var(--fm); border-bottom:1px solid var(--border); white-space:nowrap; }
tbody tr { border-bottom:1px solid var(--border); transition:background .12s; }
tbody tr:last-child { border:none; }
tbody tr:hover { background:var(--surface2); }
tbody td { padding:12px 16px; font-size:13px; vertical-align:middle; }

/* ── BADGES ──────────────────────────────────────── */
.badge { display:inline-flex; align-items:center; gap:5px; padding:4px 10px; border-radius:6px; font-size:11px; font-weight:600; font-family:var(--fm); white-space:nowrap; }
.badge-pending  { background:rgba(122,130,148,.15); color:var(--text2); }
.badge-done     { background:rgba(57,217,138,.15);  color:var(--green); }
.badge-late     { background:rgba(255,59,92,.15);   color:var(--red); animation:pulse 2s infinite; }
.badge-progress { background:rgba(0,229,255,.15);   color:var(--accent); }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

.type-pill { display:inline-block; padding:3px 9px; border-radius:5px; font-size:10px; font-weight:600; background:var(--surface2); color:var(--text2); border:1px solid var(--border); font-family:var(--fm); white-space:nowrap; }

.member-chip { display:inline-flex; align-items:center; gap:7px; font-size:13px; font-weight:500; white-space:nowrap; }
.member-dot { width:24px; height:24px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:9px; font-weight:800; color:var(--bg); flex-shrink:0; }

/* ── BUTTONS ─────────────────────────────────────── */
.btn { display:inline-flex; align-items:center; gap:6px; padding:7px 14px; border-radius:8px; font-size:12px; font-weight:600; cursor:pointer; transition:all .15s; border:none; font-family:var(--fb); white-space:nowrap; }
.btn-primary { background:var(--accent); color:var(--bg); }
.btn-primary:hover { background:#00cfea; }
.btn-success { background:var(--green); color:var(--bg); }
.btn-success:hover { background:#2ec87a; }
.btn-danger  { background:var(--red); color:#fff; }
.btn-danger:hover { background:#e02e4f; }
.btn-outline { background:transparent; border:1px solid var(--border); color:var(--text2); }
.btn-outline:hover { border-color:var(--accent); color:var(--accent); }
.btn-sm { padding:5px 10px; font-size:11px; border-radius:6px; }
.btn-warn { background:rgba(255,184,0,.15); color:var(--warn); border:1px solid rgba(255,184,0,.3); }
.btn-warn:hover { background:rgba(255,184,0,.25); }

/* ── FORMS ───────────────────────────────────────── */
.form-group { margin-bottom:16px; }
.form-label { display:block; font-size:11px; font-weight:600; color:var(--text2); margin-bottom:7px; text-transform:uppercase; letter-spacing:1px; }
.form-input, .form-select {
  width:100%; background:var(--bg); border:1px solid var(--border); border-radius:8px;
  padding:11px 14px; font-size:14px; color:var(--text); font-family:var(--fb); outline:none; transition:border-color .2s;
}
.form-input:focus, .form-select:focus { border-color:var(--accent); }
.form-select option { background:var(--surface2); }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.form-inline { display:flex; gap:10px; align-items:flex-end; }

/* ── SECTION HEADER ──────────────────────────────── */
.section-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.section-title { font-family:var(--fh); font-size:18px; font-weight:700; }
.section-title small { font-size:13px; font-weight:400; color:var(--text2); margin-left:8px; font-family:var(--fb); }

/* ── TABS ─────────────────────────────────────────── */
.tabs { display:flex; gap:4px; margin-bottom:18px; flex-wrap:wrap; }
.tab { padding:7px 16px; border-radius:8px; font-size:13px; font-weight:500; cursor:pointer; transition:all .15s; color:var(--text2); }
.tab:hover { background:var(--surface2); color:var(--text); }
.tab.active { background:var(--surface2); color:var(--accent); font-weight:600; }

/* ── SEARCH ───────────────────────────────────────── */
.search-bar { display:flex; gap:12px; margin-bottom:18px; }
.search-input { flex:1; background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:10px 16px; font-size:13px; color:var(--text); font-family:var(--fb); outline:none; transition:border-color .2s; }
.search-input:focus { border-color:var(--accent); }

/* ── MODAL ───────────────────────────────────────── */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.7); backdrop-filter:blur(4px); display:flex; align-items:center; justify-content:center; z-index:500; }
.modal { background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:30px; width:520px; max-height:85vh; overflow-y:auto; box-shadow:var(--shadow); animation:modalIn .3s cubic-bezier(.16,1,.3,1); }
@keyframes modalIn { from{opacity:0;transform:scale(.95) translateY(20px)} to{opacity:1;transform:none} }
.modal-title { font-family:var(--fh); font-size:19px; font-weight:800; margin-bottom:22px; display:flex; align-items:center; justify-content:space-between; }
.modal-close { width:30px; height:30px; background:var(--surface2); border:1px solid var(--border); border-radius:7px; display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:13px; color:var(--text2); transition:all .2s; }
.modal-close:hover { border-color:var(--red); color:var(--red); }

/* ── UPLOAD ZONE ─────────────────────────────────── */
.upload-zone { border:2px dashed var(--border); border-radius:12px; padding:40px; text-align:center; cursor:pointer; transition:all .2s; }
.upload-zone:hover, .upload-zone.over { border-color:var(--accent); background:rgba(0,229,255,.04); }
.upload-zone i { font-size:36px; color:var(--text3); display:block; margin-bottom:12px; }
.upload-zone p { font-size:14px; color:var(--text2); margin-bottom:6px; }
.upload-zone small { font-size:12px; color:var(--text3); font-family:var(--fm); }

/* ── NOTIFICATION ────────────────────────────────── */
.notif { position:fixed; top:20px; right:20px; background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:13px 18px; display:flex; align-items:center; gap:10px; box-shadow:var(--shadow); z-index:9999; font-size:13px; animation:notifIn .3s ease; max-width:340px; }
@keyframes notifIn { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:none} }
.notif.success { border-color:rgba(57,217,138,.4); }
.notif.success i { color:var(--green); }
.notif.error { border-color:rgba(255,59,92,.4); }
.notif.error i { color:var(--red); }
.notif.info i { color:var(--accent); }

/* ── CALENDAR ─────────────────────────────────────── */
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:6px; }
.cal-head { text-align:center; font-size:10px; font-family:var(--fm); color:var(--text3); padding:5px 0; }
.cal-day { aspect-ratio:1; display:flex; align-items:center; justify-content:center; border-radius:8px; font-size:13px; cursor:pointer; transition:all .15s; position:relative; border:1px solid transparent; }
.cal-day:hover { background:var(--surface2); }
.cal-day.today { background:var(--accent); color:var(--bg); font-weight:700; }
.cal-day.has-tasks { background:rgba(255,184,0,.1); border-color:rgba(255,184,0,.3); }
.cal-day.all-done { background:rgba(57,217,138,.1); border-color:rgba(57,217,138,.3); }
.cal-day.has-late { background:rgba(255,59,92,.1); border-color:rgba(255,59,92,.3); }
.cal-day.other-month { color:var(--text3); opacity:.4; }
.cal-day.selected { border-color:var(--accent); }

/* ── ROTATION GRID ───────────────────────────────── */
.rotation-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(90px, 1fr)); gap:6px; }
.rot-cell { padding:8px 10px; border-radius:8px; font-size:11px; font-family:var(--fm); border:1px solid var(--border); cursor:pointer; transition:all .15s; }
.rot-cell:hover { transform:translateY(-1px); }
.rot-cell.today { background:rgba(0,229,255,.1); border-color:rgba(0,229,255,.4); color:var(--accent); }
.rot-cell.done  { background:rgba(57,217,138,.08); border-color:rgba(57,217,138,.3); color:var(--green); }
.rot-cell.idle  { background:var(--surface2); color:var(--text3); }
.rot-num { font-size:16px; font-weight:800; font-family:var(--fh); margin-bottom:2px; }
.rot-url { font-size:9px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; opacity:.7; }

/* ── CHARTS ───────────────────────────────────────── */
.chart-wrap { position:relative; }

/* ── EMPTY STATE ─────────────────────────────────── */
.empty { text-align:center; padding:60px 20px; color:var(--text3); }
.empty i { font-size:48px; display:block; margin-bottom:16px; }
.empty h3 { font-family:var(--fh); font-size:17px; color:var(--text2); margin-bottom:8px; }
.empty p { font-size:13px; }

/* ── CSV TEMPLATES ───────────────────────────────── */
.template-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:14px; }
.template-card { background:var(--bg); border:1px solid var(--border); border-radius:10px; padding:18px; cursor:pointer; transition:all .2s; }
.template-card:hover { border-color:var(--accent); transform:translateY(-1px); }
.template-card i { font-size:26px; color:var(--accent); display:block; margin-bottom:10px; }
.template-card h4 { font-size:14px; font-weight:600; margin-bottom:5px; }
.template-card p { font-size:12px; color:var(--text3); }

/* ── LOADING SPINNER ─────────────────────────────── */
.spinner { width:20px; height:20px; border:2px solid var(--border); border-top-color:var(--accent); border-radius:50%; animation:spin .7s linear infinite; display:inline-block; }
@keyframes spin { to { transform:rotate(360deg); } }
.loading-row td { text-align:center; padding:40px; }

/* ── SCROLLBAR ───────────────────────────────────── */
::-webkit-scrollbar { width:5px; }
::-webkit-scrollbar-track { background:var(--bg); }
::-webkit-scrollbar-thumb { background:var(--border); border-radius:3px; }

/* ── RESPONSIVE ──────────────────────────────────── */
@media(max-width:1200px) {
  .stats-grid { grid-template-columns:repeat(2,1fr); }
  .page { padding:20px 24px; }
}
@media(max-width:900px) {
  .grid-2,.grid-3 { grid-template-columns:1fr; }
  .sidebar { width:200px; }
  .main { margin-left:200px; }
}
@media(max-width:700px) {
  .sidebar { transform:translateX(-100%); position:fixed; width:240px; transition:transform .3s; z-index:200; }
  .sidebar.open { transform:translateX(0); }
  .main { margin-left:0; }
  .topbar { padding:0 16px; }
  .page { padding:16px; }
  .stats-grid { grid-template-columns:1fr 1fr; gap:10px; }
  .form-row { grid-template-columns:1fr; }
  .modal { width:95vw; padding:20px; }
  .table-wrap { overflow-x:auto; }
  table { min-width:600px; }
}

/* ── BACKLINK TYPES BAR ───────────────────────────── */
.bl-types-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 22px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bl-types-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-family: var(--fm);
  margin-right: 6px;
  white-space: nowrap;
}
.bl-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  white-space: nowrap;
  transition: all .15s;
}
.bl-type-chip .chip-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bl-type-chip .chip-progress {
  font-size: 10px;
  color: var(--text3);
  font-family: var(--fm);
}
.bl-type-chip:hover { border-color: var(--accent); color: var(--text); }
