/* ============================================================
   SOURCEHUB — ADMIN CSS (Light)
   ============================================================ */

.admin-layout {
  display: flex;
  min-height: calc(100vh - 60px);
  background: var(--bg);
}

/* ── SIDEBAR ────────────────────────────────────────── */
.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
@media (max-width: 768px) {
  .admin-sidebar { display: none; }
}

.admin-sidebar-header {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}
.admin-sidebar-label {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  padding: 0.85rem 1rem 0.4rem;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  margin: 0.1rem 0.5rem;
  border-radius: var(--r-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  width: calc(100% - 1rem);
  transition: all 0.12s;
  font-family: var(--f-display);
}
.admin-nav-item:hover { background: var(--bg); color: var(--text); }
.admin-nav-item.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.admin-nav-item.active svg { color: var(--blue); }

/* ── MAIN CONTENT ───────────────────────────────────── */
.admin-content {
  flex: 1;
  min-width: 0;
  padding: 1.75rem var(--px, 1.5rem);
  overflow-x: hidden;
}

/* ── VIEW HEADER ────────────────────────────────────── */
.admin-view-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.admin-view-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}
.admin-view-sub {
  font-size: 0.82rem;
  color: var(--text-2);
  margin-top: 0.25rem;
  line-height: 1.6;
}

/* ── STAT GRID ──────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 900px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--stat-color, var(--blue));
  transition: box-shadow 0.15s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-icon-wrap {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.stat-label {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-bottom: 0.3rem;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1.1;
}
.stat-trend {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--green);
  margin-top: 0.4rem;
  font-weight: 600;
}

/* ── CHART ──────────────────────────────────────────── */
.chart-container {
  position: relative;
  background: var(--bg);
  border-radius: var(--r-lg);
  padding: 1rem;
  border: 1px solid var(--border);
}

/* ── LOGIN CARD ─────────────────────────────────────── */
.admin-login-card {
  max-width: 420px;
  margin: 4rem auto;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.login-header {
  background: var(--blue);
  padding: 2rem;
  text-align: center;
}
.login-icon-box {
  width: 56px; height: 56px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  color: #fff;
}
.login-title    { color: #fff; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.login-subtitle { color: rgba(255,255,255,0.7); font-size: 0.82rem; margin-top: 0.3rem; }
.login-body { padding: 1.75rem; }
.login-note {
  background: var(--blue-light);
  border: 1.5px solid #BFDBFE;
  border-radius: var(--r-md);
  padding: 0.75rem 1rem;
  font-family: var(--f-mono);
  font-size: 0.73rem;
  color: var(--blue);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

/* ── PROJECT MANAGER ────────────────────────────────── */
.admin-project-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  transition: all 0.12s;
}
.admin-project-row:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }

.admin-proj-thumb {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.admin-proj-info { flex: 1; min-width: 0; }
.admin-proj-title { font-size: 0.88rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-proj-meta  { font-family: var(--f-mono); font-size: 0.7rem; color: var(--text-3); margin-top: 0.15rem; }
.admin-proj-actions { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }

/* ── CATEGORY GRID ──────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.85rem;
}
.cat-admin-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 0.75rem;
  transition: all 0.15s;
}
.cat-admin-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); }
.cat-admin-icon {
  width: 38px; height: 38px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.cat-admin-name { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.cat-admin-meta { font-family: var(--f-mono); font-size: 0.7rem; color: var(--text-3); margin-top: 0.15rem; }

/* ── AUDIT LOG ──────────────────────────────────────── */
.audit-row {
  display: flex; align-items: flex-start; gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.audit-row:last-child { border-bottom: none; }
.audit-type-badge {
  font-family: var(--f-mono); font-size: 0.65rem; font-weight: 700;
  padding: 0.2rem 0.55rem; border-radius: var(--r-sm);
  flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.06em;
  margin-top: 0.1rem;
}
.audit-msg   { flex: 1; color: var(--text); line-height: 1.55; }
.audit-time  { font-family: var(--f-mono); font-size: 0.68rem; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }

/* ── SETTINGS ───────────────────────────────────────── */
.settings-section {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.settings-section-header {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--bg);
}
.settings-section-body { padding: 1.35rem; display: flex; flex-direction: column; gap: 1rem; }
.settings-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) {
  .settings-row { grid-template-columns: 1fr 1fr; }
}

/* ── DRIVE MANAGER ──────────────────────────────────── */
.drive-breadcrumb {
  display: flex; align-items: center; gap: 0.4rem;
  font-family: var(--f-mono); font-size: 0.78rem; color: var(--text-2);
  flex-wrap: wrap;
}
.drive-crumb { cursor: pointer; transition: color 0.12s; }
.drive-crumb:hover { color: var(--blue); }
.drive-crumb-sep { color: var(--text-3); }

.drive-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.drive-file-item {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem 0.85rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.drive-file-item:hover { border-color: var(--blue); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.drive-file-icon { font-size: 2rem; margin-bottom: 0.4rem; }
.drive-file-name { font-size: 0.78rem; font-weight: 600; color: var(--text); word-break: break-word; }
.drive-file-size { font-family: var(--f-mono); font-size: 0.66rem; color: var(--text-3); margin-top: 0.2rem; }

/* ── STORAGE GAUGE ──────────────────────────────────── */
.storage-gauge {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.gauge-label { font-family: var(--f-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); font-weight: 700; }
.gauge-val   { font-family: var(--f-mono); font-size: 1.75rem; font-weight: 700; color: var(--blue); letter-spacing: -0.04em; line-height: 1; margin: 0.3rem 0 0.15rem; }
.gauge-quota { font-family: var(--f-mono); font-size: 0.75rem; color: var(--text-3); }
.gauge-bar-wrap { height: 8px; background: var(--bg-2); border-radius: var(--r-full); overflow: hidden; margin: 0.9rem 0 0.6rem; }
.gauge-bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: var(--r-full); transition: width 1s cubic-bezier(0.34,1.56,0.64,1); }
.gauge-breakdown { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.gauge-breakdown-item { display: flex; align-items: center; gap: 0.6rem; font-size: 0.78rem; }
.gauge-breakdown-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.gauge-breakdown-label { flex: 1; color: var(--text-2); }
.gauge-breakdown-val { font-family: var(--f-mono); font-size: 0.73rem; font-weight: 700; color: var(--text); }
