/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #f1f5f9;
  --surface:      #ffffff;
  --border:       #e2e8f0;
  --border-hi:    #cbd5e1;
  --primary:      #6366f1;
  --primary-dark: #4f46e5;
  --primary-lite: #eef2ff;
  --success:      #059669;
  --success-lite: #ecfdf5;
  --danger:       #dc2626;
  --danger-lite:  #fef2f2;
  --warn:         #d97706;
  --text:         #0f172a;
  --text2:        #334155;
  --muted:        #64748b;
  --shadow:       0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --radius:       10px;
  --sidebar-w:    230px;
  --font:         'Inter', system-ui, sans-serif;
}

html { font-size: 16px; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.5; min-height: 100vh; }

/* ── Auth overlay ── */
#auth-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.7);
  display: flex; align-items: center; justify-content: center; z-index: 999;
  backdrop-filter: blur(4px);
}
.auth-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 2.5rem; width: 100%; max-width: 380px;
  text-align: center; box-shadow: var(--shadow-md);
}
.auth-logo { font-size: 1.8rem; font-weight: 800; margin-bottom: .25rem; }
.auth-logo span { color: var(--primary); }
.auth-box p { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }
.auth-box .err { color: var(--danger); font-size: .82rem; margin-top: .6rem; min-height: 1.2rem; }

input[type="password"], input[type="text"] {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .95rem;
  padding: .65rem 1rem; outline: none; transition: border-color .15s;
}
input[type="password"]:focus, input[type="text"]:focus { border-color: var(--primary); }

.btn-primary {
  cursor: pointer; font-family: var(--font); font-size: .95rem; font-weight: 600;
  border: none; border-radius: 8px; background: var(--primary); color: #fff;
  width: 100%; padding: .72rem; margin-top: .6rem; transition: background .15s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* ── Layout ── */
#app { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed;
  top: 0; left: 0; height: 100vh; z-index: 10;
}

.sidebar-logo {
  padding: 1.5rem 1.5rem 1rem;
  font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo span { color: var(--primary); }

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

.nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .9rem; border-radius: 8px; border: none;
  background: none; color: var(--muted); font-family: var(--font);
  font-size: .9rem; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-lite); color: var(--primary); font-weight: 600; }
.nav-item .ni-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 1rem 1.25rem; border-top: 1px solid var(--border);
  font-size: .75rem; color: var(--muted);
}
.key-badge {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: .25rem .6rem;
  font-size: .72rem; font-family: monospace; display: inline-block;
}

/* ── Main content ── */
#main {
  margin-left: var(--sidebar-w); flex: 1; min-height: 100vh;
  padding: 2rem 2.5rem;
}

.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.75rem;
}
.page-header h1 { font-size: 1.4rem; font-weight: 700; color: var(--text); }

/* ── Cards ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.card-header {
  padding: 1rem 1.25rem; font-size: .85rem; font-weight: 600;
  color: var(--text2); border-bottom: 1px solid var(--border);
  letter-spacing: .02em;
}

/* ── Stats grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-bottom: 1.5rem; }

.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem; display: flex; align-items: center; gap: 1rem;
}
.stat-icon {
  width: 46px; height: 46px; border-radius: 10px;
  display: flex; align-items: center;
  justify-content: center; font-size: 1.15rem; flex-shrink: 0;
}
.stat-icon-files     { background: var(--primary-lite); color: var(--primary); }
.stat-icon-storage   { background: #f0fdf4; color: var(--success); }
.stat-icon-downloads { background: #fef3c7; color: var(--warn); }
.stat-label { font-size: .78rem; color: var(--muted); font-weight: 500; margin-bottom: .15rem; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1; }

/* ── Chart ── */
.chart-card { padding: 1.25rem; }
.chart-card .card-header { padding: 0 0 .75rem; border: none; }
#uploads-chart { max-height: 200px; }

/* ── Recent files (dashboard) ── */
.recent-file-row {
  display: flex; align-items: center; gap: .75rem; padding: .7rem 1.25rem;
  border-bottom: 1px solid var(--border); font-size: .875rem;
}
.recent-file-row:last-child { border-bottom: none; }
.rf-icon { font-size: 1rem; flex-shrink: 0; }
.rf-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-size { color: var(--muted); font-size: .8rem; flex-shrink: 0; }
.rf-date { color: var(--muted); font-size: .8rem; flex-shrink: 0; margin-left: 1rem; }

/* ── Drop zone ── */
#drop-zone {
  border: 2px dashed var(--border-hi); border-radius: 14px;
  background: var(--surface); padding: 4rem 2rem;
  text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s; margin-bottom: 1.5rem;
}
#drop-zone:hover, #drop-zone.drag-over {
  border-color: var(--primary); background: var(--primary-lite);
}
.drop-icon { font-size: 2.8rem; color: var(--primary); margin-bottom: .75rem; }
.drop-title { font-size: 1.1rem; font-weight: 600; margin-bottom: .35rem; }
.drop-sub { color: var(--muted); font-size: .875rem; margin-bottom: 1rem; }
.drop-limit {
  display: inline-block; font-size: .75rem; color: var(--muted);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: .2rem .75rem;
}
#file-input { display: none; }

.section-title {
  font-size: .78rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .75rem;
}

/* ── Upload queue ── */
#upload-queue-wrap { margin-bottom: 1.5rem; }
#upload-queue { display: flex; flex-direction: column; gap: .75rem; }

.upload-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.upload-item-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .65rem; }

.file-icon-badge {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--primary-lite); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}

.file-meta { flex: 1; min-width: 0; }
.file-name { font-size: .9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size-label { font-size: .75rem; color: var(--muted); }

.status-badge {
  font-size: .7rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; padding: .2rem .55rem; border-radius: 5px;
}
.status-badge.hashing    { background: #fef3c7; color: var(--warn); }
.status-badge.uploading  { background: var(--primary-lite); color: var(--primary); }
.status-badge.resuming   { background: #fef3c7; color: var(--warn); }
.status-badge.completing { background: var(--success-lite); color: var(--success); }
.status-badge.done       { background: var(--success-lite); color: var(--success); }
.status-badge.error      { background: var(--danger-lite); color: var(--danger); }
.status-badge.aborted    { background: var(--bg); color: var(--muted); }

.item-actions { display: flex; gap: .4rem; flex-shrink: 0; }

.progress-wrap { height: 5px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 999px; transition: width .25s linear; }
.progress-bar.success { background: var(--success); }
.progress-bar.error   { background: var(--danger); }

.progress-labels { display: flex; justify-content: space-between; font-size: .73rem; color: var(--muted); margin-top: .3rem; }

.done-row {
  display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap;
}
.done-link-btn, .done-direct-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .8rem; border-radius: 7px; font-size: .8rem;
  font-weight: 500; text-decoration: none; cursor: pointer; border: none;
  font-family: var(--font); transition: background .15s;
}
.done-link-btn  { background: var(--primary-lite); color: var(--primary); }
.done-link-btn:hover  { background: #dde4ff; }
.done-direct-btn { background: var(--success-lite); color: var(--success); }
.done-direct-btn:hover { background: #d1fae5; }

/* ── Buttons (small) ── */
.btn-sm {
  cursor: pointer; font-family: var(--font); font-size: .78rem;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg); color: var(--muted); padding: .3rem .7rem;
  transition: all .15s;
}
.btn-sm:hover { color: var(--text); border-color: var(--border-hi); }
.btn-sm.danger:hover { color: var(--danger); border-color: var(--danger); }

.btn-primary-sm {
  cursor: pointer; font-family: var(--font); font-size: .85rem; font-weight: 600;
  border: none; border-radius: 8px; background: var(--primary); color: #fff;
  padding: .5rem 1.1rem; transition: background .15s;
}
.btn-primary-sm:hover { background: var(--primary-dark); }

/* ── Files table ── */
.files-table {
  width: 100%; border-collapse: collapse; font-size: .875rem;
}
.files-table th {
  padding: .7rem 1.1rem; text-align: left; font-size: .75rem;
  font-weight: 600; color: var(--muted); letter-spacing: .04em;
  text-transform: uppercase; border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.files-table td {
  padding: .75rem 1.1rem; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.files-table tr:last-child td { border-bottom: none; }
.files-table tr:hover td { background: #f8fafc; }

.tf-icon { margin-right: .4rem; }
.tf-name { font-weight: 500; }
.tf-actions { display: flex; gap: .4rem; }

.btn-share  { cursor: pointer; font-family: var(--font); font-size: .75rem; font-weight: 500; border: none; border-radius: 6px; padding: .3rem .65rem; background: var(--primary-lite); color: var(--primary); transition: background .15s; }
.btn-share:hover { background: #dde4ff; }
.btn-direct { cursor: pointer; font-family: var(--font); font-size: .75rem; font-weight: 500; border: none; border-radius: 6px; padding: .3rem .65rem; background: var(--success-lite); color: var(--success); transition: background .15s; }
.btn-direct:hover { background: #d1fae5; }
.btn-delete { cursor: pointer; font-family: var(--font); font-size: .75rem; font-weight: 500; border: none; border-radius: 6px; padding: .3rem .65rem; background: var(--danger-lite); color: var(--danger); transition: background .15s; }
.btn-delete:hover { background: #fee2e2; }

/* ── Landing page ── */
.lp-body {
  background: linear-gradient(150deg, #eef2ff 0%, #f8fafc 45%, #f0fdf4 100%);
  min-height: 100vh; display: flex; flex-direction: column;
}

.lp-header {
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); padding: 0 2rem;
  height: 62px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 10;
}
.lp-logo { text-decoration: none; font-size: 1.3rem; font-weight: 800; color: var(--text); }
.lp-logo span { color: var(--primary); }
.lp-tagline { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }

.lp-main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 3rem 1rem;
}

/* Loading / error states */
.lp-state { text-align: center; padding: 2rem; color: var(--muted); }
.lp-spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.lp-err-icon { font-size: 3rem; color: var(--danger); margin-bottom: .75rem; }
.lp-state h2 { font-size: 1.2rem; color: var(--text); margin-bottom: .4rem; }
.lp-go-home {
  display: inline-flex; align-items: center; gap: .4rem; margin-top: 1.25rem;
  background: var(--primary); color: #fff; text-decoration: none;
  border-radius: 10px; padding: .65rem 1.5rem; font-weight: 600; font-size: .9rem;
}

/* File card */
.lp-card {
  background: #fff; border-radius: 24px;
  box-shadow: 0 24px 64px rgba(0,0,0,.11), 0 4px 16px rgba(0,0,0,.06);
  padding: 2.5rem 2rem 2rem; max-width: 480px; width: 100%; text-align: center;
}

/* Icon circle */
.lp-icon-wrap {
  width: 100px; height: 100px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem; transition: transform .2s;
}
.lp-card:hover .lp-icon-wrap { transform: scale(1.04); }
.lp-file-icon { font-size: 2.6rem; }

/* Filename */
.lp-filename {
  font-size: 1.15rem; font-weight: 800; color: var(--text);
  word-break: break-all; line-height: 1.4; margin-bottom: 1rem;
}

/* Metadata badges */
.lp-badges {
  display: flex; gap: .45rem; justify-content: center;
  flex-wrap: wrap; margin-bottom: 1.25rem;
}
.lp-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: .28rem .75rem;
  font-size: .78rem; color: var(--text2);
}
.lp-badge-type {
  background: var(--primary-lite); border-color: #c7d2fe; color: var(--primary);
  font-weight: 700; letter-spacing: .04em;
}

/* Stats row */
.lp-stats {
  display: flex; align-items: center; justify-content: center;
  gap: 2rem; padding: 1.1rem 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.lp-stat { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.lp-stat i { color: var(--muted); font-size: .8rem; }
.lp-stat-val { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1; }
.lp-stat-label { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.lp-divider { width: 1px; height: 44px; background: var(--border); }

/* Download button */
.lp-download-btn {
  display: flex; align-items: center; justify-content: center; gap: .65rem;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff; text-decoration: none; border-radius: 14px;
  padding: 1rem 1.5rem; font-size: 1.05rem; font-weight: 700; width: 100%;
  box-shadow: 0 4px 18px rgba(99,102,241,.35);
  transition: transform .15s, box-shadow .15s; margin-bottom: .85rem;
}
.lp-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,.45);
}

.lp-secure-note {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  font-size: .75rem; color: var(--muted); margin-top: .5rem;
}

/* Footer */
.lp-footer {
  text-align: center; padding: 1rem; font-size: .78rem; color: var(--muted);
  border-top: 1px solid var(--border); background: rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center; gap: .6rem;
}
.lp-footer a { color: var(--primary); text-decoration: none; }
.lp-footer-dot { color: var(--border-hi); }

/* ── Storage provider cards ── */
#storage-list { display: flex; flex-direction: column; gap: 1rem; }

.sp-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.sp-card-header { display: flex; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.25rem; }
.sp-icon {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.sp-info { flex: 1; min-width: 0; }
.sp-name { font-size: .95rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .25rem; }
.sp-detail { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; margin-top: .18rem; }
.sp-type { font-weight: 600; color: var(--text2); }
.sp-badge { font-size: .68rem; font-weight: 700; padding: .18rem .55rem; border-radius: 20px; display: inline-flex; align-items: center; gap: .25rem; }
.sp-default-badge { background: #fef3c7; color: #92400e; }
.sp-inactive-badge { background: var(--bg); color: var(--muted); }

.sp-actions {
  display: flex; gap: .4rem; padding: .65rem 1.25rem;
  background: var(--bg); border-top: 1px solid var(--border); flex-wrap: wrap;
}
.sp-btn {
  cursor: pointer; font-family: var(--font); font-size: .75rem; font-weight: 600;
  border: 1px solid var(--border); border-radius: 7px; background: var(--surface);
  color: var(--text2); padding: .3rem .7rem; display: inline-flex; align-items: center;
  gap: .35rem; transition: all .15s;
}
.sp-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-lite); }
.sp-btn-delete:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-lite); }
.sp-btn-default:hover { border-color: #f59e0b; color: #92400e; background: #fef3c7; }

.sp-bw-wrap { margin-top: .6rem; }
.sp-bw-bar-bg { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; margin-bottom: .3rem; }
.sp-bw-bar { height: 100%; background: var(--primary); border-radius: 99px; transition: width .4s; }
.sp-bw-bar.sp-bw-exceeded { background: var(--danger); }
.sp-bw-label { font-size: .73rem; color: var(--muted); }
.sp-bw-exceeded-txt { color: var(--danger); font-weight: 600; }

.sp-empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.sp-empty i { font-size: 2.5rem; margin-bottom: .75rem; display: block; }
.sp-empty p { font-size: .95rem; font-weight: 500; color: var(--text2); }
.sp-empty-sub { font-size: .82rem; color: var(--muted); margin-top: .35rem; max-width: 400px; margin-inline: auto; }

.sp-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .73rem; font-weight: 500; color: var(--text2);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: .18rem .6rem; white-space: nowrap;
}

/* ── URL Import ── */
.url-import-box {
  margin-top: 1.75rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
}
.url-import-sub { font-size: .82rem; color: var(--muted); margin-bottom: .9rem; }
.url-import-form {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: .65rem; align-items: center;
}
.url-import-form input[type="url"],
.url-import-form input[type="text"] {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: .9rem; padding: .6rem .9rem;
  outline: none; font-family: var(--font); transition: border-color .15s; width: 100%;
}
.url-import-form input:focus { border-color: var(--primary); }
.url-import-error { color: var(--danger); font-size: .82rem; margin-top: .5rem; min-height: 1rem; }
.import-fail-msg {
  margin-top: .65rem; padding: .6rem .85rem;
  background: var(--danger-lite); border: 1px solid #fecaca; border-radius: 8px;
  color: var(--danger); font-size: .8rem; line-height: 1.5;
  display: flex; gap: .5rem; align-items: flex-start;
}
.import-fail-msg i { flex-shrink: 0; margin-top: .15rem; }
.relay-btn { margin-top: .65rem; font-size: .8rem; padding: .4rem 1rem; }
#import-queue { margin-top: 1rem; display: flex; flex-direction: column; gap: .75rem; }
@media (max-width: 700px) {
  .url-import-form { grid-template-columns: 1fr; }
}

/* ── Landing page – ad slots ── */
.ad-slot { width: 100%; overflow: hidden; }
.ad-slot-top    { border-bottom: 1px solid var(--border); background: var(--surface); padding: .6rem 1rem; }
.ad-slot-bottom { border-top: 1px solid var(--border); background: var(--surface); padding: .6rem 1rem; }
.ad-slot:empty  { display: none; }

.ad-banner {
  display: block; width: 100%; max-width: 728px; margin: .4rem auto;
  border-radius: 8px; overflow: hidden; text-decoration: none;
  transition: opacity .15s;
}
.ad-banner:hover { opacity: .88; }
.ad-banner img { display: block; width: 100%; height: auto; border-radius: 8px; }
.ad-banner-text {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-lite); color: var(--primary); font-weight: 600;
  padding: .65rem 1.5rem; border-radius: 8px; font-size: .9rem;
}

.ad-slot-buttons { display: flex; flex-direction: column; gap: .55rem; margin: .75rem 0; width: 100%; }
.ad-btn {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; text-decoration: none;
  background: #fff; border: 1.5px solid var(--border-hi);
  color: var(--text2); font-weight: 600; font-size: .88rem;
  border-radius: 10px; padding: .7rem 1rem;
  transition: border-color .15s, color .15s, background .15s;
}
.ad-btn:hover { border-color: var(--primary); color: var(--primary); background: #f8f9ff; }

/* ── Ad manager – admin panel ── */
.ad-form { padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: .9rem; }
.ad-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ad-form label { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; font-weight: 500; color: var(--text2); }
.ad-form select, .ad-form input[type="text"], .ad-form input[type="url"], .ad-form input[type="number"] {
  background: var(--bg); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); font-size: .9rem; padding: .55rem .8rem; outline: none;
  transition: border-color .15s; font-family: var(--font);
}
.ad-form select:focus, .ad-form input:focus { border-color: var(--primary); }
.ad-active-wrap { flex-direction: row !important; align-items: center; gap: .5rem !important; margin-top: 1.5rem; }
.ad-active-wrap input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.muted-label { color: var(--muted); font-weight: 400; }
.ad-form-msg { font-size: .85rem; }

.ad-type-badge {
  display: inline-block; border-radius: 20px; padding: .2rem .65rem;
  font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
}
.ad-type-banner { background: #fef3c7; color: #92400e; }
.ad-type-button { background: var(--primary-lite); color: var(--primary); }
.ad-status { font-size: .8rem; font-weight: 600; }
.ad-on  { color: var(--success); }
.ad-off { color: var(--muted); }

/* ── Responsive ── */
@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  #sidebar { display: none; }
  #main { margin-left: 0; padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .files-table th:nth-child(3), .files-table td:nth-child(3),
  .files-table th:nth-child(4), .files-table td:nth-child(4),
  .files-table th:nth-child(5), .files-table td:nth-child(5) { display: none; }
}
