/**
 * EduBooks Admin — compact design system
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
  --adm-bg: #0b0f19;
  --adm-surface: #111827;
  --adm-surface-subtle: #172033;
  --adm-card: #121a2b;
  --adm-card-hover: #172136;
  --adm-border: #1f2b40;
  --adm-border-strong: #2a3a55;

  --adm-text: #e8edf5;
  --adm-text-secondary: #9aa8bd;
  --adm-muted: #67768d;

  --adm-primary: #3b82f6;
  --adm-primary-hover: #2563eb;
  --adm-primary-subtle: rgba(59, 130, 246, 0.14);

  --adm-success: #10b981;
  --adm-success-subtle: rgba(16, 185, 129, 0.14);
  --adm-warning: #f59e0b;
  --adm-warning-subtle: rgba(245, 158, 11, 0.14);
  --adm-danger: #ef4444;
  --adm-danger-subtle: rgba(239, 68, 68, 0.14);
  --adm-info: #06b6d4;
  --adm-info-subtle: rgba(6, 182, 212, 0.14);

  --adm-sidebar-w: 210px;
  --adm-header-h: 48px;
  --adm-ctl-h: 30px;
  --adm-radius-sm: 5px;
  --adm-radius: 8px;
  --adm-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  --adm-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --adm-bg: #f4f6fa;
  --adm-surface: #ffffff;
  --adm-surface-subtle: #f1f4f8;
  --adm-card: #ffffff;
  --adm-card-hover: #f8fafc;
  --adm-border: #e3e8ef;
  --adm-border-strong: #cdd5e0;

  --adm-text: #0f172a;
  --adm-text-secondary: #475569;
  --adm-muted: #7b8798;

  --adm-primary: #2563eb;
  --adm-primary-hover: #1d4ed8;
  --adm-primary-subtle: rgba(37, 99, 235, 0.09);

  --adm-success: #059669;
  --adm-success-subtle: rgba(5, 150, 105, 0.1);
  --adm-warning: #d97706;
  --adm-warning-subtle: rgba(217, 119, 6, 0.1);
  --adm-danger: #dc2626;
  --adm-danger-subtle: rgba(220, 38, 38, 0.09);
  --adm-info: #0891b2;
  --adm-info-subtle: rgba(8, 145, 178, 0.1);

  --adm-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  --adm-shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.12);
}

/* ==========================================================================
   BASE
   ========================================================================== */
* { box-sizing: border-box; }

body.adm-body {
  background-color: var(--adm-bg);
  color: var(--adm-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Keep Bootstrap text helpers in sync with our theme */
.adm-body .text-body { color: var(--adm-text) !important; }
.adm-body .text-secondary,
.adm-body .text-muted { color: var(--adm-muted) !important; }
.adm-body .text-primary { color: var(--adm-primary) !important; }
.adm-body .text-warning { color: var(--adm-warning) !important; }
.adm-body .text-danger { color: var(--adm-danger) !important; }

.adm-muted { color: var(--adm-muted); }
.adm-sub { font-size: 11.5px; color: var(--adm-muted); line-height: 1.35; }
.adm-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.adm-strong { font-weight: 500; color: var(--adm-text); }
.adm-min0 { min-width: 0; }
.adm-truncate { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.adm-wrapper { display: flex; min-height: 100vh; width: 100%; }

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.adm-sidebar {
  width: var(--adm-sidebar-w);
  background-color: var(--adm-surface);
  border-right: 1px solid var(--adm-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 1040;
}

/* Animate the sidebar only after first paint, so it never slides on page load */
.adm-ready .adm-sidebar { transition: transform 0.2s ease, width 0.2s ease; }

.adm-brand {
  height: var(--adm-header-h);
  padding: 0 14px;
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--adm-text);
  flex-shrink: 0;
}

.adm-brand:hover { color: var(--adm-text); }

.adm-brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--adm-primary), #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}

.adm-brand-name { font-size: 14px; font-weight: 600; letter-spacing: -0.2px; }

.adm-nav {
  list-style: none;
  padding: 8px;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.adm-nav::-webkit-scrollbar { width: 4px; }
.adm-nav::-webkit-scrollbar-thumb { background: var(--adm-border); border-radius: 4px; }

.adm-nav-heading {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--adm-muted);
  font-weight: 500;
  padding: 12px 10px 4px;
}

.adm-nav-heading:first-child { padding-top: 4px; }

.adm-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 10px;
  color: var(--adm-text-secondary);
  text-decoration: none;
  border-radius: var(--adm-radius-sm);
  font-weight: 400;
  font-size: 13px;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  transition: background-color 0.12s, color 0.12s;
}

.adm-nav-link i { font-size: 15px; width: 16px; text-align: center; color: var(--adm-muted); }

.adm-nav-link:hover { color: var(--adm-text); background-color: var(--adm-surface-subtle); }
.adm-nav-link:hover i { color: var(--adm-text-secondary); }

.adm-nav-link.active { color: var(--adm-primary); background-color: var(--adm-primary-subtle); font-weight: 500; }
.adm-nav-link.active i { color: var(--adm-primary); }

.adm-nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  background-color: var(--adm-warning);
  color: #fff;
}

.adm-sidebar-footer {
  padding: 8px 10px;
  border-top: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.adm-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--adm-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}

.adm-avatar-subtle {
  background-color: var(--adm-surface-subtle);
  color: var(--adm-text-secondary);
  border: 1px solid var(--adm-border);
}

.adm-user-info { flex: 1; min-width: 0; line-height: 1.25; }
.adm-user-name { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-user-role { font-size: 11px; color: var(--adm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   MAIN & TOPBAR
   ========================================================================== */
.adm-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.adm-header {
  height: var(--adm-header-h);
  background-color: var(--adm-surface);
  border-bottom: 1px solid var(--adm-border);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.adm-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }

.adm-page-title {
  font-size: 15px;
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adm-header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.adm-header-sep { width: 1px; height: 20px; background: var(--adm-border); margin: 0 4px; }

.adm-icon-btn {
  width: var(--adm-ctl-h);
  height: var(--adm-ctl-h);
  border-radius: var(--adm-radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--adm-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  font-size: 15px;
  padding: 0;
  transition: background-color 0.12s, color 0.12s;
}

.adm-icon-btn:hover { color: var(--adm-text); background-color: var(--adm-surface-subtle); }

.adm-pulse-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--adm-warning);
  box-shadow: 0 0 0 2px var(--adm-surface);
}

.adm-content { padding: 16px; flex: 1; }

/* ==========================================================================
   STATS
   ========================================================================== */
.adm-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

@media (min-width: 1400px) {
  .adm-stats { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .adm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

.adm-stat {
  background-color: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--adm-shadow);
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

a.adm-stat:hover { border-color: var(--adm-border-strong); color: inherit; }

.adm-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--adm-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.adm-stat-body { min-width: 0; }
.adm-stat-val { font-size: 17px; font-weight: 600; line-height: 1.2; letter-spacing: -0.3px; color: var(--adm-text); }
.adm-stat-label { font-size: 11.5px; color: var(--adm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.adm-tone-primary { background-color: var(--adm-primary-subtle); color: var(--adm-primary); }
.adm-tone-success { background-color: var(--adm-success-subtle); color: var(--adm-success); }
.adm-tone-warning { background-color: var(--adm-warning-subtle); color: var(--adm-warning); }
.adm-tone-danger  { background-color: var(--adm-danger-subtle);  color: var(--adm-danger); }
.adm-tone-info    { background-color: var(--adm-info-subtle);    color: var(--adm-info); }

/* ==========================================================================
   CARDS
   ========================================================================== */
.adm-card {
  background-color: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  box-shadow: var(--adm-shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

.adm-card-header {
  min-height: 42px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.adm-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--adm-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.adm-card-title i { color: var(--adm-muted); font-size: 14px; }

.adm-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--adm-muted);
  background-color: var(--adm-surface-subtle);
  border-radius: 9px;
  padding: 0 7px;
  line-height: 18px;
}

.adm-card-body { padding: 12px; }

.adm-card-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--adm-border);
}

.adm-link-more {
  font-size: 12px;
  font-weight: 500;
  color: var(--adm-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.adm-link-more:hover { text-decoration: underline; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.adm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--adm-ctl-h);
  padding: 0 12px;
  font-weight: 500;
  font-size: 12.5px;
  font-family: inherit;
  border-radius: var(--adm-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.adm-btn i { font-size: 13px; }

.adm-btn-primary { background-color: var(--adm-primary); color: #fff; }
.adm-btn-primary:hover { background-color: var(--adm-primary-hover); color: #fff; }

.adm-btn-outline { background-color: transparent; border-color: var(--adm-border); color: var(--adm-text); }
.adm-btn-outline:hover { background-color: var(--adm-surface-subtle); border-color: var(--adm-border-strong); color: var(--adm-text); }

.adm-btn-block { width: 100%; }

.adm-action-group { display: inline-flex; align-items: center; gap: 2px; }
.adm-action-group form { display: inline; margin: 0; }

.adm-action-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--adm-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--adm-muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
  transition: background-color 0.12s, color 0.12s;
}

.adm-action-btn:hover { color: var(--adm-text); background-color: var(--adm-surface-subtle); }
.adm-action-btn.adm-action-view:hover    { color: var(--adm-info);    background-color: var(--adm-info-subtle); }
.adm-action-btn.adm-action-edit:hover    { color: var(--adm-primary); background-color: var(--adm-primary-subtle); }
.adm-action-btn.adm-action-delete:hover  { color: var(--adm-danger);  background-color: var(--adm-danger-subtle); }
.adm-action-btn.adm-action-approve:hover { color: var(--adm-success); background-color: var(--adm-success-subtle); }
.adm-action-btn.adm-action-reject:hover  { color: var(--adm-warning); background-color: var(--adm-warning-subtle); }

/* ==========================================================================
   TABLES
   ========================================================================== */
.adm-table-responsive { overflow-x: auto; width: 100%; }

.adm-table { width: 100%; border-collapse: collapse; margin: 0; color: var(--adm-text); }

.adm-table th {
  color: var(--adm-muted);
  font-size: 11px;
  font-weight: 500;
  text-align: left;
  padding: 7px 12px;
  border-bottom: 1px solid var(--adm-border);
  white-space: nowrap;
  background-color: var(--adm-surface-subtle);
}

.adm-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--adm-border);
  vertical-align: middle;
  font-size: 12.5px;
}

.adm-table th.text-end, .adm-table td.text-end { text-align: right; }
.adm-table tbody tr:hover td { background-color: var(--adm-card-hover); }
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-nowrap { white-space: nowrap; }

.adm-empty {
  text-align: center;
  padding: 28px 12px !important;
  color: var(--adm-muted);
  font-size: 12.5px;
}

.adm-empty i { display: block; font-size: 22px; margin-bottom: 4px; opacity: 0.6; }

.adm-cell-media { display: flex; align-items: center; gap: 10px; min-width: 0; }

.adm-thumb,
.adm-thumb-placeholder {
  width: 26px;
  height: 34px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--adm-border);
  background-color: var(--adm-surface-subtle);
  flex-shrink: 0;
}

.adm-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--adm-muted);
  font-size: 12px;
}

.adm-banner-preview {
  width: 64px;
  height: 34px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--adm-border);
  display: block;
}

/* ==========================================================================
   BADGES
   ========================================================================== */
.adm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 0 7px;
  height: 19px;
  border-radius: 4px;
  white-space: nowrap;
  text-transform: capitalize;
}

.adm-badge-primary { background-color: var(--adm-primary-subtle); color: var(--adm-primary); }
.adm-badge-success { background-color: var(--adm-success-subtle); color: var(--adm-success); }
.adm-badge-warning { background-color: var(--adm-warning-subtle); color: var(--adm-warning); }
.adm-badge-danger  { background-color: var(--adm-danger-subtle);  color: var(--adm-danger); }
.adm-badge-info    { background-color: var(--adm-info-subtle);    color: var(--adm-info); }
.adm-badge-neutral { background-color: var(--adm-surface-subtle); color: var(--adm-text-secondary); }
.adm-badge-upper   { text-transform: uppercase; letter-spacing: 0.3px; font-size: 10.5px; }

.adm-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ==========================================================================
   FORMS
   ========================================================================== */
.adm-form-group { margin-bottom: 10px; }
.adm-form-group:last-child { margin-bottom: 0; }

.adm-label {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--adm-text-secondary);
  margin-bottom: 4px;
}

.adm-req { color: var(--adm-danger); margin-left: 1px; }

.adm-input,
.adm-select,
.adm-textarea {
  width: 100%;
  height: var(--adm-ctl-h);
  background-color: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius-sm);
  padding: 0 9px;
  font-size: 12.5px;
  color: var(--adm-text);
  font-family: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.adm-textarea { height: auto; padding: 6px 9px; resize: vertical; min-height: 60px; }

.adm-select {
  appearance: none;
  padding-right: 26px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238592a6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 11px;
}

.adm-input[type="file"] { padding: 0; line-height: calc(var(--adm-ctl-h) - 2px); }
.adm-input[type="file"]::file-selector-button {
  height: 100%;
  border: 0;
  border-right: 1px solid var(--adm-border);
  background: var(--adm-surface-subtle);
  color: var(--adm-text);
  padding: 0 10px;
  margin-right: 8px;
  font: inherit;
  cursor: pointer;
}

.adm-input::placeholder,
.adm-textarea::placeholder { color: var(--adm-muted); opacity: 0.8; }

.adm-input:focus,
.adm-select:focus,
.adm-textarea:focus {
  outline: none;
  border-color: var(--adm-primary);
  box-shadow: 0 0 0 3px var(--adm-primary-subtle);
}

.adm-select option { background-color: var(--adm-surface); color: var(--adm-text); }

.adm-input-help { font-size: 11px; color: var(--adm-muted); margin-top: 3px; }

/* Inline filter toolbar in card headers */
.adm-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }
.adm-toolbar .adm-input,
.adm-toolbar .adm-select { width: auto; min-width: 130px; }
.adm-toolbar .adm-input-search { min-width: 200px; }

/* Compact checkbox/switch row */
.adm-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--adm-text);
  cursor: pointer;
  margin-bottom: 8px;
}

.adm-check:last-child { margin-bottom: 0; }

.adm-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--adm-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.adm-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

/* ==========================================================================
   ALERTS
   ========================================================================== */
.adm-alert {
  padding: 8px 12px;
  border-radius: var(--adm-radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12.5px;
}

.adm-alert-success { background-color: var(--adm-success-subtle); color: var(--adm-success); }
.adm-alert-danger  { background-color: var(--adm-danger-subtle);  color: var(--adm-danger); }

/* ==========================================================================
   LIST ROWS (system status etc.)
   ========================================================================== */
.adm-list { list-style: none; margin: 0; padding: 0; }

.adm-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--adm-border);
  font-size: 12.5px;
}

.adm-list li:last-child { border-bottom: 0; }
.adm-list-label { display: flex; align-items: center; gap: 8px; color: var(--adm-text); }
.adm-list-label i { color: var(--adm-muted); font-size: 14px; }

.adm-chart-wrap { position: relative; height: 230px; width: 100%; }

/* ==========================================================================
   PAGINATION (Bootstrap output, themed)
   ========================================================================== */
.adm-card-footer nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.adm-card-footer nav p { margin: 0; font-size: 12px; color: var(--adm-muted); }
.adm-card-footer .pagination { margin: 0; gap: 2px; }

.adm-card-footer .page-link {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 1px solid var(--adm-border) !important;
  border-radius: var(--adm-radius-sm) !important;
  background-color: transparent;
  color: var(--adm-text-secondary);
}

.adm-card-footer .page-link:hover { background-color: var(--adm-surface-subtle); color: var(--adm-text); }
.adm-card-footer .page-item.active .page-link { background-color: var(--adm-primary); border-color: var(--adm-primary) !important; color: #fff; }
.adm-card-footer .page-item.disabled .page-link { background-color: transparent; color: var(--adm-muted); opacity: 0.5; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
.adm-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1030;
}

.adm-backdrop.show { display: block; }

@media (max-width: 991.98px) {
  .adm-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--adm-shadow-lg);
  }

  .adm-sidebar.show { transform: translateX(0); }
}

@media (max-width: 575.98px) {
  .adm-header { padding: 0 10px; }
  .adm-content { padding: 10px; }
  .adm-toolbar { width: 100%; }
  .adm-toolbar .adm-input,
  .adm-toolbar .adm-select { flex: 1 1 140px; min-width: 0; }
  .adm-btn-label { display: none; }
}

/* ==========================================================================
   LOGIN
   ========================================================================== */
.adm-login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }

.adm-login-box {
  width: 100%;
  max-width: 340px;
  background-color: var(--adm-card);
  border: 1px solid var(--adm-border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--adm-shadow-lg);
}

.adm-login-header { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.adm-login-header h1 { font-size: 16px; font-weight: 600; margin: 0; }
.adm-login-header p { font-size: 12px; color: var(--adm-muted); margin: 0; }
.adm-brand-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.adm-login-header .adm-brand-logo { width: 34px; height: 34px; font-size: 17px; border-radius: 9px; }
.adm-login-hint { text-align: center; margin-top: 14px; font-size: 11.5px; color: var(--adm-muted); }
.adm-login-hint code { color: var(--adm-text-secondary); font-size: 11.5px; }

.adm-col-xs { width: 44px; }
.adm-toolbar .adm-input.adm-input-xs { width: 64px; min-width: 64px; flex: 0 0 64px; }


/* ==========================================================================
   COLLAPSIBLE SIDEBAR (desktop)
   ========================================================================== */
@media (min-width: 992px) {
  .adm-collapsed .adm-sidebar { width: 60px; }
  .adm-collapsed .adm-brand { justify-content: center; padding: 0; }
  .adm-collapsed .adm-brand-name,
  .adm-collapsed .adm-nav-text,
  .adm-collapsed .adm-user-info,
  .adm-collapsed .adm-sidebar-footer .adm-icon-btn { display: none; }
  .adm-collapsed .adm-nav { padding: 8px 10px; }
  .adm-collapsed .adm-nav-heading { font-size: 0; padding: 0; margin: 8px 6px; border-top: 1px solid var(--adm-border); }
  .adm-collapsed .adm-nav-heading:first-child { display: none; }
  .adm-collapsed .adm-nav-link { justify-content: center; padding: 0; position: relative; }
  .adm-collapsed .adm-nav-badge { position: absolute; top: 2px; right: 2px; min-width: 14px; height: 14px; line-height: 14px; font-size: 9px; padding: 0 3px; }
  .adm-collapsed .adm-sidebar-footer { justify-content: center; padding: 8px 0; }
}

/* ==========================================================================
   FORM PAGES
   ========================================================================== */
.adm-form-card { max-width: 880px; }

.adm-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.adm-form-grid > .adm-form-group { margin-bottom: 0; }
.adm-span-2 { grid-column: 1 / -1; }

.adm-form-section {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 500;
  color: var(--adm-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding-top: 8px;
  margin-top: 2px;
  border-top: 1px solid var(--adm-border);
}

.adm-form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

.adm-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.adm-checks .adm-check { margin-bottom: 0; }

.adm-form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background-color: var(--adm-surface-subtle);
}

.adm-form-footer .adm-form-meta { margin-right: auto; font-size: 11.5px; color: var(--adm-muted); }

@media (max-width: 575.98px) {
  .adm-form-grid { grid-template-columns: minmax(0, 1fr); }
}

.adm-emoji { font-size: 16px; line-height: 1; }

/* Single-line table rows: keep media small so rows stay tight */
.adm-table .adm-thumb,
.adm-table .adm-thumb-placeholder { width: 20px; height: 26px; }
.adm-table .adm-banner-preview { width: 48px; height: 26px; }
.adm-table .adm-avatar { width: 24px; height: 24px; font-size: 10.5px; }
.adm-table .adm-stat-icon { width: 26px; height: 26px; font-size: 13px; }
.adm-table .adm-cell-media { gap: 8px; }

/* ==========================================================================
   FIT-TO-SCREEN TABLES
   Fixed layout: short columns get fixed widths, text columns share the rest,
   overflow is cut with an ellipsis. Low-priority columns hide on small screens.
   ========================================================================== */
.adm-table { table-layout: fixed; }

.adm-table th,
.adm-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adm-table .adm-truncate,
.adm-table .adm-truncate-sm,
.adm-table .adm-truncate-lg {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adm-table .adm-badge {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 19px;
  vertical-align: middle;
}

.adm-table td:last-child { text-overflow: clip; }
.adm-table .adm-badge .adm-dot { margin-right: 4px; vertical-align: 1px; }
.adm-table .adm-cell-media > .adm-min0 { flex: 1 1 auto; overflow: hidden; }

.adm-title-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.adm-title-line .adm-truncate { flex: 0 1 auto; min-width: 0; }
.adm-title-line i { flex-shrink: 0; font-size: 11px; }

/* Column widths */
.adm-table .c-xs     { width: 48px; }
.adm-table .c-act1   { width: 54px; }
.adm-table .c-act2   { width: 84px; }
.adm-table .c-act3   { width: 114px; }
.adm-table .c-num    { width: 84px; }
.adm-table .c-code   { width: 84px; }
.adm-table .c-access { width: 80px; }
.adm-table .c-amt    { width: 96px; }
.adm-table .c-status { width: 104px; }
.adm-table .c-date   { width: 116px; }
.adm-table .c-sender { width: 132px; }
.adm-table .c-badge  { width: 190px; }
.adm-table .c-salary { width: 18%; }
.adm-table .c-company { width: 20%; }

/* Responsive column hiding */
@media (max-width: 1199.98px) {
  .adm-table .adm-hide-lg { display: none; }
}

@media (max-width: 767.98px) {
  .adm-table .adm-hide-md { display: none; }
}

/* ==========================================================================
   EDIT PAGE LAYOUT (main column + right sidebar)
   ========================================================================== */
.adm-edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
  align-items: start;
  max-width: 1180px;
}

.adm-edit-main .adm-card,
.adm-edit-side .adm-card { margin-bottom: 12px; }


@media (max-width: 991.98px) {
  .adm-edit-layout { grid-template-columns: minmax(0, 1fr); }
}

.adm-input.adm-input-lg { height: 36px; font-size: 14px; }

.adm-form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.adm-grow { flex: 1; }

/* File row (PDF) */
.adm-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px dashed var(--adm-border-strong);
  border-radius: var(--adm-radius);
  background-color: var(--adm-surface-subtle);
}

.adm-file-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--adm-radius-sm);
  background-color: var(--adm-danger-subtle);
  color: var(--adm-danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.adm-file-info { flex: 1; min-width: 0; }
.adm-file-info .adm-strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-file-meta { font-size: 11.5px; margin-top: 2px; }
.adm-file-hidden { display: none; }

/* Toggle switches */
.adm-switch-list { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; padding-bottom: 6px; }

.adm-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--adm-text);
  cursor: pointer;
}

.adm-switch input {
  appearance: none;
  -webkit-appearance: none;
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background-color: var(--adm-border-strong);
  position: relative;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
  transition: background-color 0.15s;
}

.adm-switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}

.adm-switch input:checked { background-color: var(--adm-primary); }
.adm-switch input:checked::after { transform: translateX(14px); }
.adm-switch input:focus-visible { outline: 2px solid var(--adm-primary); outline-offset: 2px; }

/* Cover image */
.adm-cover-row { display: flex; gap: 12px; align-items: flex-start; }

.adm-cover {
  width: 96px;
  aspect-ratio: 3 / 4;
  border-radius: var(--adm-radius-sm);
  border: 1px solid var(--adm-border);
  background-color: var(--adm-surface-subtle);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--adm-muted);
  font-size: 22px;
  flex-shrink: 0;
}

.adm-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.adm-cover-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.adm-cover-actions .adm-file-meta { word-break: break-all; }

/* Image card: small thumbnail beside the upload button */
.adm-image-row { display: flex; align-items: center; gap: 12px; }

.adm-image-preview {
  flex-shrink: 0;
  border-radius: var(--adm-radius-sm);
  border: 1px solid var(--adm-border);
  background-color: var(--adm-surface-subtle);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.adm-image-wide { width: 112px; height: 63px; }
.adm-image-cover { width: 54px; height: 72px; }
.adm-image-square { width: 64px; height: 64px; }
.adm-image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.adm-image-empty { color: var(--adm-muted); font-size: 18px; opacity: 0.7; }

.adm-image-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.adm-image-actions .adm-file-meta { margin: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Plain sidebar field list (date, order, selects) */
.adm-side-fields .adm-form-group:last-child { margin-bottom: 0; }

/* Large content textarea in main column */
.adm-textarea-lg { min-height: 220px; }

/* ---------- Bulk select (checkbox column + action bar) ---------- */
.adm-table .c-check { width: 44px; padding-right: 0; }
.adm-check-input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--adm-primary); vertical-align: middle; }
.adm-table tr.adm-row-selected > td { background: var(--adm-primary-subtle); }
.adm-bulk-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--adm-border);
  background: var(--adm-primary-subtle);
}
.adm-bulk-bar[hidden] { display: none; }
.adm-bulk-bar .adm-select { width: auto; min-width: 220px; }
.adm-bulk-count { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; margin-right: 4px; }
.adm-bulk-count i { color: var(--adm-primary); }
