/* Maktaba Theme - Clean & Refined */

:root {
  /* Brand Colors */
  --brand-orange: #E85002;
  --brand-orange-light: rgba(232, 80, 2, 0.1);
  --brand-orange-medium: rgba(232, 80, 2, 0.15);

  /* Primary */
  --primary: #000000;
  --primary-soft: rgba(0, 0, 0, 0.05);

  /* Whites & Backgrounds */
  --white: #F9F9F9;
  --white-pure: #FFFFFF;
  --bg-main: #F5F5F5;

  /* Grays */
  --gray: #646464;
  --gray-light: #A7A7A7;
  --gray-dark: #333333;
  --gray-border: #E8E8E8;
  --gray-hover: #F0F0F0;

  /* Gradient */
  --gradient-brand: linear-gradient(135deg, #000000, #C10801, #F16001, #D9C3AB);
  --gradient-orange: linear-gradient(135deg, #E85002, #F16001);

  /* Shadows - Subtle */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);

  /* Border Radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 200ms var(--ease);

  /* Layout */
  --sidebar-width: 240px;
  --header-height: 64px;
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Readex Pro', system-ui, sans-serif;
  background: var(--bg-main);
  color: var(--gray-dark);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ==================== Layout (mobile-first) ==================== */
.app {
  min-height: 100vh;
  position: relative;
}

.app-content {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
}

.app-content-inner {
  padding: 20px 16px;
}

.app-content.has-hero .app-content-inner {
  padding-top: 0;
}

/* Prevent horizontal overflow on phones */
html,
body {
  max-width: 100vw;
  overflow-x: hidden;
}

/* ==================== Sidebar (mobile-first: off-canvas drawer) ==================== */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--white-pure);
  border-left: 1px solid var(--gray-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transform: translateX(100%);
  transition: transform 250ms var(--ease);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

body.sidebar-open .sidebar {
  transform: translateX(0);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--gray-border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: var(--gradient-orange);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white-pure);
  font-size: 16px;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.sidebar-body {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

/* Nav Group */
.nav-group {
  margin-bottom: 24px;
}

.nav-label {
  padding: 0 12px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-menu {
  list-style: none;
}

.nav-item {
  margin-bottom: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--gray);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover {
  background: var(--gray-hover);
  color: var(--gray-dark);
}

.nav-link.active {
  background: var(--brand-orange-light);
  color: var(--brand-orange);
}

.nav-link i {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.nav-badge {
  margin-right: auto;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  background: var(--brand-orange);
  color: var(--white-pure);
  border-radius: 10px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--gray-border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--gray-hover);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--brand-orange-medium);
  color: var(--brand-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--gray-light);
}

.user-logout {
  color: var(--gray-light);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.user-logout:hover {
  background: var(--white-pure);
  color: var(--brand-orange);
}

/* ==================== Page Header ==================== */
.page-header {
  margin-bottom: 28px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-light);
  margin-bottom: 6px;
}

.breadcrumb a {
  color: var(--gray);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--brand-orange);
}

.page-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--gray);
}

/* ==================== Cards ==================== */
.card {
  background: var(--white-pure);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-border);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-dark);
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--gray-border);
  background: var(--white);
}

/* ==================== Stats Grid ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white-pure);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--brand-orange);
  box-shadow: var(--shadow);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.stat-icon.orange {
  background: var(--brand-orange-light);
  color: var(--brand-orange);
}

.stat-icon.dark {
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-icon.gray {
  background: var(--gray-hover);
  color: var(--gray);
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.stat-trend.up {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.stat-trend.down {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12px;
  color: var(--gray);
}

/* ==================== Grid Layout ==================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

/* ==================== Table ==================== */
.table-wrapper {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: 12px 16px;
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-border);
}

.table td {
  padding: 14px 16px;
  text-align: right;
  font-size: 13px;
  color: var(--gray-dark);
  border-bottom: 1px solid var(--gray-border);
}

.table tbody tr {
  transition: var(--transition);
}

.table tbody tr:hover {
  background: var(--gray-hover);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ==================== Badges ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.badge-orange {
  background: var(--brand-orange-light);
  color: var(--brand-orange);
}

.badge-success {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.badge-gray {
  background: var(--gray-hover);
  color: var(--gray);
}

/* ==================== Alerts ==================== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-error, .alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--white-pure);
}

.btn-primary:hover {
  background: var(--gray-dark);
}

.btn-orange {
  background: var(--brand-orange);
  color: var(--white-pure);
}

.btn-orange:hover {
  background: #d14802;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--gray-border);
  color: var(--gray-dark);
}

.btn-outline:hover {
  background: var(--gray-hover);
  border-color: var(--gray);
}

.btn-ghost {
  background: transparent;
  color: var(--gray);
}

.btn-ghost:hover {
  background: var(--gray-hover);
  color: var(--gray-dark);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
}

/* ==================== Forms ==================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-dark);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  background: var(--white-pure);
  color: var(--gray-dark);
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px var(--brand-orange-light);
}

.form-input::placeholder {
  color: var(--gray-light);
}

/* ==================== Chart Container ==================== */
.chart-container {
  position: relative;
  height: 220px;
}

/* ==================== Quick Actions ==================== */
.quick-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.quick-action {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--white-pure);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: var(--transition);
}

.quick-action:hover {
  border-color: var(--brand-orange);
  box-shadow: var(--shadow);
}

.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--brand-orange-light);
  color: var(--brand-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.quick-action-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-dark);
}

.quick-action-desc {
  font-size: 11px;
  color: var(--gray-light);
  margin-top: 2px;
}

/* ==================== List Items ==================== */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-border);
}

.list-item:last-child {
  border-bottom: none;
}

.list-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--gray-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 16px;
}

.list-content {
  flex: 1;
  min-width: 0;
}

.list-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-dark);
}

.list-subtitle {
  font-size: 11px;
  color: var(--gray-light);
  margin-top: 2px;
}

.list-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* ==================== Progress Bar ==================== */
.progress {
  height: 6px;
  background: var(--gray-hover);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--brand-orange);
  border-radius: 3px;
  transition: width 0.5s var(--ease);
}

/* ==================== Empty State ==================== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-icon {
  font-size: 48px;
  color: var(--gray-light);
  margin-bottom: 16px;
}

.empty-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-dark);
  margin-bottom: 6px;
}

.empty-text {
  font-size: 13px;
  color: var(--gray);
}

/* ==================== RTL ==================== */
html[dir="rtl"] .table th,
html[dir="rtl"] .table td {
  text-align: right;
}

html[dir="rtl"] .nav-badge {
  margin-right: auto;
  margin-left: 0;
}

/* ==================== Medium breakpoint ==================== */
@media (min-width: 769px) and (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== Mobile UI (default visible) ==================== */
.mobile-menu-btn {
  display: flex;
  position: fixed;
  top: 12px;
  left: 12px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(26, 26, 26, 0.92);
  color: #fff;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: none;
  cursor: pointer;
  z-index: 99;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mobile-menu-btn:active {
  transform: scale(0.95);
}

body.sidebar-open .mobile-menu-btn {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease);
  z-index: 90;
}

body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.sidebar-open {
  overflow: hidden;
}

.stats-grid,
.grid-2,
.grid-3 {
  grid-template-columns: 1fr;
}

.quick-actions {
  flex-direction: column;
}

/* ==================== Desktop layout (>= 769px) ==================== */
@media (min-width: 769px) {
  html,
  body {
    overflow-x: visible;
  }

  .app {
    display: flex;
  }

  .app-content {
    flex: 1;
    margin-right: var(--sidebar-width);
  }

  html[dir="ltr"] .app-content {
    margin-right: 0;
    margin-left: var(--sidebar-width);
  }

  .app-content-inner {
    padding: 28px 36px;
  }

  .sidebar {
    transform: none;
    transition: none;
    box-shadow: none;
  }

  .mobile-menu-btn,
  .sidebar-backdrop {
    display: none;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .quick-actions {
    flex-direction: row;
  }
}

/* ==================== Page Hero ==================== */
.page-hero {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d1810 50%, #E85002 100%);
  padding: 30px 16px 80px 16px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
}
.hero-breadcrumb a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 0.2s;
}
.hero-breadcrumb a:hover {
  color: white;
}
.hero-breadcrumb span {
  color: rgba(255,255,255,0.4);
}
.hero-breadcrumb .current {
  color: rgba(255,255,255,0.8);
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
}

.hero-title {
  font-size: 28px;
  font-weight: 700;
  color: white;
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
}
.hero-subtitle {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  margin: 0;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: white;
  color: var(--primary);
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.content-pull-up {
  margin-top: -60px;
  position: relative;
  z-index: 2;
}

/* ==================== Modern Stats Row ==================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-box {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}
.stat-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.stat-box-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.stat-box-icon.orange {
  background: linear-gradient(135deg, #E85002, #ff6b2b);
  color: white;
}
.stat-box-icon.dark {
  background: linear-gradient(135deg, #1a1a1a, #333);
  color: white;
}
.stat-box-icon.gray {
  background: linear-gradient(135deg, #64748b, #94a3b8);
  color: white;
}
.stat-box-icon.green {
  background: linear-gradient(135deg, #059669, #34d399);
  color: white;
}

.stat-box-content { flex: 1; }
.stat-box-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}
.stat-box-label {
  font-size: 13px;
  color: var(--gray-light);
  margin-top: 2px;
}

/* ==================== Data Card ==================== */
.data-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  overflow: hidden;
}

.data-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-border);
  flex-wrap: wrap;
  gap: 16px;
}
.data-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

/* ==================== Data Table ==================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  text-align: right;
  padding: 14px 24px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #fafafa;
  border-bottom: 1px solid var(--gray-border);
}
.data-table td {
  padding: 16px 24px;
  font-size: 14px;
  color: var(--primary);
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background 0.15s;
}
.data-table tbody tr:hover {
  background: #fafafa;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ==================== Filter Form ==================== */
.filter-form {
  display: flex;
  gap: 10px;
  align-items: center;
}
.filter-input {
  padding: 10px 14px;
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s;
  width: 140px;
}
.filter-input:focus {
  outline: none;
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(232, 80, 2, 0.1);
}
.filter-btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
}
.filter-btn-primary {
  background: var(--primary);
  color: white;
}
.filter-btn-primary:hover {
  background: #333;
}
.filter-btn-ghost {
  background: transparent;
  color: var(--gray);
  border: 1px solid var(--gray-border);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.filter-btn-ghost:hover {
  background: var(--gray-hover);
}

/* ==================== Tags ==================== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}
.tag-success {
  background: #ecfdf5;
  color: #059669;
}
.tag-neutral {
  background: #f3f4f6;
  color: #6b7280;
}
.tag-orange {
  background: rgba(232, 80, 2, 0.1);
  color: var(--brand-orange);
}
.tag-danger {
  background: #fef2f2;
  color: #dc2626;
}

/* ==================== Actions ==================== */
.actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.action-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--gray);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 18px;
  text-decoration: none;
}
.action-btn:hover {
  background: #f3f4f6;
  color: var(--primary);
}
.action-btn.danger:hover {
  background: #fef2f2;
  color: #ef4444;
}

/* ==================== Empty State ==================== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--gray-light);
}
.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
  display: block;
}
.empty-state p {
  font-size: 15px;
  margin: 0;
}

/* ==================== Hero responsive (mobile-first) ==================== */
.stats-row {
  grid-template-columns: 1fr;
}

@media (min-width: 769px) {
  .page-hero {
    padding: 40px 36px 100px 36px;
  }
}

/* ====================================================================
   FINAL MOBILE OVERRIDE (defensive — wins regardless of earlier rules)
   ==================================================================== */
@media (max-width: 1024px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
  }

  .app,
  html[dir="rtl"] .app,
  html[dir="ltr"] .app {
    display: block !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .app-content,
  html[dir="rtl"] .app-content,
  html[dir="ltr"] .app-content {
    flex: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .app-content-inner {
    padding: 20px 16px !important;
  }
  .app-content.has-hero .app-content-inner {
    padding-top: 0 !important;
  }

  .sidebar,
  html[dir="rtl"] .sidebar,
  html[dir="ltr"] .sidebar {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: var(--sidebar-width) !important;
    height: 100vh !important;
    transform: translateX(100%) !important;
    transition: transform 250ms var(--ease);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 100 !important;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0) !important;
  }

  .mobile-menu-btn {
    display: flex !important;
  }

  body.sidebar-open .mobile-menu-btn {
    display: none !important;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body.sidebar-open {
    overflow: hidden !important;
  }

  /* Diagnostic marker - inspect computed style of body to confirm this loaded */
  body::after {
    content: "mobile-css-v3";
    display: none;
  }
}
