/* ============================================================
   VibeTube Admin — professional dashboard theme
   (Material Dashboard / AdminLTE inspired: light content,
    dark gradient sidebar, soft-shadow cards, gradient icons)
   ============================================================ */
:root {
  --bg: #f3f5f9;
  --card: #ffffff;
  --elev: #ffffff;          /* alias kept for legacy markup */
  --elev2: #eef1f6;         /* input + table header bg */
  --border: #e6e9f0;
  --text: #232a36;
  --dim: #5b6472;
  --faint: #98a1b2;
  --accent: #ff2d55;
  --accent2: #ff7a00;
  --hd: #10b981;
  --gold: #f59e0b;
  --info: #3b82f6;
  --sidebar: #1f2638;
  --sidebar2: #161b29;
  --sidebar-text: #aab2c5;
  --shadow: 0 1px 3px rgba(20, 30, 60, 0.06), 0 8px 24px rgba(20, 30, 60, 0.07);
  --shadow-sm: 0 1px 2px rgba(20, 30, 60, 0.12);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ───── Shell ───── */
.layout { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }

/* ───── Sidebar ───── */
.sidebar {
  background: linear-gradient(195deg, var(--sidebar), var(--sidebar2));
  color: var(--sidebar-text);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 0 14px 24px;
  z-index: 40;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 6px; }
.brand {
  font-size: 21px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.3px;
  padding: 22px 10px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand b { color: var(--accent); }
.brand .brand-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 45, 85, 0.18);
  color: #ff8097;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.nav { padding-top: 6px; }
.nav .group {
  font-size: 10.5px;
  text-transform: uppercase;
  color: #6b7488;
  margin: 18px 12px 8px;
  letter-spacing: 0.7px;
  font-weight: 700;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--sidebar-text);
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 3px;
  transition: background 0.15s, color 0.15s;
}
.nav a svg { width: 19px; height: 19px; flex-shrink: 0; opacity: 0.9; }
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav a.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 45, 85, 0.32);
}
.nav a.active svg { opacity: 1; }

/* ───── Main column ───── */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 26px;
  height: 66px;
}
.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  color: var(--text);
  place-items: center;
}
.topbar-title h1 { font-size: 20px; margin: 0; font-weight: 700; }
.topbar-title .crumbs { font-size: 12px; color: var(--faint); margin-top: 1px; }
.topbar .spacer { flex: 1; }
.user-menu { display: flex; align-items: center; gap: 12px; }
.user-menu .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
}
.user-menu .user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-menu .user-meta .name { font-weight: 700; font-size: 13.5px; }
.user-menu .user-meta .role { font-size: 11.5px; color: var(--faint); text-transform: capitalize; }
.user-menu .logout {
  margin-left: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  background: var(--elev2);
  color: var(--dim);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid var(--border);
}
.user-menu .logout:hover { color: var(--accent); border-color: var(--accent); }

.content { padding: 26px; max-width: 1440px; width: 100%; }

/* ───── Stat cards ───── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 26px;
}
.stat {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  overflow: hidden;
}
.stat .ic {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 52px;
  height: 52px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.stat .ic svg { width: 25px; height: 25px; }
.stat .ic.primary { background: linear-gradient(135deg, #ff2d55, #ff7a00); }
.stat .ic.info { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.stat .ic.success { background: linear-gradient(135deg, #10b981, #34d399); }
.stat .ic.warning { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.stat .ic.gold { background: linear-gradient(135deg, #f59e0b, #f97316); }
.stat .ic.dark { background: linear-gradient(135deg, #475569, #1e293b); }
.stat .label {
  color: var(--faint);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.stat .value { font-size: 29px; font-weight: 800; margin-top: 8px; letter-spacing: -0.5px; }
.stat .value.accent { color: var(--accent); }
.stat .value.gold { color: var(--gold); }
.stat .value.green { color: var(--hd); }

/* ───── Panels / cards ───── */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 22px;
}
.panel h2 {
  font-size: 16px;
  margin: 0 0 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ───── Tables ───── */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th {
  background: var(--elev2);
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.4px;
}
tbody tr:hover td, tr:hover td { background: #f7f9fc; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.table-wrap table th:first-child { border-top-left-radius: var(--radius); }
.table-wrap table th:last-child { border-top-right-radius: var(--radius); }
/* When a table sits directly inside a panel, drop the doubled chrome. */
.panel .table-wrap { border: none; box-shadow: none; border-radius: 0; }

/* ───── Buttons ───── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 15px;
  border-radius: 9px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  transition: transform 0.06s, box-shadow 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 45, 85, 0.28);
}
.btn.green { background: linear-gradient(135deg, #10b981, #059669); border: none; color: #fff; box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25); }
.btn.danger { background: linear-gradient(135deg, #f5365c, #f02b50); border: none; color: #fff; box-shadow: 0 6px 16px rgba(245, 54, 92, 0.25); }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }

/* ───── Forms ───── */
input, select, textarea {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 45, 85, 0.12);
}
label { display: block; font-size: 12.5px; color: var(--dim); font-weight: 600; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
form.inline { display: inline; }

/* ───── Pills / badges ───── */
.pill { display: inline-block; padding: 4px 10px; border-radius: 100px; font-size: 11px; font-weight: 700; }
.pill.green { background: rgba(16, 185, 129, 0.14); color: #0c8f6b; }
.pill.gold  { background: rgba(245, 158, 11, 0.16); color: #b87509; }
.pill.red   { background: rgba(245, 54, 92, 0.14); color: #d61f45; }
.pill.gray  { background: var(--elev2); color: var(--faint); }

/* ───── Flash ───── */
.flash { padding: 13px 16px; border-radius: 11px; margin-bottom: 18px; font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow-sm); }
.flash.ok { background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.35); color: #0c8f6b; }
.flash.err { background: rgba(245, 54, 92, 0.1); border: 1px solid rgba(245, 54, 92, 0.35); color: #d61f45; }
.flash code { background: rgba(0, 0, 0, 0.06); padding: 1px 6px; border-radius: 5px; }

/* ───── Toolbar / pagination ───── */
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; }
.search-form { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination { display: flex; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--dim);
  background: var(--card);
  font-weight: 600;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination a.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; color: #fff; }

/* ───── Login ───── */
.login-wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, #1f2638, #161b29);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.login-card .login-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 22px;
  margin-bottom: 18px;
  box-shadow: 0 8px 20px rgba(255, 45, 85, 0.35);
}
.login-card h1 { font-size: 23px; margin: 0 0 6px; }
.login-card p { color: var(--dim); margin: 0 0 22px; font-size: 13.5px; }

/* ───── Misc ───── */
.muted { color: var(--faint); font-size: 12.5px; }
.thumb-cell img { width: 92px; height: 52px; object-fit: cover; border-radius: 7px; }

/* ───── Sidebar overlay (mobile) ───── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 30, 0.5);
  z-index: 35;
  backdrop-filter: blur(2px);
}

/* ───── Responsive ───── */
@media (max-width: 992px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }
  .menu-btn { display: grid; }
  .content { padding: 18px 16px; }
  .topbar { padding: 0 16px; }
  .user-menu .user-meta { display: none; }
}
@media (max-width: 520px) {
  .topbar-title .crumbs { display: none; }
  .topbar-title h1 { font-size: 17px; }
  .stat .value { font-size: 24px; }
}
