:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #222633;
  --border: #2e3345;
  --text: #e8eaef;
  --muted: #8b92a8;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --accent: #22d3ee;
  --success: #34d399;
  --danger: #f87171;
  --radius: 12px;
  --font: "DM Sans", system-ui, sans-serif;
  /* VIP — champagne gold palette */
  --vip-gold: #c6a962;
  --vip-gold-light: #e8d9b0;
  --vip-gold-deep: #8a7344;
  --vip-champagne: #f5eedc;
  --vip-bg: rgba(18, 16, 13, 0.92);
  --vip-border: rgba(198, 169, 98, 0.42);
  --vip-glow: rgba(198, 169, 98, 0.18);
  --vip-soft: rgba(198, 169, 98, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
}

.btn-light {
  background: #fff;
  color: var(--bg);
}

.btn-outline-light {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .3);
  color: #fff;
}

.btn-outline-primary {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary-hover);
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}

.btn-outline-warning {
  background: transparent;
  border: 1px solid #fbbf24;
  color: #fbbf24;
}

.btn-outline-warning:hover {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
}

.btn-file-password.is-active {
  border-color: #fbbf24;
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.1);
}

.btn-success {
  background: var(--success);
  color: #0f1117;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-link {
  background: none;
  color: var(--muted);
}

.w-100 {
  width: 100%;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-4 {
  margin-bottom: 1rem;
}

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

.text-center {
  text-align: center;
}

.small {
  font-size: 0.85rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-success {
  background: rgba(52, 211, 153, .15);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, .3);
}

.alert-danger,
.alert-error {
  background: rgba(248, 113, 113, .15);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, .3);
}

/* Home */
.page-home {
  background: linear-gradient(160deg, #0f1117 0%, #1a1040 50%, #0f1117 100%);
}

.home-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.home-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand i {
  color: var(--primary-hover);
}

.home-hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
  position: relative;
}

.home-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1rem;
}

.home-hero h1 span {
  color: var(--accent);
}

.home-hero p {
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 2rem;
  font-size: 1.05rem;
}

.home-flash {
  max-width: 640px;
  margin: 0 auto 1rem;
  padding: 0 1rem;
}

.btn-google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.btn-google:hover {
  background: #f8f9fa;
  color: #1f1f1f;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}

.hero-cta {
  margin-top: 0.5rem;
}

.home-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  padding: 2rem 0 4rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
}

.feature-card i {
  font-size: 2rem;
  color: var(--primary-hover);
  margin-bottom: 0.75rem;
  display: block;
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Login */
.page-login {
  min-height: 100vh;
  background: var(--bg);
}

.login-wrap {
  flex: 1;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
}

.login-icon {
  font-size: 2.5rem;
  color: var(--primary-hover);
  margin-bottom: 0.5rem;
}

.login-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.btn-google {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  margin-top: 1rem;
}

.btn-google:hover {
  background: #f8f8f8;
  color: #111;
}

/* Admin layout — 2 cột */
.admin-layout {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 1.25rem 1.25rem;
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.sidebar-brand i {
  color: var(--primary-hover);
  font-size: 1.3rem;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92rem;
}

.sidebar-nav a:hover {
  background: var(--surface2);
  color: var(--text);
}

.sidebar-nav a.active {
  background: rgba(99, 102, 241, .2);
  color: var(--primary-hover);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.sidebar-user .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.sidebar-user .name {
  font-weight: 600;
}

.sidebar-user .email {
  color: var(--muted);
  font-size: 0.78rem;
  word-break: break-all;
}

.sidebar-logout {
  padding: 0.75rem 1.25rem;
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-logout:hover {
  color: var(--danger);
}

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-content {
  flex: 1;
  padding: 1.75rem 2rem;
  overflow: auto;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  padding: 0.75rem 2rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-footer strong {
  color: var(--text);
}

.admin-footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
  border-radius: 6px;
  padding: 0.1rem 0.35rem;
  margin: -0.1rem -0.35rem;
  transition: color 0.15s, background 0.15s;
}

.admin-footer-link:hover {
  color: var(--text);
  background: rgba(99, 102, 241, 0.12);
  text-decoration: none;
}

.admin-footer-link strong {
  color: var(--primary-hover);
}

.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-card.accent {
  border-color: var(--primary);
  background: rgba(99, 102, 241, .08);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.stat-sub {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.online-stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 768px) {
  .online-stats-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1rem 0.85rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dashboard-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.dashboard-chart-head h5 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.3;
}

.dashboard-chart-head h5 i {
  color: var(--primary-hover);
}

.dashboard-chart-sub {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 0.15rem;
}

.dashboard-chart-body {
  position: relative;
  height: 180px;
  flex: 1;
}

@media (max-width: 1280px) {
  .dashboard-charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .dashboard-charts {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-body {
    height: 200px;
  }
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.quick-link {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  color: var(--text);
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.quick-link:hover {
  border-color: var(--primary);
  color: var(--primary-hover);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.file-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.file-url,
code {
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--surface2);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.btn-copy {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.2rem;
  vertical-align: middle;
}

.btn-copy:hover {
  color: var(--accent);
}

.badge-user {
  background: rgba(99, 102, 241, .2);
  color: var(--primary-hover);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.78rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.bg-info {
  background: rgba(34, 211, 238, .2);
  color: var(--accent);
}

.bg-secondary {
  background: var(--surface2);
  color: var(--muted);
}

.bg-primary {
  background: var(--primary);
  color: #fff;
}

.bg-danger {
  background: rgba(248, 113, 113, .2);
  color: var(--danger);
}

.bg-success {
  background: rgba(52, 211, 153, .2);
  color: var(--success);
}

.hidden {
  display: none !important;
}

.upload-intro {
  margin: -0.5rem 0 1.25rem;
}

.multi-upload {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.25rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  background: linear-gradient(180deg, rgba(99, 102, 241, .04) 0%, transparent 100%);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, .08);
  transform: translateY(-1px);
}

.upload-zone.uploading {
  pointer-events: none;
  opacity: 0.75;
}

.upload-zone-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: rgba(99, 102, 241, .15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-zone-icon i {
  font-size: 1.75rem;
  color: var(--primary-hover);
}

.upload-zone-title {
  font-weight: 600;
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.upload-zone-hint {
  margin: 0;
  font-size: 0.88rem;
}

.upload-zone-link {
  color: var(--accent);
  font-weight: 600;
}

.upload-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--muted);
}

.upload-summary-dot {
  opacity: 0.5;
}

.upload-clear-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
}

.upload-clear-btn:hover {
  text-decoration: underline;
}

.upload-queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
}

.upload-queue-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  animation: uploadItemIn 0.25s ease;
}

@keyframes uploadItemIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.upload-queue-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(99, 102, 241, .12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.upload-queue-icon i {
  color: var(--primary-hover);
  font-size: 1.1rem;
}

.upload-queue-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.upload-queue-name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-queue-size {
  font-size: 0.78rem;
  color: var(--muted);
}

.upload-queue-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  line-height: 1;
}

.upload-queue-remove:hover {
  color: var(--danger);
  background: rgba(248, 113, 113, .1);
}

.upload-progress-panel {
  padding: 0.25rem 0;
}

.upload-progress-track {
  position: relative;
  height: 10px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.15s ease;
}

.upload-progress-glow {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  animation: uploadShimmer 1.2s infinite;
  pointer-events: none;
}

@keyframes uploadShimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(200%);
  }
}

.upload-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.82rem;
}

.upload-progress-pct {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.upload-progress-status {
  color: var(--muted);
}

.upload-result {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.upload-result-success {
  background: rgba(52, 211, 153, .12);
  border: 1px solid rgba(52, 211, 153, .3);
  color: var(--success);
}

.upload-result-error {
  background: rgba(248, 113, 113, .12);
  border: 1px solid rgba(248, 113, 113, .3);
  color: var(--danger);
}

.upload-result-errors {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.upload-result i {
  margin-right: 0.35rem;
}

.upload-submit-btn {
  margin-top: 0.25rem;
}

.upload-submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.upload-password-panel {
  padding: 0.85rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(99, 102, 241, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.upload-password-toggle {
  margin: 0;
  font-size: 0.9rem;
}

.upload-password-toggle i {
  color: #fbbf24;
  margin-right: 0.15rem;
}

.upload-password-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-file-password {
  min-height: 100vh;
  background: var(--bg);
}

.file-password-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.file-password-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
  padding: 2rem 1.75rem;
}

.file-password-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  font-size: 1.75rem;
}

.file-password-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.file-password-name {
  margin: 0 0 0.5rem;
  font-weight: 600;
  word-break: break-word;
}

.file-password-desc {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
}

.file-password-form {
  text-align: left;
}

.file-password-label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}

.file-password-submit {
  margin-top: 1rem;
}

.file-password-alert {
  text-align: left;
  margin-bottom: 1rem;
}

.file-password-dialog {
  max-width: 440px;
}

.file-password-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.file-password-modal-name {
  margin: 0;
  font-weight: 700;
  word-break: break-word;
}

.file-password-modal-hint {
  margin: 0;
  font-size: 0.88rem;
}

.file-password-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.file-password-modal-error {
  margin: 0;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.image-resize-grid {
  margin-top: 0.75rem;
  max-width: 420px;
}

.format-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.format-check input {
  accent-color: var(--primary);
}

.quota-form {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.quota-mb-input {
  width: 88px !important;
}

.speed-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 168px;
}

.speed-form-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.speed-dir {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--primary-hover);
  width: 1rem;
  text-align: center;
}

.speed-kbps-input {
  width: 72px !important;
}

.speed-form-meta {
  font-size: 0.68rem;
  line-height: 1.3;
}

.user-access-table .speed-form .btn {
  align-self: flex-start;
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.level-card {
  display: flex;
  flex-direction: column;
}

.level-card-system {
  border-color: rgba(99, 102, 241, .25);
}

.level-card-new {
  border-style: dashed;
}

.level-card-head {
  margin-bottom: 0.85rem;
}

.level-card-title {
  margin: 0;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.level-card-meta {
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

.level-form-grid {
  gap: 0.75rem;
}

.level-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 0.85rem 0;
  padding: 0.65rem 0.75rem;
  background: var(--surface2);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.level-preview i {
  color: var(--primary-hover);
  margin-right: 0.2rem;
}

.level-form-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.level-badge-vip {
  background: var(--vip-soft);
  color: var(--vip-gold-light);
  border: 1px solid var(--vip-border);
}

.level-badge-admin {
  background: rgba(99, 102, 241, .15);
  color: var(--primary-hover);
}

.level-select {
  min-width: 120px;
  max-width: 160px;
}

.level-assign-form {
  margin: 0;
}

.user-level-cell {
  min-width: 200px;
  vertical-align: top;
}

.user-custom-limits-form {
  margin-top: 0.65rem;
  padding: 0.65rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.06);
}

.user-custom-limits-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.user-custom-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
}

.user-custom-field span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.user-custom-unlimited {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  padding: 0.4rem 0.55rem;
}

.user-custom-save {
  width: 100%;
}

.user-custom-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.35rem;
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
  font-size: 0.72rem;
}

.user-limits-cell {
  min-width: 130px;
  font-size: 0.78rem;
}

.user-limits-line {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  line-height: 1.45;
}

.user-limits-line i {
  color: var(--primary-hover);
  width: 0.9rem;
}

.quota-mb-input {
  width: 72px !important;
}

.quota-unit {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.quota-unlimited-check {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
}

.quota-unlimited-check input {
  accent-color: var(--primary);
}

.system-limit-check {
  align-items: flex-start;
  padding: 0.65rem 0;
}

.system-limit-check span {
  line-height: 1.45;
}

.notify-event-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.notify-event-check {
  align-items: flex-start;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.notify-event-check span {
  line-height: 1.45;
}

.notify-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.form-control-sm {
  width: 70px;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.82rem;
}

.form-control,
.code-area {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
}

.form-control:focus,
.code-area:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}

.code-area {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  resize: vertical;
}

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

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  font-weight: 600;
  font-size: 0.88rem;
}

.form-field small {
  font-size: 0.78rem;
}

.sidebar-divider {
  padding: 0.75rem 1rem 0.25rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.track-section {
  margin-bottom: 1.25rem;
}

.track-section label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
}

.track-section label small {
  font-weight: 400;
  color: var(--muted);
}

.meta-preview {
  background: var(--surface2);
}

.preview-snippet {
  margin-top: 0.5rem;
}

.preview-title {
  color: #8ab4f8;
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}

.preview-url {
  color: #bdc1c6;
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
}

.preview-desc {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

/* OG Image picker (meta admin) */
.og-image-picker {
  margin-top: 0.35rem;
}

.form-actions {
  margin-top: 1.25rem;
  padding-top: 0.5rem;
}

.content-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.content-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.content-tab:hover {
  border-color: var(--primary);
  color: var(--text);
  text-decoration: none;
}

.content-tab.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, .12);
  color: var(--primary-hover);
}

.content-section-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.content-section-desc {
  margin: 0 0 1.25rem;
  font-size: 0.88rem;
}

.content-subtitle {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.content-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.content-feature-block {
  padding: 1rem;
  margin-bottom: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .02);
}

.system-env-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(251, 191, 36, .15);
  color: #fbbf24;
}

.system-ext-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

.og-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.og-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.og-mode-tab:hover {
  border-color: var(--primary);
  color: var(--text);
}

.og-mode-tab.active {
  background: rgba(99, 102, 241, .15);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.og-mode-panel {
  margin-bottom: 1rem;
}

.og-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1rem;
  text-align: center;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(99, 102, 241, .04), transparent);
  transition: border-color 0.2s, background 0.2s;
}

.og-upload-zone:hover,
.og-upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, .08);
}

.og-upload-zone i {
  font-size: 2rem;
  color: var(--primary-hover);
  display: block;
  margin-bottom: 0.5rem;
}

.og-upload-zone p {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
}

.og-upload-link {
  color: var(--accent);
  font-weight: 600;
}

.og-upload-status {
  margin-top: 0.65rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.og-upload-status.is-error {
  color: var(--danger);
}

.og-upload-status.is-success {
  color: var(--success);
}

.og-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.65rem;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.25rem;
}

.og-library-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.og-library-item:hover {
  border-color: var(--primary);
}

.og-library-item.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .2);
}

.og-library-item img {
  width: 100%;
  aspect-ratio: 1.2;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  background: var(--bg);
}

.og-library-name {
  font-size: 0.68rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.og-library-empty {
  font-size: 0.88rem;
  margin: 0;
}

.og-image-preview-wrap {
  margin-top: 0.5rem;
}

.og-preview-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.og-image-preview {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface2);
  max-width: 420px;
}

.og-image-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
}

.og-preview-url {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  color: var(--accent);
  word-break: break-all;
}

.alert-info {
  background: rgba(99, 102, 241, .12);
  color: var(--primary-hover);
  border: 1px solid rgba(99, 102, 241, .25);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
}

.alert-blocked {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: rgba(248, 113, 113, .12);
  border: 1px solid rgba(248, 113, 113, .35);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  color: #fecaca;
}

.alert-blocked-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(248, 113, 113, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alert-blocked-icon i {
  font-size: 1.35rem;
  color: var(--danger);
}

.alert-blocked strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
  color: #fff;
}

.alert-blocked p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

.user-admin-hint {
  margin: -0.25rem 0 1.25rem;
  font-size: 0.88rem;
  max-width: 720px;
}

.user-cell-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.user-cell-email {
  font-size: 0.78rem;
  color: var(--muted);
}

.user-row-blocked {
  background: rgba(248, 113, 113, .04);
}

.access-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.2s;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s, background 0.2s;
}

.toggle-switch input:checked+.toggle-slider:not(.toggle-slider-danger):not(.toggle-slider-secondary) {
  background: rgba(52, 211, 153, .25);
  border-color: var(--success);
}

.toggle-switch input:checked+.toggle-slider:not(.toggle-slider-danger):not(.toggle-slider-secondary)::after {
  transform: translateX(20px);
  background: var(--success);
}

.toggle-switch input:checked+.toggle-slider-danger {
  background: rgba(248, 113, 113, .25);
  border-color: var(--danger);
}

.toggle-switch input:checked+.toggle-slider-danger::after {
  transform: translateX(20px);
  background: var(--danger);
}

.toggle-switch input:checked+.toggle-slider-secondary {
  background: rgba(99, 102, 241, .2);
  border-color: var(--primary);
}

.toggle-switch input:checked+.toggle-slider-secondary::after {
  transform: translateX(20px);
  background: var(--primary-hover);
}

.toggle-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.toggle-title {
  font-weight: 600;
  font-size: 0.85rem;
}

.toggle-desc {
  font-size: 0.75rem;
  color: var(--muted);
}

.badge-warning {
  background: rgba(251, 191, 36, .2);
  color: #fbbf24;
}

.text-dark {
  color: inherit;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.files-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.files-pagination-info {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.files-pagination .btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.files-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.files-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.files-filter-label {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.files-filter-select {
  min-width: min(320px, 100%);
  max-width: 420px;
}

.user-filter-combobox {
  position: relative;
  min-width: min(320px, 100%);
  max-width: 420px;
  flex: 1;
}

.user-filter-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.user-filter-search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 1;
}

.user-filter-input {
  width: 100%;
  padding-left: 2.25rem !important;
  padding-right: 2.25rem !important;
}

.user-filter-clear {
  position: absolute;
  right: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.user-filter-clear:hover {
  color: var(--text);
  background: rgba(148, 163, 184, .12);
}

.user-filter-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 40;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
}

.user-filter-dropdown.hidden {
  display: none;
}

.user-filter-option {
  padding: 0.55rem 0.7rem;
  border-radius: 7px;
  font-size: 0.86rem;
  cursor: pointer;
  color: var(--text);
  line-height: 1.35;
  transition: background 0.12s;
}

.user-filter-option:hover,
.user-filter-option.active {
  background: rgba(99, 102, 241, .14);
  color: var(--primary-hover);
}

.user-filter-option-all {
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.2rem;
  border-radius: 7px 7px 0 0;
}

.user-filter-empty {
  padding: 0.75rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.files-toolbar-meta {
  font-size: 0.82rem;
}

/* Admin files list */
.admin-files-card {
  padding: 0;
  overflow: hidden;
}

.admin-files-table th:first-child,
.admin-files-table td:first-child {
  padding-left: 1.1rem;
}

.admin-files-table th:last-child,
.admin-files-table td:last-child {
  padding-right: 1.1rem;
}

.admin-files-table .file-name-cell {
  min-width: 240px;
  max-width: 380px;
}

.admin-file-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}

.admin-file-meta .file-name {
  font-weight: 600;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}

.admin-file-url-copy {
  max-width: 100%;
}

.admin-file-url-copy .file-url {
  font-size: 0.72rem;
}

.admin-file-owner {
  min-width: 140px;
  max-width: 200px;
}

.admin-file-delete-form {
  display: inline;
  margin: 0;
}

.file-thumb-trigger {
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
  font: inherit;
  color: inherit;
  line-height: 0;
}

.file-thumb-trigger:hover .file-thumb,
.file-thumb-trigger:focus-visible .file-thumb {
  border-color: rgba(99, 102, 241, .55);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, .18);
}

.file-thumb-trigger:focus-visible {
  outline: none;
}

.file-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.file-type-image {
  background: rgba(56, 189, 248, .18);
  color: #38bdf8;
}

.file-type-video {
  background: rgba(167, 139, 250, .18);
  color: #a78bfa;
}

.file-type-audio {
  background: rgba(52, 211, 153, .18);
  color: #34d399;
}

.file-type-pdf {
  background: rgba(248, 113, 113, .18);
  color: #f87171;
}

.file-type-file {
  background: rgba(148, 163, 184, .15);
  color: var(--muted);
}

.admin-files-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.admin-files-empty-icon {
  font-size: 2.25rem;
  opacity: 0.45;
  margin-bottom: 0.5rem;
}

.admin-files-empty p {
  margin: 0;
  font-size: 0.92rem;
}

.online-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.online-card {
  display: flex;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.online-card.guest {
  border-left: 3px solid var(--muted);
}

.online-card.user {
  border-left: 3px solid var(--success);
}

.online-type {
  font-weight: 600;
  min-width: 110px;
  font-size: 0.88rem;
}

.online-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  align-items: center;
}

.online-ip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.45rem;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--accent);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.online-ip:hover {
  background: rgba(34, 211, 238, .08);
  border-color: rgba(34, 211, 238, .25);
}

.online-ip.copied {
  color: var(--success);
}

.online-ip.loading {
  opacity: 0.65;
  pointer-events: none;
}

/* User panel */
.page-user {
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, .18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(34, 211, 238, .08), transparent),
    var(--bg);
}

.user-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Site footer (trang công khai) */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: rgba(26, 29, 39, 0.65);
  backdrop-filter: blur(8px);
}

.site-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.site-footer-brand {
  min-width: 0;
}

.site-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.site-footer-logo i {
  color: var(--primary-hover);
}

.site-footer-tagline {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.site-footer-links a {
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer-links a:hover {
  color: var(--accent);
}

.site-footer-copy {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  flex: 1 1 100%;
  text-align: center;
}

@media (min-width: 768px) {
  .site-footer-copy {
    flex: 0 1 auto;
    text-align: right;
  }
}

/* Contact float fixed (trang công khai) */
@keyframes contact-wobble {

  0%,
  100% {
    transform: rotate(0deg) translateY(0);
  }

  20% {
    transform: rotate(-4deg) translateY(-1px);
  }

  40% {
    transform: rotate(4deg) translateY(0);
  }

  60% {
    transform: rotate(-3deg) translateY(-1px);
  }

  80% {
    transform: rotate(3deg) translateY(0);
  }
}

.contact-float {
  position: fixed;
  right: 0.85rem;
  bottom: 1rem;
  z-index: 900;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.6rem;
  pointer-events: none;
}

.contact-float>* {
  pointer-events: auto;
}

.contact-float-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45);
  animation: contact-wobble 4s ease-in-out infinite;
  transition: transform 0.2s, box-shadow 0.2s;
}

.contact-float-toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.55);
}

.contact-float-toggle-label {
  display: none;
}

.contact-float-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.55rem;
}

.contact-float-item-wrap {
  margin: 0;
  padding: 0;
}

.contact-float-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s, box-shadow 0.18s;
  font-size: 1.25rem;
  position: relative;
}

.contact-float-item:hover {
  transform: scale(1.08);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.35);
}

.contact-float-item .contact-icon-svg {
  width: 1.35rem;
  height: 1.35rem;
}

.contact-float-item-label {
  display: none;
}

.contact-float-zalo {
  background: #0068ff;
}

.contact-float-facebook {
  background: #1877f2;
}

.contact-float-telegram {
  background: #229ed9;
}

.contact-float-custom-0,
.contact-float-custom-1,
.contact-float-custom-2,
.contact-float-custom-3,
.contact-float-custom-4,
.contact-float-custom-5,
.contact-float-custom-6,
.contact-float-custom-7,
.contact-float-custom-8,
.contact-float-custom-9 {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
}

.contact-wobble {
  animation: contact-wobble 3.6s ease-in-out infinite;
}

.contact-float-item-wrap:nth-child(1) .contact-wobble {
  animation-delay: 0s;
}

.contact-float-item-wrap:nth-child(2) .contact-wobble {
  animation-delay: 0.35s;
}

.contact-float-item-wrap:nth-child(3) .contact-wobble {
  animation-delay: 0.7s;
}

.contact-float-item-wrap:nth-child(4) .contact-wobble {
  animation-delay: 1.05s;
}

.contact-float-item-wrap:nth-child(5) .contact-wobble {
  animation-delay: 1.4s;
}

.contact-float-item-wrap:nth-child(6) .contact-wobble {
  animation-delay: 1.75s;
}

@media (min-width: 768px) {
  .contact-float {
    bottom: 1.25rem;
    right: 1.25rem;
    gap: 0.65rem;
  }

  .contact-float-list {
    flex-direction: column;
  }

  .contact-float-item {
    width: 3.15rem;
    height: 3.15rem;
    font-size: 1.3rem;
  }
}

@media (max-width: 767px) {
  .contact-float-toggle {
    display: inline-flex;
  }

  .contact-float-list {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(0.75rem) scale(0.96);
    transform-origin: bottom right;
    transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.3s ease;
    pointer-events: none;
  }

  .contact-float.is-open .contact-float-list {
    max-height: 24rem;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .contact-float.is-open .contact-float-toggle {
    animation: none;
    transform: rotate(0deg);
    background: linear-gradient(135deg, #475569, #334155);
  }

  .contact-float--single .contact-float-toggle {
    display: none;
  }

  .contact-float--single .contact-float-list {
    max-height: none;
    opacity: 1;
    overflow: visible;
    transform: none;
    pointer-events: auto;
  }
}

@media (prefers-reduced-motion: reduce) {

  .contact-wobble,
  .contact-float-toggle {
    animation: none;
  }

  .contact-float-list {
    transition: none;
  }
}

/* Admin — liên hệ fixed */
.contact-preset-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.contact-preset-row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 0.75rem 1rem;
  align-items: center;
}

.contact-preset-check {
  margin: 0;
}

.contact-preset-name {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}

.contact-custom-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.contact-custom-head .content-section-title {
  margin: 0;
}

.contact-custom-rows {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.contact-custom-row {
  display: grid;
  grid-template-columns: auto 1fr 1.4fr 140px auto;
  gap: 0.55rem;
  align-items: center;
}

.contact-custom-check {
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .contact-preset-row {
    grid-template-columns: 1fr;
  }

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

  .contact-custom-row .contact-remove-row {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

.user-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 29, 39, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.user-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.85rem 0.35rem 0.35rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.user-chip-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-chip-name {
  font-weight: 600;
  font-size: 0.88rem;
}

.user-chip-email {
  font-size: 0.72rem;
  color: var(--muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-info .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

.user-logout {
  white-space: nowrap;
}

.user-main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
  flex: 1;
}

.user-hero {
  margin-bottom: 1.5rem;
}

.user-hero-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.user-hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
}

.user-hero-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 520px;
}

.user-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.user-stat-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.user-stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, .06), transparent 60%);
  pointer-events: none;
}

.user-stat-accent {
  border-color: rgba(99, 102, 241, .35);
}

.user-stat-warn {
  border-color: rgba(251, 191, 36, .35);
}

.user-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(99, 102, 241, .12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-stat-icon i {
  font-size: 1.15rem;
  color: var(--primary-hover);
}

.user-stat-warn .user-stat-icon {
  background: rgba(251, 191, 36, .12);
}

.user-stat-warn .user-stat-icon i {
  color: #fbbf24;
}

.user-stat-body {
  position: relative;
  flex: 1;
  min-width: 0;
}

.user-stat-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.user-stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.user-stat-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.user-stat-ring {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.user-stat-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.user-stat-ring .ring-bg {
  fill: none;
  stroke: rgba(148, 163, 184, 0.22);
  stroke-width: 3;
}

.user-stat-ring .ring-fill {
  fill: none;
  stroke: var(--primary-hover);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - min(var(--pct, 0), 100));
  transition: stroke-dashoffset 0.4s ease;
}

.user-stat-warn .ring-fill {
  stroke: #fbbf24;
}

.user-storage-rent-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}

.btn-storage-rent {
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.18), rgba(99, 102, 241, 0.14));
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--accent);
  font-weight: 600;
}

.btn-storage-rent:hover {
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.28), rgba(99, 102, 241, 0.22));
  color: #fff;
}

.user-storage-bonus {
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.storage-rent-form {
  margin-bottom: 1rem;
}

.storage-rent-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.storage-rent-gb-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.storage-rent-gb-row .form-control {
  max-width: 140px;
}

.storage-rent-gb-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

.storage-rent-quote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.85rem;
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
  font-size: 0.88rem;
}

.storage-rent-quote strong {
  color: var(--accent);
  font-size: 1.05rem;
}

.user-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.user-side {
  position: sticky;
  top: 5rem;
}

.user-card {
  padding: 1.35rem 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .12);
}

.user-card-head {
  margin-bottom: 1.15rem;
}

.user-card-head h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.user-card-head h2 i {
  color: var(--primary-hover);
}

.user-card-head p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.user-card-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.user-files-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, .15);
  color: var(--primary-hover);
  white-space: nowrap;
}

.upload-quota-alert {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fcd34d;
  font-size: 0.84rem;
}

.upload-quota-alert i {
  flex-shrink: 0;
}

/* Levels panel (user sidebar) */
.levels-panel {
  padding: 0;
  overflow: hidden;
}

.levels-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 0.85rem;
}

.levels-panel-head h2 {
  margin: 0 0 0.2rem;
  font-size: 1.02rem;
  font-weight: 700;
}

.levels-panel-head p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.levels-panel-head-text {
  min-width: 0;
  flex: 1;
}

.levels-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1.25rem 0.85rem;
}

.levels-panel-actions .btn-upgrade-level {
  flex: 1;
  min-width: 0;
  justify-content: center;
  font-weight: 600;
  padding: 0.45rem 0.65rem;
}

.levels-panel-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0 1rem 0.75rem;
}

.levels-panel-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.levels-panel-tab:hover {
  border-color: rgba(99, 102, 241, 0.45);
  color: var(--text);
}

.levels-panel-tab.is-active {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.14);
  color: var(--primary-hover);
}

.levels-tab-pane {
  display: block;
}

.levels-tab-pane[hidden] {
  display: none !important;
}

.levels-panel-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(34, 211, 238, 0.15));
  color: var(--accent);
  font-size: 1.1rem;
}

.levels-hero {
  margin: 0 1rem 0.75rem;
  padding: 1rem 1rem 0.85rem;
  border-radius: 12px;
  border: 1px solid transparent;
  background:
    linear-gradient(160deg, rgba(99, 102, 241, 0.18), rgba(15, 17, 23, 0.6)) padding-box,
    linear-gradient(135deg, rgba(99, 102, 241, 0.55), rgba(34, 211, 238, 0.35)) border-box;
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.12);
}

.levels-hero-vip {
  background:
    linear-gradient(165deg, rgba(198, 169, 98, 0.1) 0%, var(--vip-bg) 42%, rgba(12, 11, 10, 0.96) 100%) padding-box,
    linear-gradient(140deg, rgba(232, 217, 176, 0.5), rgba(198, 169, 98, 0.35), rgba(138, 115, 68, 0.25)) border-box;
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(232, 217, 176, 0.1);
}

.levels-hero-vip .levels-hero-name {
  background: linear-gradient(135deg, var(--vip-champagne) 0%, var(--vip-gold) 55%, var(--vip-gold-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.levels-hero-custom {
  background:
    linear-gradient(160deg, rgba(34, 211, 238, 0.14), rgba(15, 17, 23, 0.65)) padding-box,
    linear-gradient(135deg, rgba(34, 211, 238, 0.5), rgba(99, 102, 241, 0.4)) border-box;
}

.levels-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.levels-hero-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.levels-hero-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.18);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.levels-hero-vip .levels-hero-badge {
  background: linear-gradient(135deg, rgba(198, 169, 98, 0.22), rgba(138, 115, 68, 0.16));
  color: var(--vip-champagne);
  border-color: var(--vip-border);
  letter-spacing: 0.07em;
}

.levels-hero-name {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.65rem;
}

.levels-hero-desc {
  margin: -0.35rem 0 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.levels-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.levels-stat {
  text-align: center;
  padding: 0.55rem 0.25rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.levels-stat i {
  display: block;
  font-size: 0.95rem;
  color: var(--primary-hover);
  margin-bottom: 0.2rem;
}

.levels-hero-vip .levels-stat i {
  color: var(--vip-gold);
}

.levels-hero-vip .levels-stat {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(198, 169, 98, 0.12);
}

.levels-stat-val {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.levels-stat-lbl {
  display: block;
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

.levels-compare-title {
  margin: 0;
  padding: 0.35rem 1.25rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.levels-tier-list {
  list-style: none;
  margin: 0;
  padding: 0 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.levels-tier {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.15s, background 0.15s;
}

.levels-tier-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary-hover);
}

.levels-tier-vip .levels-tier-icon {
  background: linear-gradient(145deg, rgba(198, 169, 98, 0.16), rgba(138, 115, 68, 0.1));
  color: var(--vip-gold-light);
  border: 1px solid rgba(198, 169, 98, 0.2);
}

.levels-tier-vip {
  border-color: rgba(198, 169, 98, 0.18);
  background: linear-gradient(135deg, rgba(198, 169, 98, 0.04), rgba(255, 255, 255, 0.01));
}

.levels-tier-body {
  min-width: 0;
  flex: 1;
}

.levels-tier-name {
  display: block;
  font-weight: 700;
  font-size: 0.86rem;
  margin-bottom: 0.25rem;
}

.levels-tier-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.levels-tier-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.levels-tier-meta i {
  color: var(--primary-hover);
  font-size: 0.75rem;
}

.levels-tier-vip .levels-tier-meta i {
  color: var(--vip-gold);
}

.levels-hero-expiry {
  margin: -0.45rem 0 0.65rem;
  font-size: 0.78rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.levels-hero-vip .levels-hero-expiry {
  color: var(--vip-gold-light);
  opacity: 0.92;
}

.levels-hero-upgrade {
  margin-top: 0.65rem;
  width: 100%;
}

.btn-upgrade-level {
  flex-shrink: 0;
  white-space: nowrap;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-level-vip {
  background: linear-gradient(145deg, rgba(198, 169, 98, 0.18) 0%, rgba(138, 115, 68, 0.12) 100%);
  border: 1px solid var(--vip-border);
  color: var(--vip-champagne);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(232, 217, 176, 0.12);
}

.btn-level-vip:hover {
  background: linear-gradient(145deg, rgba(198, 169, 98, 0.28) 0%, rgba(138, 115, 68, 0.2) 100%);
  border-color: rgba(232, 217, 176, 0.55);
  color: #fff;
  filter: none;
}

.levels-panel-actions .btn-level-vip {
  background: linear-gradient(145deg, rgba(198, 169, 98, 0.22), rgba(90, 74, 42, 0.35));
}

.levels-payment-history {
  padding: 0 1rem 1.15rem;
}

.levels-payment-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.levels-payment-item {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.levels-payment-main {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.levels-payment-meta {
  font-size: 0.72rem;
  margin-top: 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.level-upgrade-dialog {
  width: min(640px, 100%);
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.level-upgrade-dialog.is-vip {
  border-color: var(--vip-border);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55), 0 0 48px var(--vip-glow);
}

.level-upgrade-header {
  position: relative;
  padding: 1.35rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.level-upgrade-header-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 80% at 0% 0%, rgba(99, 102, 241, 0.35), transparent 55%),
    radial-gradient(ellipse 80% 60% at 100% 100%, rgba(34, 211, 238, 0.15), transparent 50%),
    linear-gradient(180deg, rgba(99, 102, 241, 0.12), transparent);
  pointer-events: none;
}

.level-upgrade-dialog.is-vip .level-upgrade-header-bg {
  background:
    radial-gradient(ellipse 120% 80% at 0% 0%, rgba(198, 169, 98, 0.2), transparent 55%),
    radial-gradient(ellipse 80% 60% at 100% 100%, rgba(138, 115, 68, 0.12), transparent 50%),
    linear-gradient(180deg, rgba(198, 169, 98, 0.08), transparent);
}

.level-upgrade-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.level-upgrade-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.level-upgrade-header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-right: 2rem;
}

.level-upgrade-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(34, 211, 238, 0.2));
  border: 1px solid rgba(99, 102, 241, 0.45);
  color: #c7d2fe;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.level-upgrade-dialog.is-vip .level-upgrade-icon {
  background: linear-gradient(145deg, rgba(198, 169, 98, 0.28), rgba(138, 115, 68, 0.16));
  border-color: var(--vip-border);
  color: var(--vip-champagne);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(232, 217, 176, 0.15);
}

.level-upgrade-dialog.is-vip .level-upgrade-title {
  background: linear-gradient(135deg, var(--vip-champagne), var(--vip-gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.level-upgrade-kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.level-upgrade-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
}

.level-upgrade-steps {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.35rem;
  margin-top: 1rem;
}

.upgrade-step-pill {
  flex: 1;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.upgrade-step-pill.is-active {
  color: var(--text);
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.45);
}

.level-upgrade-dialog.is-vip .upgrade-step-pill.is-active {
  background: var(--vip-soft);
  border-color: var(--vip-border);
  color: var(--vip-gold-light);
}

.level-upgrade-body {
  padding: 1.15rem 1.25rem 1.35rem;
}

.upgrade-step-panel {
  animation: upgrade-fade-in 0.25s ease;
}

@keyframes upgrade-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.upgrade-step-lead {
  margin: 0 0 1rem;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.upgrade-empty-options {
  margin: 0;
  padding: 1.25rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.upgrade-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: upgrade-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes upgrade-spin {
  to {
    transform: rotate(360deg);
  }
}

.upgrade-month-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}

.upgrade-plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 108px;
  padding: 0.85rem 0.5rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
  font-family: inherit;
  color: inherit;
}

.upgrade-plan-card:hover {
  border-color: rgba(99, 102, 241, 0.55);
  transform: translateY(-2px);
}

.upgrade-plan-card.selected {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.06));
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.2);
}

.level-upgrade-dialog.is-vip .upgrade-plan-card:hover {
  border-color: var(--vip-border);
}

.level-upgrade-dialog.is-vip .upgrade-plan-card.selected {
  border-color: var(--vip-gold);
  background: linear-gradient(180deg, rgba(198, 169, 98, 0.14), rgba(198, 169, 98, 0.04));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(198, 169, 98, 0.15);
}

.upgrade-plan-duration {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.upgrade-plan-unit {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-top: 0.15rem;
}

.upgrade-plan-price {
  margin-top: 0.55rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent);
}

.level-upgrade-dialog.is-vip .upgrade-plan-price {
  color: var(--vip-gold-light);
}

.upgrade-plan-base {
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: line-through;
  margin-top: 0.15rem;
}

.upgrade-plan-badge {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.18rem 0.4rem;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.upgrade-submit-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.level-upgrade-dialog.is-vip .upgrade-submit-btn {
  background: linear-gradient(145deg, rgba(198, 169, 98, 0.32) 0%, rgba(138, 115, 68, 0.28) 100%);
  border: 1px solid var(--vip-border);
  color: var(--vip-champagne);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(232, 217, 176, 0.12);
}

.level-upgrade-dialog.is-vip .upgrade-submit-btn:hover {
  background: linear-gradient(145deg, rgba(198, 169, 98, 0.42) 0%, rgba(138, 115, 68, 0.36) 100%);
  border-color: rgba(232, 217, 176, 0.5);
  color: #fff;
}

.upgrade-pay-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.upgrade-qr-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
  overflow: hidden;
}

.upgrade-qr-card.hidden {
  display: none;
}

.upgrade-pay-layout:has(.upgrade-qr-card.hidden) {
  grid-template-columns: 1fr;
}

.upgrade-qr-card-head {
  padding: 0.5rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.upgrade-qr-frame {
  padding: 0.65rem;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upgrade-qr-img {
  display: block;
  width: 100%;
  max-width: 334px;
  height: auto;
  border-radius: 6px;
}

.upgrade-pay-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.upgrade-pay-amount-box {
  text-align: left;
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.65rem;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(34, 211, 238, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.level-upgrade-dialog.is-vip .upgrade-pay-amount-box {
  background: linear-gradient(135deg, rgba(198, 169, 98, 0.12), rgba(138, 115, 68, 0.06));
  border-color: var(--vip-border);
}

.upgrade-pay-amount-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.upgrade-pay-amount-value {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.level-upgrade-dialog.is-vip .upgrade-pay-amount-value {
  color: var(--vip-gold-light);
}

.level-upgrade-dialog.is-vip .upgrade-copy-code {
  background: var(--vip-soft);
  color: var(--vip-gold-light);
  border-color: var(--vip-border);
}

.upgrade-pay-rows {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.upgrade-pay-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.upgrade-pay-row dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
  padding-top: 0.1rem;
}

.upgrade-pay-row dd {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  min-width: 0;
  word-break: break-all;
}

.upgrade-copy-code {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.upgrade-copy-btn {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.upgrade-copy-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  color: var(--text);
}

.upgrade-copy-btn.is-copied {
  color: var(--success);
}

.upgrade-pay-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-top: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
  background: rgba(52, 211, 153, 0.06);
  border: 1px solid rgba(52, 211, 153, 0.15);
}

.upgrade-pay-hint i {
  color: var(--success);
  flex-shrink: 0;
  margin-top: 0.08rem;
}

.upgrade-pay-status {
  margin-top: 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-size: 0.78rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 560px) {
  .upgrade-pay-layout {
    grid-template-columns: 1fr;
  }

  .upgrade-qr-card {
    max-width: 220px;
    margin: 0 auto;
    width: 100%;
  }

  .upgrade-pay-amount-box {
    text-align: center;
  }
}

.upgrade-pay-status.is-success {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--success);
}

.upgrade-pay-status.is-error {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.3);
  color: var(--danger);
}

.upgrade-done {
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.upgrade-done-ring {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--success);
  background: rgba(52, 211, 153, 0.12);
  border: 2px solid rgba(52, 211, 153, 0.35);
  box-shadow: 0 0 40px rgba(52, 211, 153, 0.15);
}

.upgrade-done h3 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.upgrade-done-msg {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.upgrade-done-expiry-box {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 1.25rem;
  margin-bottom: 1.15rem;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.upgrade-done-expiry-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.level-pricing-card {
  margin-bottom: 1rem;
}

.level-pricing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.level-pricing-head h4 {
  margin: 0;
  font-size: 1rem;
}

.level-pricing-enable {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.level-pricing-grid {
  margin-bottom: 0.65rem;
}

.level-pricing-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.82rem;
}

.level-price-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

.level-discount {
  color: #4ade80;
  font-style: normal;
  font-weight: 700;
}

.user-files-card {
  margin-bottom: 0;
}

.user-files-table .file-name-cell {
  min-width: 200px;
  max-width: 320px;
}

.user-files-table .file-link-cell {
  min-width: 200px;
  max-width: 340px;
}

.file-row-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.file-lock-badge {
  display: inline-flex;
  align-items: center;
  color: #fbbf24;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.file-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface2);
}

.file-thumb img,
.file-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.file-thumb-video {
  position: relative;
}

.file-thumb-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .35);
  color: #fff;
  font-size: 1.1rem;
  pointer-events: none;
}

.file-thumb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-thumb-icon i {
  font-size: 1.35rem;
  color: var(--primary-hover);
}

.file-row-main .file-name {
  font-weight: 600;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
  min-width: 0;
  cursor: text;
  border-radius: 4px;
  transition: color 0.15s;
}

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

.file-name-renamed {
  color: var(--accent);
}

.file-name-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
}

.file-name-input:focus {
  outline: none;
}

.file-url-copy {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  margin: 0;
  background: var(--surface2);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.file-url-copy:hover {
  border-color: rgba(99, 102, 241, .4);
  background: rgba(99, 102, 241, .08);
}

.file-url-copy .file-url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: none;
  padding: 0;
  font-size: 0.75rem;
  color: var(--accent);
  pointer-events: none;
}

.file-url-copy i {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.file-url-copy.copied i {
  color: var(--success);
}

.file-dl-count {
  font-variant-numeric: tabular-nums;
}

.file-actions .btn {
  padding: 0.35rem 0.55rem;
}

.btn-outline-light {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .25);
  color: var(--text);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .4);
  color: #fff;
}

.user-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(99, 102, 241, .03);
}

.user-empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: rgba(99, 102, 241, .12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-empty-icon i {
  font-size: 1.75rem;
  color: var(--primary-hover);
}

.user-empty h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.user-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 360px;
  margin-inline: auto;
}

.quota-bar {
  margin-bottom: 1.5rem;
}

.quota-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.progress {
  height: 8px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.3s;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.upload-section-full .upload-zone {
  opacity: 0.55;
  cursor: not-allowed;
}

.upload-section-full .upload-zone .upload-zone-link {
  pointer-events: none;
}

.multi-upload.upload-quota-full [data-role="submit"] {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 960px) {
  .user-stats {
    grid-template-columns: 1fr;
  }

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

  .user-side {
    order: -1;
    position: static;
  }

  .user-stat-ring {
    display: none;
  }

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

@media (max-width: 640px) {
  .user-header-inner {
    padding: 0.75rem 1rem;
  }

  .user-chip-email {
    display: none;
  }

  .user-main {
    padding: 1.25rem 1rem 2rem;
  }

  .user-card {
    padding: 1.1rem 1rem;
  }

  .file-thumb {
    width: 40px;
    height: 40px;
  }

  .file-url-copy .file-url {
    font-size: 0.7rem;
  }
}

/* Toast */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: min(420px, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
  font-size: 0.88rem;
  line-height: 1.4;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(1.25rem);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.toast-in {
  opacity: 1;
  transform: translateX(0);
}

.toast.toast-out {
  opacity: 0;
  transform: translateX(1.25rem);
}

.toast-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-size: 1.05rem;
}

.toast-message {
  flex: 1;
  color: var(--text);
  word-break: break-word;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

.toast-close:hover {
  color: var(--text);
}

.toast-success {
  border-color: rgba(52, 211, 153, .35);
}

.toast-success .toast-icon {
  color: var(--success);
}

.toast-error {
  border-color: rgba(248, 113, 113, .35);
}

.toast-error .toast-icon {
  color: var(--danger);
}

.toast-warning {
  border-color: rgba(251, 191, 36, .35);
}

.toast-warning .toast-icon {
  color: #fbbf24;
}

.toast-info {
  border-color: rgba(99, 102, 241, .35);
}

.toast-info .toast-icon {
  color: var(--primary-hover);
}

/* Preview modal */
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.preview-modal.hidden {
  display: none;
}

body.preview-open {
  overflow: hidden;
}

.preview-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(4px);
}

.preview-modal-dialog {
  position: relative;
  width: min(960px, 100%);
  max-height: calc(100vh - 2rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
}

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

.preview-modal-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-modal-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem;
}

.preview-modal-close:hover {
  color: var(--text);
}

.preview-modal-body {
  padding: 1rem;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: calc(100vh - 8rem);
  background: #0a0c10;
}

.preview-media {
  max-width: 100%;
  max-height: calc(100vh - 10rem);
}

.preview-media-image {
  object-fit: contain;
  border-radius: 6px;
}

.preview-media-video {
  width: 100%;
  max-height: calc(100vh - 10rem);
  background: #000;
  border-radius: 6px;
}

.preview-media-audio {
  width: 100%;
  min-width: 280px;
}

.preview-media-pdf {
  width: 100%;
  height: min(75vh, 720px);
  border: none;
  border-radius: 6px;
  background: #fff;
}

.d-flex {
  display: flex;
}

.justify-content-between {
  justify-content: space-between;
}

.align-items-center {
  align-items: center;
}

@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .admin-content {
    padding: 1.25rem;
  }
}

/* ── Files browser (folders) ── */
.user-files-head-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.files-browser {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 0;
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, .12);
}

.files-browser-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.folder-sidebar-head {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.folder-sidebar-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.folder-tree {
  display: flex;
  flex-direction: column;
  padding: 0.45rem 0.35rem 0.75rem;
  overflow: auto;
  flex: 1;
  max-height: 520px;
}

.folder-tree-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.42rem 0.45rem;
  padding-left: calc(0.45rem + var(--depth, 0) * 14px);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  transition: background 0.15s, color 0.15s;
}

.folder-tree-item:hover {
  background: rgba(99, 102, 241, .1);
}

.folder-tree-item.is-active {
  background: rgba(99, 102, 241, .18);
  color: var(--primary-hover);
  font-weight: 600;
}

.folder-tree-item.drag-hover {
  background: rgba(56, 189, 248, .15);
  outline: 1px dashed rgba(56, 189, 248, .55);
}

.folder-tree-toggle {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
  border-radius: 4px;
}

.folder-tree-toggle:not(.is-leaf):hover {
  background: rgba(255, 255, 255, .06);
  color: var(--text);
}

.folder-tree-item.is-open > .folder-tree-toggle i {
  transform: rotate(90deg);
}

.folder-tree-toggle i {
  font-size: 0.72rem;
  transition: transform 0.15s;
}

.folder-tree-toggle-placeholder {
  visibility: hidden;
}

.folder-tree-icon {
  flex-shrink: 0;
  color: #fbbf24;
  font-size: 0.95rem;
}

.folder-tree-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-tree-actions {
  display: none;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}

.folder-tree-item:hover .folder-tree-actions {
  display: inline-flex;
}

.folder-tree-action {
  border: none;
  background: transparent;
  color: var(--muted);
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.folder-tree-action:hover {
  background: rgba(255, 255, 255, .08);
  color: var(--text);
}

.folder-tree-action-danger:hover {
  color: #f87171;
}

.folder-tree-action-add:hover {
  color: #4ade80;
}

.files-browser-main {
  position: relative;
  min-width: 0;
  min-height: 280px;
  transition: background 0.15s;
}

.files-browser-main.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.files-browser-main.dragover {
  background: rgba(99, 102, 241, .06);
}

.files-browser-main-inner {
  padding: 0.85rem 1rem 1rem;
  min-height: 280px;
}

.files-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.84rem;
}

.files-breadcrumb-item {
  border: none;
  background: transparent;
  color: var(--primary-hover);
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  font: inherit;
}

.files-breadcrumb-item:hover {
  background: rgba(99, 102, 241, .12);
}

.files-breadcrumb-sep {
  color: var(--muted);
  font-size: 0.7rem;
}

.files-drop-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem;
  margin-bottom: 0.65rem;
  border: 1px dashed rgba(99, 102, 241, .45);
  border-radius: 10px;
  background: rgba(99, 102, 241, .08);
  color: var(--primary-hover);
  font-size: 0.88rem;
  font-weight: 600;
}

.files-drop-hint i {
  font-size: 1.1rem;
}

.user-empty-folder {
  padding: 2rem 1rem;
}

.user-empty-upload-btn {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.upload-progress-fixed {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1200;
  width: min(320px, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, .35);
  background: rgba(15, 23, 42, .94);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  backdrop-filter: blur(10px);
}

.upload-progress-fixed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.upload-progress-fixed-title {
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.upload-progress-fixed-pct {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-hover);
}

.upload-progress-fixed-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}

.upload-progress-fixed-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #38bdf8);
  transition: width 0.15s ease;
}

.upload-progress-fixed-status {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .files-browser {
    grid-template-columns: 1fr;
  }

  .files-browser-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 220px;
  }

  .folder-tree {
    max-height: 160px;
  }
}