/* ── Design tokens ─────────────────────────────────────────────── */
:root {
  --brand-1: #4F46E5;
  --brand-2: #7C3AED;
  --brand-3: #EC4899;
  --brand-grad: linear-gradient(135deg, #4F46E5 0%, #7C3AED 55%, #EC4899 100%);

  --success: #10B981;
  --success-soft: #ECFDF5;
  --danger: #EF4444;
  --danger-soft: #FEF2F2;
  --warning: #F59E0B;
  --warning-soft: #FFFBEB;
  --info: #0EA5E9;
  --info-soft: #F0F9FF;
  --violet-soft: #F5F3FF;

  --bg: #F1F5F9;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-soft: #94A3B8;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 4px 20px -8px rgba(15, 23, 42, .08), 0 2px 6px rgba(15, 23, 42, .04);
  --shadow-lg: 0 24px 48px -18px rgba(76, 29, 149, .25), 0 8px 16px rgba(15, 23, 42, .06);
}

/* ── Base ──────────────────────────────────────────────────────── */
html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Tajawal', 'Cairo', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; color: var(--text); }

/* ── Sidebar ───────────────────────────────────────────────────── */
:root {
  --sidebar-w: 260px;
  --sidebar-bg: linear-gradient(180deg, #0F172A 0%, #1E1B4B 100%);
  --topbar-h: 62px;
}

.app-sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: #E2E8F0;
  z-index: 40;
  display: flex; flex-direction: column;
  overflow-y: auto;
  box-shadow: 0 0 40px rgba(15, 23, 42, .35);
  border-inline-end: 1px solid rgba(255,255,255,.06);
}
.app-sidebar::-webkit-scrollbar { width: 8px; }
.app-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 8px; }

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--brand-grad);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  box-shadow: 0 8px 20px -8px rgba(124, 58, 237, .6);
  overflow: hidden;
}
.sidebar-logo--img { background: #fff; padding: 4px; }
.sidebar-logo--img img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-brand__name { font-weight: 800; font-size: 1.05rem; color: #fff; letter-spacing: .2px; }

.sidebar-nav {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 12px 12px;
  flex: 1 1 auto;
}
.sidebar-section {
  color: #64748B;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 14px 10px 6px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #CBD5E1 !important;
  font-weight: 500;
  font-size: .93rem;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, transform .1s ease;
  position: relative;
}
.sidebar-link:hover {
  background: rgba(255,255,255,.06);
  color: #fff !important;
}
.sidebar-link.active {
  background: linear-gradient(135deg, rgba(79,70,229,.25), rgba(236,72,153,.18));
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.sidebar-link.active::before {
  content: "";
  position: absolute;
  inset-inline-start: -12px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 3px;
  background: var(--brand-grad);
}
.sidebar-ico {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  flex-shrink: 0;
}
.sidebar-link.active .sidebar-ico { background: rgba(255,255,255,.12); }

.sidebar-footer {
  padding: 14px 14px 18px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
}
.sidebar-user__avatar {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--brand-grad);
  color: #fff; font-weight: 800; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-user__meta { min-width: 0; flex: 1; }
.sidebar-user__name { color: #fff; font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user__logout {
  display: inline-block;
  color: #F87171 !important; font-size: .78rem; text-decoration: none; font-weight: 500;
  margin-top: 2px;
}
.sidebar-user__logout:hover { color: #FCA5A5 !important; text-decoration: underline; }

/* ── App shell (main content beside sidebar) ───────────────────── */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
body.has-sidebar .app-shell { margin-inline-start: var(--sidebar-w); }

/* ── Top bar ───────────────────────────────────────────────────── */
.app-topbar {
  display: flex; align-items: center; gap: 14px;
  height: var(--topbar-h);
  padding: 0 24px;
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-toggle {
  display: none;
  border: 1px solid var(--border-strong);
  background: #fff;
  width: 40px; height: 40px; border-radius: 10px;
  padding: 0; cursor: pointer;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
}
.topbar-toggle span {
  display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px;
}
.topbar-title { font-weight: 700; font-size: 1rem; color: var(--text); }

/* Mobile off-canvas */
.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  z-index: 39;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(100%); transition: transform .28s ease; }
  html[dir="rtl"] .app-sidebar { transform: translateX(100%); }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  body.has-sidebar .app-shell { margin-inline-start: 0; }
  .topbar-toggle { display: inline-flex; }
  body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
}

/* ── Page shell ────────────────────────────────────────────────── */
main.page-shell {
  padding: 28px 24px 64px;
  flex: 1 1 auto;
}
main.page-shell > .container-xl,
main.page-shell > .container { max-width: 1440px; padding: 0; }
.page-header {
  margin: 0 0 20px 0;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.page-title {
  font-size: 1.5rem; font-weight: 800; margin: 0;
  display: flex; align-items: center; gap: 10px;
}
.page-title .accent-bar {
  width: 6px; height: 26px; border-radius: 3px;
  background: var(--brand-grad);
}

/* ── Filters card ──────────────────────────────────────────────── */
.filters-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.filters-card label { font-weight: 500; color: var(--text-muted); font-size: .85rem; margin-bottom: 6px; }
.filters-card .form-control,
.filters-card .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border-strong);
  padding: .55rem .8rem;
  font-size: .95rem;
}
.filters-card .form-control:focus,
.filters-card .form-select:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}
.btn-brand {
  background: var(--brand-grad);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: .6rem 1.2rem;
  font-weight: 600;
  transition: transform .12s ease, box-shadow .18s ease, filter .18s ease;
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .5);
}
.btn-brand:hover { color: #fff; filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(79, 70, 229, .55); }
.btn-brand:active { transform: translateY(0); }

/* ── Stat cards ────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.stat-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0; top: 0; bottom: 0;
  width: 4px; border-radius: 4px 0 0 4px;
  background: var(--brand-grad);
  opacity: .9;
}
.stat-card .stat-label { font-size: .82rem; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.stat-card .stat-value { font-size: 1.7rem; font-weight: 800; color: var(--text); line-height: 1.1; letter-spacing: -.5px; }
.stat-card .stat-sub { font-size: .78rem; color: var(--text-soft); margin-top: 4px; }
.stat-card .stat-icon {
  position: absolute;
  inset-inline-end: 16px; top: 16px;
  width: 42px; height: 42px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.stat-card.stat--brand   .stat-icon { background: var(--violet-soft); color: var(--brand-1); }
.stat-card.stat--brand::before      { background: var(--brand-grad); }
.stat-card.stat--success .stat-icon { background: var(--success-soft); color: var(--success); }
.stat-card.stat--success::before    { background: linear-gradient(180deg, #34D399, #10B981); }
.stat-card.stat--info    .stat-icon { background: var(--info-soft); color: var(--info); }
.stat-card.stat--info::before       { background: linear-gradient(180deg, #38BDF8, #0EA5E9); }
.stat-card.stat--danger  .stat-icon { background: var(--danger-soft); color: var(--danger); }
.stat-card.stat--danger::before     { background: linear-gradient(180deg, #F87171, #EF4444); }
.stat-card.stat--warning .stat-icon { background: var(--warning-soft); color: var(--warning); }
.stat-card.stat--warning::before    { background: linear-gradient(180deg, #FBBF24, #F59E0B); }
.stat-card .stat-value.text-danger  { color: var(--danger) !important; }
.stat-card .stat-value.text-success { color: var(--success) !important; }

/* ── Data cards ────────────────────────────────────────────────── */
.data-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}
.data-card__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #FAFBFF, #FFFFFF);
}
.data-card__title { font-weight: 700; font-size: 1rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.data-card__title .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand-1);
}
.data-card__body { padding: 0; }

/* ── Tables ────────────────────────────────────────────────────── */
.table-modern {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}
.table-modern thead th {
  background: #F8FAFC;
  color: var(--text-muted);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table-modern tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .93rem;
}
.table-modern tbody tr:last-child td { border-bottom: 0; }
.table-modern tbody tr { transition: background-color .12s ease; }
.table-modern tbody tr:hover { background: #FAFBFF; }
.table-modern .rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; border-radius: 8px;
  background: var(--violet-soft); color: var(--brand-1);
  font-weight: 700; font-size: .82rem; padding: 0 6px;
}
.table-modern .rank-badge.gold   { background: #FEF3C7; color: #B45309; }
.table-modern .rank-badge.silver { background: #F1F5F9; color: #475569; }
.table-modern .rank-badge.bronze { background: #FEE4E2; color: #B42318; }
.table-modern .num { font-variant-numeric: tabular-nums; font-weight: 500; }
.table-modern .num.strong { font-weight: 700; color: var(--text); }
.table-modern .num.neg { color: var(--danger); }
.table-modern .num.pos { color: var(--success); }
.table-modern .cell-empty { color: var(--text-soft); }

/* ── Chart container ───────────────────────────────────────────── */
.chart-wrap {
  position: relative;
  height: 320px;
  padding: 16px 18px 8px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #FCFBFF 0%, #FFFFFF 60%);
}
@media (max-width: 640px) {
  .chart-wrap { height: 260px; padding: 12px 8px 4px; }
}

/* ── Alerts ────────────────────────────────────────────────────── */
.alert-modern {
  border-radius: var(--radius);
  padding: 14px 18px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 12px;
}
.alert-modern .alert-emoji { font-size: 22px; }
.alert-modern.tone-warning { border-color: #FDE68A; background: var(--warning-soft); color: #92400E; }
.alert-modern.tone-success { border-color: #A7F3D0; background: var(--success-soft); color: #065F46; }
.alert-modern.tone-danger  { border-color: #FECACA; background: var(--danger-soft);  color: #991B1B; }

/* ── Status pills & row action buttons ─────────────────────────── */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.status-pill--on  { background: var(--success-soft); color: #065F46; }
.status-pill--on::before  { background: var(--success); }
.status-pill--off { background: #F1F5F9; color: #475569; }
.status-pill--off::before { background: #94A3B8; }

.btn-icon {
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-muted);
  width: 34px; height: 34px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
  margin-inline-start: 4px;
}
.btn-icon:hover { transform: translateY(-1px); }
.btn-icon--edit:hover { background: var(--violet-soft); color: var(--brand-1); border-color: #C4B5FD; }
.btn-icon--del:hover  { background: var(--danger-soft); color: var(--danger);  border-color: #FCA5A5; }

/* ── Sync status pills ─────────────────────────────────────────── */
.sync-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-size: .8rem; font-weight: 600;
  border: 1px solid transparent;
}
.sync-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.sync-pill--fresh { background: var(--success-soft); color: #065F46; border-color: #A7F3D0; }
.sync-pill--fresh::before { background: var(--success); box-shadow: 0 0 0 3px rgba(16, 185, 129, .25); animation: pulse 1.8s ease-in-out infinite; }
.sync-pill--warn  { background: var(--warning-soft); color: #92400E; border-color: #FDE68A; }
.sync-pill--warn::before  { background: var(--warning); }
.sync-pill--stale { background: var(--danger-soft); color: #991B1B; border-color: #FECACA; }
.sync-pill--stale::before { background: var(--danger); }
.sync-pill--never { background: #F1F5F9; color: #475569; border-color: var(--border-strong); }
.sync-pill--never::before { background: #94A3B8; }
.sync-pill--info  { background: var(--info-soft); color: #075985; border-color: #BAE6FD; }
.sync-pill--info::before  { background: var(--info); }
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%     { opacity: .4; }
}

/* ── Health rows on Sync Status page ───────────────────────────── */
.health-row {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #F8FAFC;
}
.health-row--ok   { background: var(--success-soft); border-color: #A7F3D0; }
.health-row--bad  { background: var(--danger-soft);  border-color: #FECACA; }
.health-row--info { background: var(--info-soft);    border-color: #BAE6FD; }
.health-row .health-icon { font-size: 26px; line-height: 1; padding-top: 2px; }
.health-row .health-title { font-weight: 700; font-size: .95rem; margin-bottom: 2px; }
.health-row .health-value { font-size: 1.15rem; margin-bottom: 4px; }
.health-row .health-hint { color: var(--text-muted); font-size: .85rem; }
.health-row .health-hint ul { padding-inline-start: 18px; margin: 0; }
.health-row .health-hint li + li { margin-top: 4px; }

/* ── Modal polish ──────────────────────────────────────────────── */
.branch-modal.modal-content {
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.branch-modal .modal-header {
  background: var(--brand-grad);
  color: #fff;
  border: 0;
  padding: 16px 20px;
}
.branch-modal .modal-header .modal-title { font-weight: 700; }
.branch-modal .modal-header .btn-close { filter: invert(1) grayscale(1); opacity: .8; }
.branch-modal .modal-body { padding: 22px; }
.branch-modal .form-label { font-weight: 500; color: var(--text-muted); font-size: .85rem; margin-bottom: 6px; }
.branch-modal .form-control {
  border-radius: var(--radius-sm);
  border-color: var(--border-strong);
  padding: .55rem .8rem;
  font-size: .95rem;
}
.branch-modal .form-control:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}
.branch-modal .modal-footer { border-top: 1px solid var(--border); padding: 14px 20px; }
.branch-modal .form-check-input:checked {
  background-color: var(--brand-1);
  border-color: var(--brand-1);
}

/* ── Settings preview components ───────────────────────────────── */
.logo-preview {
  width: 100%; max-width: 140px; aspect-ratio: 1;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: #FAFBFF; overflow: hidden; margin-inline: auto;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.logo-preview--empty { font-size: 42px; color: var(--text-soft); background: #F1F5F9; }

.preview-nav {
  background: var(--brand-grad);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 10px;
  color: #fff;
}
.preview-nav__badge {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255,255,255,.18);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; overflow: hidden;
}
.preview-nav__badge--img { background: #fff; padding: 3px; }
.preview-nav__name { font-weight: 800; font-size: 1rem; }
.preview-color-swatch {
  width: 100%; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ── Detail modal (invoice / return popups) ────────────────────── */
.detail-modal .modal-body { padding: 0; }
.detail-modal.detail-modal--danger .modal-header {
  background: linear-gradient(135deg, #DC2626 0%, #EF4444 55%, #F59E0B 100%);
}
.detail-meta {
  padding: 18px 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 24px;
  background: linear-gradient(180deg, #FCFBFF 0%, #FFFFFF 60%);
  border-bottom: 1px solid var(--border);
}
.detail-meta__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.detail-meta__label { color: var(--text-muted); font-size: .85rem; font-weight: 500; }
.detail-meta__val   { color: var(--text); font-weight: 600; text-align: end; }

.detail-note {
  padding: 12px 22px;
  background: var(--warning-soft);
  color: #92400E;
  font-size: .9rem;
  border-bottom: 1px solid #FDE68A;
}
.detail-note--danger {
  background: var(--danger-soft);
  color: #991B1B;
  border-bottom-color: #FECACA;
}

.detail-items { padding: 0; }
.detail-items .table-modern { margin: 0; }
.detail-items .table-modern thead th { background: #FAFBFF; }

.detail-totals {
  padding: 14px 22px 18px;
  background: linear-gradient(180deg, #FFFFFF, #FAFBFF);
  border-top: 1px solid var(--border);
}
.detail-totals__row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  font-size: .95rem;
  color: var(--text-muted);
}
.detail-totals__row .num { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--text); }
.detail-totals__row--strong { border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 10px; }
.detail-totals__row--strong span:first-child { font-weight: 700; color: var(--text); font-size: 1rem; }
.detail-totals__row--strong .num { font-weight: 800; font-size: 1.15rem; }

/* ── Clickable table rows ──────────────────────────────────────── */
.table-modern tr.clickable-row { cursor: pointer; }
.table-modern tr.clickable-row:hover { background: linear-gradient(90deg, rgba(79,70,229,.04), rgba(236,72,153,.04)); }
.table-modern tr.clickable-row:hover .rank-badge { background: var(--brand-1); color: #fff; }

/* ── Login screen ──────────────────────────────────────────────── */
.login-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 58, 237, .35), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(236, 72, 153, .28), transparent 55%),
    linear-gradient(160deg, #0F172A 0%, #1E1B4B 60%, #4C1D95 100%);
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 32px 32px 28px;
  border: 1px solid rgba(255,255,255,.6);
  animation: rise .5s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-brand {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
}
.login-brand .logo {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--brand-grad);
  color: #fff; font-weight: 800; font-size: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px -8px rgba(124, 58, 237, .5);
}
.login-brand h3 { margin: 0; font-size: 1.35rem; font-weight: 800; }
.login-brand p  { margin: 2px 0 0; color: var(--text-muted); font-size: .85rem; }

.login-card .form-control {
  border-radius: var(--radius-sm);
  border-color: var(--border-strong);
  padding: .65rem .9rem;
  font-size: .95rem;
}
.login-card .form-control:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .18);
}
.login-card .form-label { font-weight: 500; font-size: .88rem; color: var(--text); margin-bottom: 6px; }
.login-card .btn-brand { width: 100%; padding: .7rem 1rem; margin-top: 8px; }
.login-error {
  background: var(--danger-soft);
  color: #991B1B;
  border: 1px solid #FECACA;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: .88rem;
  margin-bottom: 6px;
}

/* ── Footer ────────────────────────────────────────────────────── */
.app-footer {
  text-align: center;
  color: var(--text-soft);
  font-size: .82rem;
  padding: 24px 0 32px;
}
