/* ============================================================
   Delta-V Student Hosting Platform — Design System
   Palette: Midnight (dark navy + light blue accents)
   Font:    Inter (Clean & Modern)
   Layout:  Card Grid
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ---------- 1. Tokens (CSS custom properties) ---------- */
:root {
  /* Backgrounds — deep evening sky gradient */
  --bg-deepest: #0b1220;
  --bg-dark:    #101a30;
  --bg-panel:   #17233c;
  --bg-card:    #1c2b48;
  --bg-card-hover: #223356;

  /* Lines & dividers */
  --border: rgba(122, 162, 255, 0.14);
  --border-strong: rgba(122, 162, 255, 0.30);

  /* Light blue accents (the "sky" tones) */
  --accent:      #6ea8fe;
  --accent-bright: #a5c8ff;
  --accent-dark:  #2f6fd6;

  /* Status colors */
  --ok:     #34d399;   /* green — active / enough space */
  --warn:   #fbbf24;   /* amber — getting close to quota */
  --danger: #f87171;   /* red — over quota / suspended */

  /* Text */
  --text-main: #e6edf7;
  --text-muted: #93a7c7;
  --text-faint: #61749b;

  /* Type */
  --font-main: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-panel: 0 10px 30px rgba(2, 6, 23, 0.5);
  --shadow-card:  0 4px 16px rgba(2, 6, 23, 0.35);

  /* Layout widths */
  --shell-max: 1100px;
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--text-main);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(47, 111, 214, 0.28), transparent 60%),
    radial-gradient(900px 450px at -10% 10%, rgba(37, 99, 235, 0.18), transparent 55%),
    var(--bg-deepest);
  background-attachment: fixed;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); }

/* ---------- 3. Layout shell ---------- */
.shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 1.5rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* the brand is a link: keep it looking like before, but clickable */
a.brand { color: var(--text-main); text-decoration: none; cursor: pointer; }
a.brand:hover { color: var(--accent-bright); }
a.brand:hover .dot { box-shadow: 0 0 16px var(--accent); }

.brand .dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.topbar .nav {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  background: var(--accent-dark);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.btn:hover { background: var(--accent); box-shadow: 0 0 14px rgba(110, 168, 254, 0.45); }
.btn:active { transform: translateY(1px); }

.btn.ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-main);
}
.btn.ghost:hover { background: var(--bg-card); }

.btn.small { padding: 0.35rem 0.75rem; font-size: 0.85rem; }

.btn.danger { background: #b91c1c; }
.btn.danger:hover { background: var(--danger); box-shadow: 0 0 14px rgba(248, 113, 113, 0.4); }

.btn.ok { background: #059669; }
.btn.ok:hover { background: var(--ok); box-shadow: 0 0 14px rgba(52, 211, 153, 0.4); }

.btn.wide { width: 100%; }

/* ---------- 5. Panels & cards ---------- */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  padding: 2rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

/* ---------- 6. Card grid (the chosen layout) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}

.grid.tight { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.9rem; }

/* ---------- 7. Typography helpers ---------- */
h1, h2, h3 { margin: 0 0 0.75rem; font-weight: 700; line-height: 1.2; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); font-size: 0.85rem; }

.mono { font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace; }

.center { text-align: center; }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.75rem 0 1rem;
}
.section-title h2 { margin: 0; }

/* ---------- 8. Forms ---------- */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input, select.input, textarea.input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font: inherit;
  color: var(--text-main);
  background: var(--bg-deepest);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline-offset: 2px;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110, 168, 254, 0.2); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---------- 9. Status pills / badges ---------- */
.pill {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pill.active  { background: rgba(52, 211, 153, 0.15); color: var(--ok);   border: 1px solid rgba(52, 211, 153, 0.4); }
.pill.suspend{ background: rgba(248, 113, 113, 0.15); color: var(--danger); border: 1px solid rgba(248, 113, 113, 0.4); }
.pill.warn   { background: rgba(251, 191, 36, 0.15);  color: var(--warn);  border: 1px solid rgba(251, 191, 36, 0.4); }

/* ---------- 10. Quota bar ---------- */
.quota {
  height: 8px;
  background: var(--bg-deepest);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.6rem 0 0.25rem;
}
.quota > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--ok);
  transition: width 0.3s ease;
}
.quota > span.warn   { background: var(--warn); }
.quota > span.danger { background: var(--danger); }

.quota-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* ---------- 11. Stat chips (student dashboard) ---------- */
.chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
}
.chip .num { font-size: 1.9rem; font-weight: 800; color: var(--accent-bright); }
.chip .lbl { font-size: 0.82rem; color: var(--text-muted); }

/* ---------- 12. File cards ---------- */
.file-icon { font-size: 1.6rem; line-height: 1; margin-bottom: 0.5rem; color: var(--accent); }
.card .file-name {
  font-weight: 600;
  word-break: break-all;
  margin-bottom: 0.25rem;
}
.card .actions-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

/* ---------- 13. Auth screens (login) ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  padding: 2.2rem;
}
.auth-card .brand {
  justify-content: center;
  margin-bottom: 1.6rem;
  font-size: 1.3rem;
}

/* ---------- 14. Tables ---------- */
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
table.list thead th { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
table.list tbody tr:hover { background: var(--bg-card); }

/* ---------- 15. Messages & notice ---------- */
.notice {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.92rem;
  border: 1px solid;
}
.notice.ok      { background: rgba(52, 211, 153, 0.1);  border-color: rgba(52, 211, 153, 0.4); color: var(--ok); }
.notice.err     { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.4); color: var(--danger); }
.notice.warn    { background: rgba(251, 191, 36, 0.1);  border-color: rgba(251, 191, 36, 0.4); color: var(--warn); }

/* ---------- 16. Misc ---------- */
.spacer { flex: 1; }
.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.hidden { display: none !important; }

hr.sep { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ---------- 17. Drop zone (upload) ---------- */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 2.2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  background: rgba(11, 18, 32, 0.4);
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}
.dropzone.drag { border-color: var(--accent); background: rgba(110, 168, 254, 0.12); color: var(--accent-bright); }
.dropzone .big { font-size: 2.2rem; margin-bottom: 0.5rem; }
.dropzone label.linklike { color: var(--accent); cursor: pointer; }
.dropzone label.linklike:hover { color: var(--accent-bright); }

/* ---------- 17b. Tabs ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: .55rem 1.1rem; font: inherit; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
}
.tab:hover { color: var(--text-main); background: var(--bg-card); }
.tab.on { color: var(--accent-bright); border-bottom-color: var(--accent); background: var(--bg-card); }
.tabpane { display: none; }
.tabpane.on { display: block; }

/* ---------- 17c. File manager (compact scrollable list) ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}
.btn.tiny { padding: 0.25rem 0.55rem; font-size: 0.8rem; border-radius: 6px; }

.filelist-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: auto;
  max-height: 58vh;
  background: rgba(11, 18, 32, 0.35);
}
table.filelist { width: 100%; border-collapse: collapse; }
table.filelist thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-panel);
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
table.filelist td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  vertical-align: middle;
}
table.filelist tbody tr:hover { background: var(--bg-card); }
table.filelist tbody tr:last-child td { border-bottom: 0; }
table.filelist .col-check { width: 38px; text-align: center; }
table.filelist .col-size { width: 90px; white-space: nowrap; }
table.filelist .col-when { width: 110px; white-space: nowrap; color: var(--text-faint); font-size: 0.82rem; }
table.filelist .col-act { width: 1%; white-space: nowrap; text-align: right; }
table.filelist .col-name { word-break: break-word; }
table.filelist .col-name .ficon { margin-right: 0.35rem; }

input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
  vertical-align: middle;
}

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }
.empty .big { font-size: 2.4rem; margin-bottom: 0.4rem; }
.empty p { margin: 0.4rem 0 0; }

/* ---------- 17d. Dialog (popup) ---------- */
dialog.dialog {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
  color: var(--text-main);
  padding: 1.5rem;
  width: min(440px, calc(100% - 2rem));
  box-shadow: var(--shadow-panel);
}
dialog.dialog::backdrop { background: rgba(2, 6, 23, 0.65); }
dialog.dialog h2 { margin: 0 0 0.4rem; }
dialog.dialog p { margin-top: 0; }
dialog.dialog .field { margin-bottom: 0.8rem; }
dialog.dialog .row { margin-top: 0.4rem; }

/* ---------- 18. Responsive tweaks ---------- */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .shell { padding: 1rem; }
  h1 { font-size: 1.5rem; }
  .panel { padding: 1.3rem; }
  table.filelist .col-size, table.filelist .col-when { display: none; }
  .filelist-wrap { max-height: 65vh; }
}