:root {
  --bg-0: #05080d;
  --bg-1: #071018;
  --bg-2: #0b141d;
  --panel: rgba(12, 21, 31, 0.92);
  --panel-2: rgba(16, 28, 41, 0.94);
  --border: rgba(102, 140, 180, 0.25);
  --border-strong: rgba(112, 170, 220, 0.42);
  --text: #f2f7ff;
  --muted: #91a4b8;
  --muted-2: #607489;
  --primary: #37d783;
  --primary-2: #1fb96a;
  --danger: #ff5870;
  --danger-2: #dd3f56;
  --warning: #ffc857;
  --shadow: rgba(0, 0, 0, 0.45);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at 10% 15%, rgba(55, 215, 131, 0.20), transparent 28rem),
    radial-gradient(circle at 90% 10%, rgba(54, 141, 255, 0.13), transparent 28rem),
    linear-gradient(145deg, var(--bg-0), var(--bg-1) 45%, #020407);
  background-attachment: fixed;
}

button,
input,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

button {
  border: 0;
}

.hidden {
  display: none !important;
}

/* LOGIN */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  background: linear-gradient(180deg, rgba(16, 28, 41, 0.96), rgba(7, 14, 22, 0.96));
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 30px 100px var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.login-brand h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.login-brand p {
  margin: 2px 0 0;
  color: var(--muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-form label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.login-form input {
  margin-bottom: 8px;
}

/* APP */

.app-shell {
  min-height: 100vh;
}

.topbar {
  height: 76px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(4, 10, 16, 0.84);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.logo {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #021109;
  font-weight: 950;
  letter-spacing: -0.08em;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent),
    linear-gradient(135deg, var(--primary), #39a8ff);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18) inset,
    0 16px 40px rgba(55, 215, 131, 0.20);
}

.brand-title {
  font-weight: 900;
  font-size: 21px;
  letter-spacing: -0.05em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-top: 1px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.main {
  width: min(1500px, calc(100% - 32px));
  margin: 28px auto;
}

.panel {
  background: linear-gradient(180deg, rgba(12, 21, 31, 0.92), rgba(8, 14, 22, 0.94));
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 28px 90px var(--shadow);
  overflow: hidden;
}

.panel-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.panel-header h1 {
  margin: 0 0 12px;
  font-size: 30px;
  letter-spacing: -0.06em;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* BREADCRUMB */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.crumb {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 11px;
  cursor: pointer;
  transition: 0.15s ease;
}

.crumb:hover {
  border-color: var(--border-strong);
  background: rgba(55, 215, 131, 0.10);
}

.crumb-sep {
  color: var(--muted-2);
}

/* BUTTONS / INPUTS */

.btn {
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 13px;
  color: var(--text);
  background: rgba(72, 103, 138, 0.32);
  border: 1px solid rgba(120, 160, 210, 0.19);
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition:
    transform 0.12s ease,
    background 0.12s ease,
    border-color 0.12s ease,
    opacity 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  color: #021109;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: rgba(116, 255, 180, 0.45);
}

.btn.danger {
  color: white;
  background: linear-gradient(135deg, var(--danger), var(--danger-2));
  border-color: rgba(255, 120, 140, 0.42);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.045);
}

.btn.tiny {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.btn.full {
  width: 100%;
}

input {
  width: 100%;
  background: rgba(3, 9, 15, 0.86);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  outline: none;
  padding: 12px 13px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

input:focus {
  border-color: rgba(55, 215, 131, 0.72);
  box-shadow: 0 0 0 4px rgba(55, 215, 131, 0.10);
}

/* STATUS */

.status-bar {
  margin: 18px 24px 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.status-bar.error {
  border-color: rgba(255, 88, 112, 0.45);
  background: rgba(255, 88, 112, 0.12);
}

/* FILE TABLE */

.file-card {
  margin: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(5, 11, 18, 0.54);
}

.table-head,
.file-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.9fr) 130px 130px 190px minmax(260px, 0.9fr);
  gap: 12px;
  align-items: center;
}

.table-head {
  padding: 13px 16px;
  color: #a8bad0;
  font-size: 13px;
  font-weight: 900;
  background: rgba(16, 28, 41, 0.82);
  border-bottom: 1px solid var(--border);
}

.file-row {
  min-height: 62px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(102, 140, 180, 0.16);
  transition: background 0.12s ease;
}

.file-row:last-child {
  border-bottom: 0;
}

.file-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.parent-row {
  background: rgba(55, 215, 131, 0.055);
}

.file-name-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.file-name-button {
  min-width: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font-weight: 850;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name-button:hover {
  color: var(--primary);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.badge {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.badge.blocked {
  color: #ffd2d9;
  background: rgba(255, 88, 112, 0.12);
  border: 1px solid rgba(255, 88, 112, 0.24);
}

.loading,
.empty-state {
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state.compact {
  padding: 28px 20px;
}

.empty-icon {
  font-size: 38px;
  margin-bottom: 10px;
}

.empty-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 4px;
}

.empty-text {
  color: var(--muted);
}

/* MODAL */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(12px);
  animation: fadeIn 0.12s ease;
}

.modal {
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  border-radius: 26px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(18, 31, 46, 0.98), rgba(7, 14, 22, 0.98));
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.65);
  animation: modalIn 0.14s ease;
}

.modal-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  padding: 18px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-form label {
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}

.hint {
  color: var(--muted);
  margin: 4px 0 0;
  font-size: 14px;
}

.danger-text {
  color: #ffb7c1;
}

.delete-target {
  padding: 12px 14px;
  margin: 12px 0;
  border-radius: 14px;
  background: rgba(255, 88, 112, 0.10);
  border: 1px solid rgba(255, 88, 112, 0.26);
  font-weight: 900;
  word-break: break-word;
}

/* UPLOAD */

.hidden-file-input {
  display: none;
}

.upload-modal-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dropzone {
  padding: 30px 20px;
  border-radius: 20px;
  border: 1px dashed rgba(130, 180, 230, 0.42);
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.12s ease,
    background 0.12s ease,
    transform 0.12s ease;
}

.dropzone:hover,
.dropzone.dragover {
  transform: translateY(-1px);
  border-color: rgba(55, 215, 131, 0.76);
  background: rgba(55, 215, 131, 0.08);
}

.drop-icon {
  font-size: 42px;
  margin-bottom: 8px;
}

.drop-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.drop-subtitle {
  color: var(--muted);
  margin-top: 4px;
  font-size: 14px;
}

.selected-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.selected-file {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(102, 140, 180, 0.18);
}

.selected-file span:first-child {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.selected-file span:last-child {
  color: var(--muted);
  flex: 0 0 auto;
}

.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.progress-bar {
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(102, 140, 180, 0.18);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #39a8ff);
  transition: width 0.12s linear;
}

/* TOASTS */

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: min(360px, calc(100vw - 36px));
  padding: 13px 15px;
  border-radius: 15px;
  color: var(--text);
  background: rgba(18, 31, 46, 0.98);
  border: 1px solid var(--border-strong);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  animation: toastIn 0.16s ease;
  font-weight: 800;
}

.toast.success {
  border-color: rgba(55, 215, 131, 0.46);
}

.toast.error {
  border-color: rgba(255, 88, 112, 0.56);
}

.toast.hide {
  animation: toastOut 0.22s ease forwards;
}

/* ALERT */

.alert {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-weight: 800;
}

.alert.error {
  color: #ffd2d9;
  background: rgba(255, 88, 112, 0.13);
  border: 1px solid rgba(255, 88, 112, 0.28);
}

/* ANIMATIONS */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* RESPONSIVE */

@media (max-width: 980px) {
  .table-head {
    display: none;
  }

  .file-row {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
    padding: 14px;
  }

  .row-actions {
    margin-top: 4px;
  }

  .file-row > div:nth-child(2)::before {
    content: "Type : ";
    color: var(--muted);
    font-weight: 800;
  }

  .file-row > div:nth-child(3)::before {
    content: "Taille : ";
    color: var(--muted);
    font-weight: 800;
  }

  .file-row > div:nth-child(4)::before {
    content: "Modifié : ";
    color: var(--muted);
    font-weight: 800;
  }
}

@media (max-width: 720px) {
  .topbar {
    height: auto;
    padding: 14px;
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .topbar-actions,
  .toolbar,
  .panel-header,
  .modal-footer {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .main {
    width: min(100% - 18px, 1500px);
    margin: 10px auto;
  }

  .panel {
    border-radius: 20px;
  }

  .panel-header {
    padding: 18px;
  }

  .file-card {
    margin: 18px;
  }

  .btn {
    width: 100%;
  }
}

/* TRASH */

.trash-modal-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trash-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trash-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px;
  border-radius: 16px;
  border: 1px solid rgba(102, 140, 180, 0.20);
  background: rgba(255, 255, 255, 0.045);
}

.trash-info {
  min-width: 0;
}

.trash-name {
  font-weight: 900;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trash-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.trash-path {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .trash-row {
    grid-template-columns: 1fr;
  }

  .trash-actions {
    justify-content: stretch;
  }
}

/* UPLOAD SPEED DETAILS */

.progress-details {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.progress-speed {
  color: var(--primary);
}

@media (max-width: 720px) {
  .progress-details {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* PUBLIC DOWNLOAD PAGE */

.public-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.public-card {
  width: min(520px, 100%);
  background: linear-gradient(180deg, rgba(16, 28, 41, 0.96), rgba(7, 14, 22, 0.96));
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 30px 100px var(--shadow);
}

.public-file {
  text-align: center;
  margin: 20px 0 24px;
}

.public-icon {
  font-size: 54px;
  margin-bottom: 10px;
}

.public-file h2 {
  margin: 0;
  word-break: break-word;
}

/* TRASH + PUBLIC LINKS LISTS */

.trash-modal-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trash-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trash-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px;
  border-radius: 16px;
  border: 1px solid rgba(102, 140, 180, 0.20);
  background: rgba(255, 255, 255, 0.045);
}

.trash-info {
  min-width: 0;
}

.trash-name {
  font-weight: 900;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trash-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.trash-path {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .trash-row {
    grid-template-columns: 1fr;
  }

  .trash-actions {
    justify-content: stretch;
  }
}

/* ADMIN */

.admin-modal {
  width: min(1100px, calc(100vw - 48px));
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.admin-tab {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 850;
}

.admin-tab.active {
  color: #021109;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: rgba(116, 255, 180, 0.45);
}

.admin-content {
  min-height: 260px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.admin-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(102, 140, 180, 0.20);
  background: rgba(255, 255, 255, 0.045);
}

.admin-kpi {
  font-size: 26px;
  font-weight: 950;
  letter-spacing: -0.05em;
  color: var(--text);
}

.admin-label {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.admin-section {
  margin-top: 18px;
}

.admin-section h3 {
  margin: 0 0 12px;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px;
  border-radius: 16px;
  border: 1px solid rgba(102, 140, 180, 0.20);
  background: rgba(255, 255, 255, 0.045);
}

.admin-row-main {
  min-width: 0;
}

.admin-row-title {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--text);
  font-weight: 950;
  word-break: break-word;
}

.admin-row-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(55, 215, 131, 0.10);
  border: 1px solid rgba(55, 215, 131, 0.22);
  font-size: 12px;
  font-weight: 900;
}

.admin-badge.danger {
  color: #ffb7c1;
  background: rgba(255, 88, 112, 0.12);
  border-color: rgba(255, 88, 112, 0.28);
}

.admin-table {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(102, 140, 180, 0.20);
  border-radius: 16px;
  overflow: hidden;
}

.admin-table > div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid rgba(102, 140, 180, 0.14);
}

.admin-table > div:last-child {
  border-bottom: 0;
}

.admin-table strong {
  color: var(--muted);
}

.admin-table span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-select {
  width: 100%;
  background: rgba(3, 9, 15, 0.86);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  outline: none;
  padding: 12px 13px;
}

.admin-log-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-logs-output {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 440px;
  overflow: auto;
  border: 1px solid rgba(102, 140, 180, 0.20);
  border-radius: 16px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.admin-log-line {
  padding: 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(102, 140, 180, 0.12);
}

.admin-log-line code {
  color: var(--muted);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-actions-block {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .admin-modal {
    width: 100%;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }

  .admin-row-actions {
    justify-content: stretch;
  }

  .admin-section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-table > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* DEDICATED ADMIN PAGE */

.admin-page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background:
    radial-gradient(circle at 0% 0%, rgba(55, 215, 131, 0.14), transparent 28rem),
    linear-gradient(145deg, var(--bg-0), var(--bg-1) 45%, #020407);
}

.admin-sidebar {
  border-right: 1px solid var(--border);
  background: rgba(4, 10, 16, 0.86);
  backdrop-filter: blur(16px);
  padding: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.admin-back {
  display: inline-flex;
  margin-bottom: 24px;
  color: var(--muted);
  font-weight: 850;
}

.admin-back:hover {
  color: var(--primary);
}

.admin-brand {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-bottom: 28px;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-nav-item {
  width: 100%;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(102, 140, 180, 0.18);
  border-radius: 14px;
  padding: 12px 13px;
  cursor: pointer;
  font-weight: 900;
}

.admin-nav-item:hover {
  border-color: var(--border-strong);
}

.admin-nav-item.active {
  color: #021109;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: rgba(116, 255, 180, 0.45);
}

.admin-main {
  min-width: 0;
  padding: 28px;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.admin-top h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.06em;
}

.admin-top p {
  margin: 5px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.admin-page-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-grid-page {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.admin-stat-card,
.admin-page-panel {
  background: linear-gradient(180deg, rgba(12, 21, 31, 0.92), rgba(8, 14, 22, 0.94));
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

.admin-stat-card {
  padding: 18px;
}

.admin-stat-value {
  color: var(--text);
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -0.06em;
}

.admin-stat-label {
  margin-top: 5px;
  color: var(--muted);
  font-weight: 850;
  font-size: 13px;
}

.admin-page-panel {
  padding: 20px;
}

.admin-page-panel h2 {
  margin: 0 0 16px;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.admin-page-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.admin-info-table {
  border: 1px solid rgba(102, 140, 180, 0.20);
  border-radius: 16px;
  overflow: hidden;
}

.admin-info-table > div {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(102, 140, 180, 0.14);
}

.admin-info-table > div:last-child {
  border-bottom: 0;
}

.admin-info-table strong {
  color: var(--muted);
}

.admin-info-table span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-inline-form {
  display: grid;
  grid-template-columns: 1fr 1fr 160px auto;
  gap: 10px;
  align-items: center;
}

.admin-select {
  width: 100%;
  background: rgba(3, 9, 15, 0.86);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  outline: none;
  padding: 12px 13px;
}

.admin-table-wrap {
  overflow: auto;
  border: 1px solid rgba(102, 140, 180, 0.20);
  border-radius: 16px;
}

.admin-data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.admin-data-table th,
.admin-data-table td {
  padding: 12px 13px;
  border-bottom: 1px solid rgba(102, 140, 180, 0.14);
  text-align: left;
  vertical-align: middle;
}

.admin-data-table th {
  color: var(--muted);
  font-size: 13px;
  background: rgba(16, 28, 41, 0.82);
}

.admin-data-table tr:last-child td {
  border-bottom: 0;
}

.admin-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-url-cell {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-pill {
  display: inline-flex;
  margin-left: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(55, 215, 131, 0.10);
  border: 1px solid rgba(55, 215, 131, 0.22);
  font-size: 12px;
  font-weight: 900;
}

.admin-pill.danger {
  color: #ffb7c1;
  background: rgba(255, 88, 112, 0.12);
  border-color: rgba(255, 88, 112, 0.28);
}

.admin-log-selector,
.admin-maintenance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-logs-output {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
  border: 1px solid rgba(102, 140, 180, 0.20);
  border-radius: 16px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.admin-log-line {
  padding: 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(102, 140, 180, 0.12);
}

.admin-log-line code {
  color: var(--muted);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 900px) {
  .admin-page-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .admin-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .admin-main {
    padding: 16px;
  }

  .admin-top {
    flex-direction: column;
  }

  .admin-inline-form {
    grid-template-columns: 1fr;
  }

  .admin-info-table > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ACCOUNT PAGE */

.account-page-shell {
  min-height: 100vh;
}

.account-topbar {
  min-height: 76px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(4, 10, 16, 0.84);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.account-main {
  width: min(1300px, calc(100% - 32px));
  margin: 28px auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
}

.account-panel {
  background: linear-gradient(180deg, rgba(12, 21, 31, 0.92), rgba(8, 14, 22, 0.94));
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
  padding: 20px;
}

.account-panel h2 {
  margin: 0 0 16px;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-form label {
  color: var(--muted);
  font-weight: 850;
  font-size: 14px;
}

.account-info-table {
  border: 1px solid rgba(102, 140, 180, 0.20);
  border-radius: 16px;
  overflow: hidden;
}

.account-info-table > div {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(102, 140, 180, 0.14);
}

.account-info-table > div:last-child {
  border-bottom: 0;
}

.account-info-table strong {
  color: var(--muted);
}

.account-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px;
  border-radius: 16px;
  border: 1px solid rgba(102, 140, 180, 0.20);
  background: rgba(255, 255, 255, 0.045);
}

.account-row-title {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--text);
  font-weight: 950;
}

.account-row-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-row-actions {
  display: flex;
  gap: 8px;
}

.account-logs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 440px;
  overflow: auto;
}

.simple-account-form {
  grid-template-columns: 1fr 1fr auto;
}

@media (max-width: 860px) {
  .account-topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    gap: 14px;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .account-info-table > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .account-row {
    grid-template-columns: 1fr;
  }

  .simple-account-form {
    grid-template-columns: 1fr;
  }
}
