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

:root {
  --primary:       #3b547d;
  --primary-dark:  #2d4161;
  --primary-light: #eef2f8;
  --danger:        #ef4444;
  --danger-dark:   #dc2626;
  --success:       #16a34a;
  --success-light: #f0fdf4;
  --warning:       #f59e0b;
  --bg:            #f0f4f8;
  --surface:       #ffffff;
  --border:        #d8e1ec;
  --text:          #0f172a;
  --text-muted:    #5b6e87;
  --text-light:    #8898ae;
  --header-bg:     #3b547d;
  --header-text:   #f8fafc;
  --radius:        8px;
  --radius-sm:     4px;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:     0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html, body { height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; }
fieldset { border: none; }

/* ── Site header ─────────────────────────────────────────────────────────── */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.05);
}
.header-inner {
  max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.5rem;
}
.site-logo {
  font-size: 1.1rem; font-weight: 700; color: var(--header-text);
  text-decoration: none; letter-spacing: -.01em;
  display: flex; align-items: center; gap: .6rem;
}
.site-logo-img { height: 28px; width: auto; display: block; }
.site-logo:hover { color: #93c5fd; text-decoration: none; }
.header-nav { display: flex; align-items: center; gap: 1rem; }
.nav-link { color: #94a3b8; font-size: .875rem; transition: color .15s; }
.nav-link:hover, .nav-link.active { color: var(--header-text); text-decoration: none; }
.nav-logout { color: #94a3b8; }
.nav-logout:hover { color: #f87171; }
.nav-user { display: flex; align-items: center; gap: .4rem; color: #cbd5e1; font-size: .875rem; }

/* ── Site footer ─────────────────────────────────────────────────────────── */
.site-footer {
  text-align: center; padding: .75rem; font-size: .75rem;
  color: var(--text-muted); border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .5rem 1rem; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all .15s; white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary  { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline  { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-danger   { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-dark); }
.btn-orange   { background: #c75b21; color: #fff; border-color: #c75b21; }
.btn-orange:hover { background: #a34718; border-color: #a34718; }
.btn-sm { padding: .3rem .65rem; font-size: .8125rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); font-size: .875rem; margin-bottom: 1rem; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: var(--success-light); color: #166534; border: 1px solid #bbf7d0; }

/* ── Form fields ─────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-size: .8125rem; font-weight: 500; color: var(--text); }
.field small.field-hint { font-size: .75rem; color: var(--text-muted); }
.field input[type=text], .field input[type=password], .field input[type=number],
.field input[type=email], .field input[type=url], .field input[type=date],
.field select, .field textarea {
  padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .875rem; background: var(--surface); color: var(--text);
  transition: border-color .15s; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.field-check { display: flex; align-items: center; }
.check-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .875rem; }
.check-label input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.field-row { display: grid; grid-template-columns: 1fr auto; gap: .75rem; }
.field-narrow { max-width: 120px; }
.field-wide { grid-column: 1 / -1; }

/* ── Login page ──────────────────────────────────────────────────────────── */
.login-body { background: #3b547d; min-height: 100vh; display: flex; align-items: center; }
.login-wrap { width: 100%; display: flex; justify-content: center; padding: 2rem 1rem; }
.login-card {
  background: var(--surface); border-radius: var(--radius); padding: 2.5rem 2rem;
  width: 100%; max-width: 450px; box-shadow: var(--shadow-md);
}
.login-logo { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.login-logo img { width: 100%; max-width: 250px; height: auto; display: block; }
.login-title { font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: .25rem; }
.login-subtitle { font-size: .875rem; color: var(--text-muted); text-align: center; margin-bottom: 1.5rem; }
.login-form { display: flex; flex-direction: column; gap: 1rem; }

/* ── File manager layout ─────────────────────────────────────────────────── */
body { display: flex; flex-direction: column; }
.site-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.fm-layout { flex: 1; display: flex; flex-direction: column; max-width: 1440px; margin: 0 auto; width: 100%; padding: 0; overflow: hidden; }
.fm-body { flex: 1; display: flex; flex-direction: row; overflow: hidden; }
.fm-main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

/* Sidebar */
.fm-sidebar {
  width: clamp(200px, 25%, 280px); flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  transition: width .2s ease;
}
.fm-sidebar.collapsed { width: 0; }
.fm-sidebar-hd {
  padding: .6rem 1rem; font-size: .6875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted);
  border-bottom: 1px solid var(--border); white-space: nowrap; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
}
.fm-tree-expand-all-btn {
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: .6875rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--primary);
}
.fm-tree-expand-all-btn:hover { text-decoration: underline; }
.fm-tree { overflow-y: auto; flex: 1; padding: .375rem 0; }
.fm-tree-loading { padding: .5rem 1rem; font-size: .8125rem; color: var(--text-muted); }
.fm-sidebar-tooltip {
  position: fixed; z-index: 9999; pointer-events: none;
  background: #1e293b; color: #f8fafc;
  padding: .3rem .65rem; border-radius: var(--radius-sm);
  font-size: .8125rem; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  transform: translateY(-50%);
}
.fm-sidebar-tooltip[hidden] { display: none; }
.fm-tree-node { }
.fm-tree-row {
  display: flex; align-items: center; padding: .2rem .5rem .2rem 0;
  white-space: nowrap; min-width: 0; cursor: default;
}
.fm-tree-row:hover { background: var(--bg); }
.fm-tree-row.active { background: var(--primary-light); }
.fm-tree-row.active .fm-tree-link { color: var(--primary); font-weight: 500; }
.fm-tree-expand {
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  flex-shrink: 0; border-radius: var(--radius-sm); padding: 0;
}
.fm-tree-expand:hover { color: var(--text); }
.fm-tree-expand svg { transition: transform .15s; }
.fm-tree-expand.open svg { transform: rotate(90deg); }
.fm-tree-expand.leaf { visibility: hidden; pointer-events: none; }
.fm-tree-icon { color: #f59e0b; flex-shrink: 0; display: flex; }
.fm-tree-link {
  color: var(--text); font-size: .8125rem; text-decoration: none;
  flex: 1; overflow: hidden; text-overflow: ellipsis; padding: .1rem .25rem;
}
.fm-tree-link:hover { color: var(--primary); text-decoration: none; }
.fm-tree-children { padding-left: 1rem; }

/* Toolbar */
.fm-toolbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .75rem;
  padding: .6rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.fm-toolbar-left   { display: flex; align-items: center; gap: .5rem; min-width: 0; overflow: hidden; }
.fm-toolbar-center { width: 260px; }
.toolbar-actions   { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; }

/* Breadcrumb truncation */
.breadcrumb { flex-wrap: nowrap; overflow: hidden; min-width: 0; }
.bc-current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Filter input */
.fm-filter-wrap {
  position: relative; display: flex; align-items: center;
}
.fm-filter-icon {
  position: absolute; left: .5rem; color: var(--text-muted); pointer-events: none; flex-shrink: 0;
}
.fm-filter-input {
  width: 100%; padding: .3rem .5rem .3rem 1.75rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .8125rem; background: var(--bg); color: var(--text);
  transition: border-color .15s;
}
.fm-filter-input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.fm-filter-input::placeholder { color: var(--text-light); }
.fm-filter-clear {
  position: absolute; right: .35rem; background: none; border: none;
  cursor: pointer; color: var(--text-muted); font-size: 1rem; line-height: 1;
  padding: .1rem .25rem; border-radius: var(--radius-sm);
}
.fm-filter-clear:hover { color: var(--text); background: var(--border); }
.fm-filter-no-results { padding: 2rem; text-align: center; color: var(--text-muted); font-size: .9375rem; }

/* Condensed view */
.fm-condensed .fm-table th { padding: .375rem .75rem; }
.fm-condensed .fm-table td { padding: .2rem .75rem; }
.fm-condensed .col-icon svg { width: 16px; height: 16px; }
.fm-condensed .fm-link { font-size: .875rem; }
.fm-condensed .col-size,
.fm-condensed .col-date { font-size: .75rem; }
.fm-condensed .act-btn { padding: .15rem .25rem; }
.fm-condensed .act-btn svg { width: 13px; height: 13px; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.bc-item { font-size: .875rem; color: var(--primary); display: flex; align-items: center; }
.bc-item:hover { text-decoration: underline; }
.bc-home { color: var(--text-muted); }
.bc-home:hover { color: var(--text); text-decoration: none; }
.bc-current { color: var(--text); font-weight: 500; }
.bc-sep { color: var(--text-light); font-size: .75rem; user-select: none; }

/* File list */
.fm-content { flex: 1; padding: 0; overflow: auto; }
.fm-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 4rem 2rem; color: var(--text-muted); text-align: center; }
.fm-empty p { font-size: .9375rem; line-height: 1.6; }

.fm-table { width: 100%; border-collapse: collapse; }
.fm-table thead { background: #f8fafc; position: sticky; top: 0; }
.fm-table th {
  padding: .625rem 1rem; text-align: left; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.fm-table tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
.fm-table tbody tr:hover { background: #f8fafc; }
.fm-table td { padding: .625rem 1rem; vertical-align: middle; }

.col-icon  { width: 36px; padding-right: 0 !important; }
.col-name  { min-width: 120px; }
.col-size  { width: 90px; color: var(--text-muted); font-size: .8125rem; white-space: nowrap; }
.col-date  { width: 160px; color: var(--text-muted); font-size: .8125rem; white-space: nowrap; }
.col-actions { width: 120px; text-align: right; padding-right: 1rem !important; white-space: nowrap; }
.act-sep {
  display: inline-block; width: 1px; height: 14px;
  background: var(--border); margin: 0 .35rem;
  vertical-align: middle; flex-shrink: 0;
}
.fm-condensed .act-sep { height: 12px; margin: 0 .25rem; }

.icon-folder { color: #f59e0b; }
.fm-link { color: var(--text); font-size: .9375rem; }
.fm-link:hover { color: var(--primary); text-decoration: none; }

.act-btn {
  background: none; border: none; cursor: pointer; padding: .25rem .35rem;
  border-radius: var(--radius-sm); color: var(--text-muted); transition: all .15s;
  display: inline-flex; align-items: center;
}
.act-btn:hover { background: var(--border); color: var(--text); }
.act-danger:hover { background: #fee2e2; color: var(--danger); }

/* Drop overlay */
.drop-overlay {
  display: none; position: fixed; inset: 0; background: rgba(37,99,235,.12);
  backdrop-filter: blur(2px); z-index: 200; pointer-events: none;
}
.drop-overlay.active { display: flex; align-items: center; justify-content: center; }
.drop-overlay-inner {
  background: var(--surface); border: 2px dashed var(--primary);
  border-radius: var(--radius); padding: 3rem 4rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  color: var(--primary); font-size: 1.25rem; font-weight: 600;
  box-shadow: var(--shadow-md); pointer-events: none;
}

/* ── Modals ───────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.4);
  display: flex; align-items: center; justify-content: center; z-index: 500;
}
.modal-backdrop[hidden] { display: none !important; }
.modal {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.75rem; width: 100%; max-width: 440px;
  box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 1.25rem;
}
.modal-title { font-size: 1.125rem; font-weight: 600; }
.modal-footer { display: flex; justify-content: flex-end; gap: .5rem; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999;
  background: var(--header-bg); color: var(--header-text);
  padding: .75rem 1.25rem; border-radius: var(--radius-sm);
  font-size: .875rem; box-shadow: var(--shadow-md);
  animation: slideIn .2s ease; max-width: 340px;
}
.toast[hidden] { display: none; }
.toast.toast-error { background: var(--danger); }
.toast.toast-success { background: var(--success); }
@keyframes slideIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Admin layout ────────────────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: calc(100vh - 53px); }
.admin-sidebar {
  width: 220px; background: var(--surface); border-right: 1px solid var(--border);
  padding: 1rem 0; flex-shrink: 0;
}
.admin-nav { display: flex; flex-direction: column; gap: .125rem; }
.admin-nav-section {
  font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-light); padding: .9rem 1.25rem .25rem;
  margin-top: .25rem;
}
.admin-nav-item {
  display: flex; align-items: center; gap: .625rem;
  padding: .625rem 1.25rem; color: var(--text-muted); font-size: .875rem;
  transition: all .15s; border-left: 3px solid transparent;
}
.admin-nav-item.admin-nav-sub { padding-left: 1.5rem; }
.admin-nav-item:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.admin-nav-item.active { background: var(--primary-light); color: var(--primary); border-left-color: var(--primary); font-weight: 500; }
.admin-content { flex: 1; padding: 1.75rem 2rem; overflow: auto; }
.admin-page { }
.page-title { font-size: 1.375rem; font-weight: 700; margin-bottom: 1.5rem; }
.section-title { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 .75rem; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.stat-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .5rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text); }
.stat-value-sm { font-size: 1rem; word-break: break-all; }

/* Settings */
.settings-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem; }
.settings-section-title { font-size: .9375rem; font-weight: 600; margin-bottom: 1.25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 640px) { .settings-grid { grid-template-columns: 1fr; } }
.form-actions { display: flex; justify-content: flex-end; margin-top: 1rem; }
.form-section { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.form-section legend { font-weight: 600; font-size: .875rem; padding: 0 .5rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

/* Inline form (users page) */
.inline-form { display: flex; gap: 1rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.data-table th { padding: .625rem 1rem; text-align: left; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); background: #f8fafc; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: .6875rem 1rem; font-size: .875rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fafafa; }
.data-table-sm th, .data-table-sm td { padding: .5rem .75rem; }
.nowrap { white-space: nowrap; }
.text-truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-table { table-layout: fixed; }
.audit-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-muted { color: var(--text-muted); }

/* Badges */
.badge {
  display: inline-block; padding: .15rem .5rem; border-radius: 99px;
  font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  background: var(--border); color: var(--text-muted);
}
.badge-upload   { background: #dcfce7; color: #166534; }
.badge-download, .badge-download_zip { background: #dbeafe; color: #1d4ed8; }
.badge-delete   { background: #fee2e2; color: #991b1b; }
.badge-rename   { background: #fef3c7; color: #92400e; }
.badge-mkdir    { background: #ede9fe; color: #5b21b6; }
.badge-login    { background: #f0fdf4; color: #166534; }
.badge-logout   { background: #f8fafc; color: var(--text-muted); }
.badge-active   { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-sftp-login  { background: #dcfce7; color: #166534; }
.badge-sftp-failed { background: #fee2e2; color: #991b1b; }
.badge-sftp-upload { background: #dbeafe; color: #1e3a6e; }
.badge-sftp-banned { background: #ffedd5; color: #9a3412; }
.badge-sftp-scored { background: #fef3c7; color: #92400e; }

/* SFTPGo status strip */
.sftpgo-status-strip { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.25rem; margin-bottom: 1.5rem; padding: .6rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: .8125rem; }
.sftpgo-status-item { display: flex; align-items: center; gap: .35rem; color: var(--text-muted); }
.sftpgo-status-on  .sftpgo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.sftpgo-status-off .sftpgo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.sftpgo-status-on  { color: var(--text); }

/* Sessions */
.stat-card-active { border-color: var(--primary); background: var(--primary-light); }
.stat-card-active .stat-value { color: var(--primary); }
.badge-protocol { background: var(--primary-light); color: var(--primary-dark); font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: .15rem .45rem; border-radius: var(--radius-sm); }
.badge-transfer-upload   { background: #dbeafe; color: #1e3a6e; font-size: .7rem; padding: .1rem .35rem; border-radius: var(--radius-sm); }
.badge-transfer-download { background: #dcfce7; color: #166534; font-size: .7rem; padding: .1rem .35rem; border-radius: var(--radius-sm); }
.session-transfer { display: flex; align-items: center; gap: .4rem; margin-bottom: .2rem; }
.session-transfer-name { font-size: .8rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-danger-outline { border: 1px solid var(--danger); color: var(--danger); background: transparent; }
.btn-danger-outline:hover { background: var(--danger); color: #fff; }
.btn-inline-ban { font-size: .7rem; font-weight: 600; padding: .1rem .35rem; border-radius: var(--radius-sm); border: 1px solid var(--danger); color: var(--danger); background: transparent; cursor: pointer; line-height: 1.4; vertical-align: middle; }
.btn-inline-ban:hover { background: var(--danger); color: #fff; }

/* Defender config strip */
.defender-config { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.defender-config-item { display: flex; flex-direction: column; gap: .15rem; background: var(--primary-light); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .45rem .75rem; min-width: 9rem; }
.defender-config-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.defender-config-val { font-size: .9375rem; font-weight: 600; color: var(--primary-dark); }

/* Pagination */
.pagination { display: flex; gap: .25rem; margin-top: 1rem; flex-wrap: wrap; align-items: center; }
.page-link { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 .5rem; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: .8125rem; color: var(--text); transition: all .15s; }
.page-link:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.page-link.page-prev-next { font-size: 1rem; color: var(--text-muted); }
.page-ellipsis { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; font-size: .875rem; color: var(--text-muted); cursor: default; }

/* Filter form */
.filter-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.filter-form .field { min-width: 140px; flex: 1; }

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

/* Setup page extras */
.field-row { display: grid; grid-template-columns: 1fr 110px; gap: .75rem; align-items: start; }

/* Uppy: position informer in the lower-right of the dashboard */
.uppy-Dashboard-inner .uppy-Informer { left: auto; right: 1rem; text-align: right; }
/* Error messages (role="alert") get a red pill */
.uppy-Dashboard-inner .uppy-Informer p[role="alert"] { background: #dc2626 !important; color: #fff !important; }

/* File manager help bar */
.fm-help { padding: .6rem 1.5rem; font-size: .8rem; color: var(--text-muted); border-top: 1px solid var(--border); display: flex; align-items: center; gap: .45rem; }
.fm-help svg { flex-shrink: 0; opacity: .6; }

/* Multi-select checkbox column */
.col-check { width: 2rem; padding-right: 0; }
.col-check input[type=checkbox], .row-check { cursor: pointer; width: 15px; height: 15px; accent-color: var(--primary); }
.fm-row:has(.row-check:checked) { background: color-mix(in srgb, var(--primary) 6%, transparent); }

/* Selection bar */
.selection-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 200; background: var(--primary); color: #fff; padding: .75rem 1.5rem; display: flex; align-items: center; gap: .75rem; box-shadow: 0 -2px 12px rgba(0,0,0,.15); }
.selection-bar[hidden] { display: none; }
.selection-count { font-size: .9rem; font-weight: 500; white-space: nowrap; }
.selection-spacer { flex: 1; }
.selection-bar .btn-outline { color: #fff; border-color: rgba(255,255,255,.5); }
.selection-bar .btn-outline:hover { background: rgba(255,255,255,.15); }
.selection-bar .selection-delete { background: #dc2626; border-color: #dc2626; color: #fff; }
.selection-bar .selection-delete:hover { background: #b91c1c; border-color: #b91c1c; }

/* Uppy: show folder name as a small badge above the title without changing layout */
.uppy-DashboardContent-title[data-folder] { position: relative; }
.uppy-DashboardContent-title[data-folder]::before {
  content: attr(data-folder);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7em;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
  pointer-events: none;
}
