/* ISP Management System — Arabic RTL Admin UI */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600&family=Tajawal:wght@400;500;700;800&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --color-primary: #0B6E6A;
  --color-primary-dark: #085652;
  --color-primary-light: #0E8A85;
  --color-primary-muted: rgba(11, 110, 106, 0.1);

  --color-text: #1A2332;
  --color-text-muted: #5A6578;
  --color-text-light: #8A94A6;

  --color-bg: #F3F6F4;
  --color-bg-alt: #E8EEF0;
  --color-surface: #FFFFFF;
  --color-border: #D8E0E4;
  --color-border-light: #E8EDF0;

  --color-success: #1A7A4C;
  --color-success-bg: #E6F5ED;
  --color-warning: #B8860B;
  --color-warning-bg: #FDF6E3;
  --color-danger: #C0392B;
  --color-danger-bg: #FDECEA;
  --color-info: #1A5F8A;
  --color-info-bg: #E8F2FA;

  --font-primary: 'Tajawal', sans-serif;
  --font-secondary: 'IBM Plex Sans Arabic', sans-serif;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --sidebar-width: 260px;
  --topbar-height: 64px;

  --transition-fast: 0.2s ease;
  --transition-sidebar: 0.25s ease;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-primary);
  color: var(--color-text);
  background: linear-gradient(160deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
  min-height: 100vh;
  line-height: 1.6;
  direction: rtl;
  overflow-x: hidden;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

/* ── App Shell ─────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--transition-sidebar);
}

.app-main {
  flex: 1;
  margin-right: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-right var(--transition-sidebar);
}

/* ── Sidebar Brand ─────────────────────────────────────────── */
.sidebar-brand {
  padding: var(--space-lg) var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  text-align: center;
}

.sidebar-brand__logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: contain;
  margin-bottom: var(--space-sm);
}

.sidebar-brand__name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.sidebar-brand__tagline {
  font-family: var(--font-secondary);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

/* ── Sidebar Nav ─────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-sm);
}

.sidebar-nav__list {
  list-style: none;
}

.sidebar-nav__item {
  margin-bottom: 2px;
}

.sidebar-nav__link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.65rem var(--space-md);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.925rem;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-nav__link:hover {
  background: var(--color-primary-muted);
  color: var(--color-primary);
}

.sidebar-nav__link.active {
  background: var(--color-primary-muted);
  color: var(--color-primary);
  font-weight: 700;
}

.sidebar-nav__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-nav__link.active .sidebar-nav__icon,
.sidebar-nav__link:hover .sidebar-nav__icon {
  opacity: 1;
}

.sidebar-nav__divider {
  height: 1px;
  background: var(--color-border-light);
  margin: var(--space-sm) var(--space-md);
}

.sidebar-nav__link--logout {
  color: var(--color-danger);
}

.sidebar-nav__link--logout:hover {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

/* ── Top Bar ───────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  gap: var(--space-md);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.topbar__toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  cursor: pointer;
  color: var(--color-text);
  transition: background var(--transition-fast);
}

.topbar__toggle:hover {
  background: var(--color-bg);
}

.topbar__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.topbar__user-name {
  font-weight: 600;
  color: var(--color-text);
}

.topbar__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary-muted);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

/* ── Page Content ──────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: var(--space-lg);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.page-header__title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text);
}

.page-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* ── Panels ────────────────────────────────────────────────── */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}

.panel__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
}

/* ── Stats Grid ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.stat-card:hover {
  border-color: var(--color-primary-light);
}

a.stat-card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a.stat-card--link:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

a.stat-card--link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.stat-card__label {
  font-family: var(--font-secondary);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.stat-card__value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.2;
}

.stat-card__value--primary {
  color: var(--color-primary);
}

.stat-card__change {
  font-size: 0.8rem;
  margin-top: var(--space-xs);
  color: var(--color-text-light);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0.55rem 1.15rem;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
  line-height: 1.4;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn--primary:hover:not(:disabled) {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--secondary:hover:not(:disabled) {
  background: var(--color-bg);
  border-color: var(--color-text-light);
}

.btn--danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}

.btn--danger:hover:not(:disabled) {
  background: #A33226;
  border-color: #A33226;
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: transparent;
}

.btn--ghost:hover:not(:disabled) {
  background: var(--color-primary-muted);
}

.btn--sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn--lg {
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-secondary);
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

.badge--paid {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge--partial {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge--unpaid {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.badge--active {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge--suspended {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.badge--info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid;
  margin-bottom: var(--space-md);
  font-size: 0.9rem;
  animation: alert-in 0.3s ease;
}

@keyframes alert-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert--success {
  background: var(--color-success-bg);
  border-color: #B8DFC9;
  color: var(--color-success);
}

.alert--error {
  background: var(--color-danger-bg);
  border-color: #F0C4BF;
  color: var(--color-danger);
}

.alert--warning {
  background: var(--color-warning-bg);
  border-color: #EDD9A0;
  color: var(--color-warning);
}

.alert--info {
  background: var(--color-info-bg);
  border-color: #B8D4EA;
  color: var(--color-info);
}

.alert__close {
  margin-right: auto;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  line-height: 1;
  padding: 0;
}

.alert__close:hover {
  opacity: 1;
}

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  max-width: 100%;
  width: 100%;
}

.table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 0.75rem var(--space-md);
  text-align: right;
  border-bottom: 1px solid var(--color-border-light);
}

.table th {
  background: var(--color-bg);
  font-weight: 700;
  color: var(--color-text-muted);
  font-family: var(--font-secondary);
  font-size: 0.8rem;
  white-space: nowrap;
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: rgba(11, 110, 106, 0.03);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table__actions {
  display: flex;
  gap: var(--space-xs);
  justify-content: flex-start;
}

.table--striped tbody tr:nth-child(even) {
  background: rgba(243, 246, 244, 0.5);
}

.table-empty {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--color-text-muted);
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.form-label--required::after {
  content: ' *';
  color: var(--color-danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  direction: rtl;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-muted);
}

.form-input::placeholder {
  color: var(--color-text-light);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
}

/* ── Search & Filters ──────────────────────────────────────── */
.search-bar {
  position: relative;
  max-width: 320px;
}

.search-bar__input {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.5rem;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  transition: border-color var(--transition-fast);
  direction: rtl;
}

.search-bar__input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.search-bar__icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-light);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.filters-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.filters-bar .form-select {
  width: auto;
  min-width: 140px;
}

.filters-bar__custom-dates {
  display: none;
  align-items: center;
  gap: var(--space-sm);
}

.filters-bar__custom-dates.is-visible {
  display: flex;
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 35, 50, 0.4);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal-overlay.is-open {
  display: flex;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.25s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border-light);
}

.modal__title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal__close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.modal__close:hover {
  background: var(--color-bg);
}

.modal__body {
  padding: var(--space-lg);
}

.modal__footer {
  display: flex;
  justify-content: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border-light);
}

/* ── Charts ────────────────────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
  min-height: 280px;
  padding: var(--space-md) 0;
}

.chart-container canvas {
  max-height: 360px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-lg);
}

/* ── Login Page ────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: linear-gradient(160deg, var(--color-bg) 0%, var(--color-bg-alt) 50%, #DDE8EA 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-xl);
}

.login-card__brand {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.login-card__logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  object-fit: contain;
  margin-bottom: var(--space-md);
}

.login-card__title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.login-card__subtitle {
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.login-card .form-group {
  margin-bottom: var(--space-lg);
}

.login-card .btn--primary {
  width: 100%;
  padding: 0.7rem;
  font-size: 1rem;
}

.login-card__footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 0.8rem;
  color: var(--color-text-light);
}

/* ── Utilities ─────────────────────────────────────────────── */
.text-muted { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── Sidebar Overlay (mobile) ──────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 150;
  backdrop-filter: blur(2px);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root {
    --sidebar-width: min(78vw, 260px);
  }

  .app-sidebar {
    transform: translateX(100%);
    width: var(--sidebar-width);
    max-width: 260px;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
  }

  .app-main {
    margin-right: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-overlay {
    display: block;
  }

  .topbar {
    padding-inline: 0.75rem;
  }

  .topbar__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .page-content {
    padding: 0.85rem;
    max-width: 100%;
    overflow-x: hidden;
  }

  .panel {
    padding: 0.85rem;
    margin-bottom: 0.85rem;
    max-width: 100%;
    min-width: 0;
  }

  .form-row {
    flex-direction: column;
  }

  .panel__title {
    font-size: 1rem;
    line-height: 1.4;
    word-break: break-word;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
  }

  .page-header__title {
    font-size: 1.2rem;
  }

  .page-header__actions {
    width: 100%;
  }

  .page-header__actions .btn {
    flex: 1;
    justify-content: center;
  }

  .search-bar {
    max-width: 100%;
    width: 100%;
    min-width: 0;
  }

  .search-bar__input {
    width: 100%;
    min-width: 0;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .filters-bar .form-select,
  .filters-bar .form-input,
  .filters-bar .btn {
    width: 100%;
  }

  .table-wrap {
    margin-inline: 0;
    border-radius: var(--radius-sm);
  }

  .table {
    min-width: 720px;
    font-size: 0.82rem;
  }

  .table th,
  .table td {
    padding: 0.55rem 0.65rem;
  }

  .modal {
    width: calc(100vw - 1.25rem);
    max-width: calc(100vw - 1.25rem);
    margin: 0.65rem auto;
    max-height: calc(100vh - 1.5rem);
    overflow-y: auto;
  }

  .modal__footer {
    flex-wrap: wrap;
  }

  .modal__footer .btn {
    flex: 1;
    min-width: 120px;
  }

  /* Card list alternative for dense tables on phones */
  .mobile-cards {
    display: none;
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .table-desktop-only {
    display: none !important;
  }

  .mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .mobile-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.85rem;
  }

  .mobile-card__title {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
    color: var(--color-text);
  }

  .mobile-card__meta {
    display: grid;
    gap: 0.35rem;
    font-size: 0.88rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
  }

  .mobile-card__row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: baseline;
  }

  .mobile-card__row strong {
    color: var(--color-text);
    font-weight: 700;
    text-align: left;
    word-break: break-word;
  }

  .mobile-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .mobile-card__actions .btn {
    flex: 1;
    justify-content: center;
  }

  .mobile-empty {
    text-align: center;
    color: var(--color-text-muted);
    padding: 1.25rem 0.5rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: var(--space-xl) var(--space-lg);
  }

  .topbar__user-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
