:root {
  color-scheme: dark;
  --bg: #090f18;
  --panel: rgba(18, 29, 43, .88);
  --panel-border: rgba(125, 160, 190, .13);
  --text: #edf6ff;
  --muted: #91a3b7;
  --cyan: #36d9ed;
  --cyan-dark: #13a9c0;
  --danger: #ff7777;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.ambient {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .12;
  pointer-events: none;
  z-index: -1;
}

.ambient-one { background: #00c8e8; top: -180px; left: -120px; }
.ambient-two { background: #2768d8; bottom: -230px; right: -120px; }

.page {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -.5px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #06141c;
  background: linear-gradient(135deg, #54e7f5, #13a9c0);
  box-shadow: 0 0 24px rgba(54,217,237,.2);
  font-weight: 900;
}

.secure-label, .muted, .storage-caption { color: var(--muted); }
.secure-label { font-size: 13px; }
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #43dba2;
  margin-right: 7px;
  box-shadow: 0 0 10px rgba(67,219,162,.5);
}

.login-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  align-items: center;
  gap: 80px;
  padding: 70px 0 90px;
}

.eyebrow {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 13px;
}

h1 {
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.12;
  letter-spacing: -2px;
  margin: 0 0 18px;
}

h1 span { color: var(--cyan); }
h2 { font-size: 21px; letter-spacing: -.5px; margin: 0 0 8px; }
.intro p { color: var(--muted); font-size: 17px; max-width: 430px; }

.panel {
  background: linear-gradient(145deg, rgba(23,38,55,.94), rgba(14,23,35,.96));
  border: 1px solid var(--panel-border);
  border-radius: 19px;
  box-shadow: 0 18px 55px rgba(0,0,0,.18);
}

.login-panel { padding: 32px; }
.panel-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(54,217,237,.12);
  color: var(--cyan);
  font-size: 22px;
  margin-bottom: 20px;
}

.login-panel > p { margin: 0 0 25px; }

label {
  display: block;
  color: #c5d3e0;
  font-size: 13px;
  font-weight: 600;
  margin: 17px 0 7px;
}

input {
  width: 100%;
  border: 1px solid rgba(150,180,205,.17);
  background: rgba(5,12,21,.65);
  color: var(--text);
  border-radius: 10px;
  padding: 13px 14px;
  font: inherit;
  outline: none;
  transition: border .2s, box-shadow .2s;
}

input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(54,217,237,.1);
}

button, .primary-button, .secondary-button {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #04151c;
  background: linear-gradient(110deg, #52e4f2, #18b9d0);
  box-shadow: 0 5px 20px rgba(30,190,215,.13);
  text-decoration: none;
}

.primary-button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.login-panel .primary-button { width: 100%; margin-top: 24px; padding: 14px; }

.secondary-button {
  color: #c5d6e5;
  background: rgba(130,160,190,.1);
  border: 1px solid rgba(150,180,205,.15);
}

.secondary-button:hover { background: rgba(130,160,190,.18); }

.message { min-height: 18px; color: var(--cyan); font-size: 13px; }
.message.error { color: var(--danger); }

.welcome-row, .section-heading, .dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.welcome-row { padding: 52px 0 30px; }
.welcome-row h1 { font-size: 38px; margin-bottom: 8px; }
.welcome-row p { margin: 0; }

.stats-grid {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 18px;
  margin-bottom: 20px;
}

.stat-card { padding: 23px 25px; }
.stat-symbol { color: var(--cyan); font-size: 21px; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 7px; }
.stat-value { font-size: 29px; font-weight: 750; margin-top: 2px; }

.storage-track {
  height: 6px;
  background: rgba(255,255,255,.09);
  border-radius: 20px;
  margin-top: 13px;
  overflow: hidden;
}

.storage-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #31cce2, #61edee);
  border-radius: inherit;
}

.storage-caption { font-size: 11px; margin-top: 8px; }

.files-panel, .admin-panel { padding: 26px; margin-bottom: 20px; }
.section-heading { margin-bottom: 20px; }
.section-heading h2 { margin: 0; }
.file-actions { display: flex; gap: 9px; align-items: center; }
.upload-button { cursor: pointer; }

.file-list, .user-list { display: grid; gap: 9px; }
.file-row, .user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  background: rgba(4,12,21,.38);
  border: 1px solid rgba(150,180,205,.09);
  border-radius: 11px;
}

.file-info, .user-info { min-width: 0; }
.file-name { overflow-wrap: anywhere; font-weight: 650; }
.file-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.row-actions { display: flex; gap: 7px; flex-shrink: 0; }
.row-actions button { padding: 8px 11px; }
.delete-button { color: #ff9999; background: rgba(255,90,90,.1); }
.empty-state { padding: 35px 15px; text-align: center; color: var(--muted); }

.user-status { font-size: 12px; color: #55d9a4; }
.user-status.inactive { color: #ff9999; }
footer {
  text-align: center;
  color: #64778a;
  font-size: 12px;
  padding: 25px 0;
  margin-top: auto;
}
footer span { color: var(--cyan); padding: 0 5px; }

.dialog {
  width: min(440px, calc(100% - 30px));
  color: var(--text);
  background: #111e2c;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 28px;
}
.dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(5px); }
.dialog-content { display: block; }
.dialog-heading { margin-bottom: 20px; }
.close-button { color: var(--muted); background: transparent; font-size: 25px; padding: 2px 8px; }

.hidden { display: none !important; }

@media (max-width: 720px) {
  .page { width: min(100% - 28px, 540px); }
  .topbar { height: 68px; }
  .secure-label { font-size: 11px; }
  .login-layout { grid-template-columns: 1fr; gap: 28px; padding: 48px 0; }
  .intro h1 { font-size: 38px; }
  .intro p { font-size: 15px; }
  .login-panel { padding: 24px; }
  .welcome-row { padding: 35px 0 22px; align-items: flex-start; }
  .welcome-row h1 { font-size: 30px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 23px; }
  .files-panel, .admin-panel { padding: 17px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .file-actions { width: 100%; flex-wrap: wrap; }
  .file-actions button, .file-actions label { flex: 1; text-align: center; }
  .file-row, .user-row { align-items: flex-start; }
  .row-actions { flex-direction: column; }
}

@media (max-width: 390px) {
  .stats-grid { grid-template-columns: 1fr; }
  .secure-label { font-size: 10px; }
}
