@font-face {
  font-family: 'Pinar';
  src: url('/fonts/PINAR-REGULAR.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Pinar';
  src: url('/fonts/PINAR-MEDIUM.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Pinar';
  src: url('/fonts/PINAR-SEMIBOLD.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Pinar';
  src: url('/fonts/PINAR-BOLD.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Pinar';
  src: url('/fonts/PINAR-LIGHT.ttf') format('truetype');
  font-weight: 300;
  font-display: swap;
}

:root {
  --primary: #00BFA6;
  --primary-dark: #009e89;
  --primary-light: #e6f9f6;
  --primary-soft: #f0fdfa;

  --teal-deep: #0f766e;
  --teal-mid: #14b8a6;

  --white: #ffffff;
  --bg: #eef4f6;
  --bg-soft: #e3edf1;
  --border: #d8e3e8;
  --border-soft: #e8eff3;
  --text: #0f2a30;
  --text-muted: #5d7280;

  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --warning: #f59e0b;
  --warning-soft: #fff7ed;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --info: #3b82f6;
  --info-soft: #eff6ff;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15,42,48,.05);
  --shadow: 0 4px 16px rgba(15,42,48,.08);
  --shadow-lg: 0 10px 30px rgba(0,191,166,.18);

  --sidebar-collapsed: 72px;
  --sidebar-expanded: 250px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'Pinar', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  font-size: 14px;
  line-height: 1.7;
  height: 100vh;
  overflow: hidden;
}

body {
  background-color: #eef4f6;
  background-image:
    radial-gradient(circle at 0% 0%, rgba(20, 184, 166, 0.18) 0%, transparent 45%),
    radial-gradient(circle at 100% 0%, rgba(0, 191, 166, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(15, 118, 110, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(20, 184, 166, 0.10) 0%, transparent 45%),
    linear-gradient(135deg, #e8f2f4 0%, #eef4f6 50%, #e6f0f3 100%);
  background-attachment: fixed;
}

a { color: var(--primary); text-decoration: none; transition: .2s; }
a:hover { color: var(--primary-dark); }

/* ============ Login ============ */
body.login-body {
  background: #00BFA6 !important;
  background-image: none !important;
}
.login-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
  position: relative;
  background: linear-gradient(135deg, #00BFA6 0%, #00a891 100%);
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.12) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.08) 0%, transparent 40%);
  pointer-events: none;
}
.login-card {
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,.15);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.2);
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.login-card::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(0,191,166,.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.login-card::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(0,191,166,.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.login-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
}
.login-logos img { height: 60px; width: auto; object-fit: contain; }
.login-logos .divider { width: 1px; height: 50px; background: var(--border); }
.login-card h1 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.login-card p.subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }

/* ============ Forms ============ */
.form-group { margin-bottom: 16px; text-align: right; }
.form-group label {
  display: block;
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  transition: .2s;
  background: var(--white);
  color: var(--text);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0,191,166,.15);
}
.form-control:disabled { background: #f0f4f6; color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

.ltr-input,
input.ltr-input {
  direction: ltr;
  text-align: left;
  font-family: 'Segoe UI', Tahoma, monospace;
  letter-spacing: 1.5px;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
  text-decoration: none;
  line-height: 1.4;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,191,166,.3);
}
.btn-primary:disabled {
  background: #b8c5cb;
  color: #f1f5f9;
  cursor: not-allowed;
  opacity: .7;
}
.btn-block { width: 100%; padding: 13px; }
.btn-outline {
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }

.btn-icon-action {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
}
.btn-icon-action:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.btn-icon-action.btn-icon-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.btn-icon-eye {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
}
.btn-icon-eye:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}
.btn-icon-eye.is-empty {
  color: var(--text-muted);
  opacity: .55;
  border-style: dashed;
}
.btn-icon-eye.is-empty:hover {
  color: var(--primary);
  opacity: 1;
  border-style: solid;
}

.btn-icon-note {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--info);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
}
.btn-icon-note:hover {
  background: var(--info-soft);
  border-color: var(--info);
}

.btn-icon-filter,
.btn-clear-filter {
  width: 38px; height: 38px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-icon-filter:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.btn-clear-filter:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

/* ============ Alerts ============ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13.5px;
  border: 1px solid transparent;
  flex-shrink: 0;
}
.alert-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-success { background: #f0fdfa; color: #065f56; border-color: #b3ece4; }

/* ============ Layout ============ */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============ Sidebar ============ */
.sidebar {
  width: var(--sidebar-collapsed);
  background: linear-gradient(180deg, #00BFA6 0%, #00a891 100%);
  border-left: 1px solid rgba(255,255,255,.08);
  padding: 16px 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width .25s ease;
  z-index: 100;
  box-shadow: -4px 0 20px rgba(0,191,166,.20);
}
.sidebar.open { width: var(--sidebar-expanded); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid rgba(255,255,255,.18);
  margin-bottom: 12px;
  overflow: hidden;
}
.sidebar-brand img {
  height: 38px;
  width: 38px;
  object-fit: contain;
  flex-shrink: 0;
  background: #fff;
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 3px 8px rgba(0,0,0,.08);
}
.sidebar-brand .brand-text {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s;
  color: #fff;
}
.sidebar-brand .brand-text small {
  display: block;
  font-size: 10.5px;
  font-weight: 400;
  color: rgba(255,255,255,.75);
}
.sidebar.open .sidebar-brand .brand-text { opacity: 1; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.92);
  font-weight: 500;
  font-size: 13.5px;
  transition: .2s;
  white-space: nowrap;
  position: relative;
}
.nav-link:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
}
.nav-link.active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
}
.nav-link.active .nav-icon svg { stroke: var(--primary-dark); }

.nav-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-icon svg { width: 20px; height: 20px; stroke: #fff; }

.nav-label {
  opacity: 0;
  transition: opacity .2s;
  font-size: 13px;
}
.sidebar.open .nav-label { opacity: 1; }

.sidebar:not(.open) .nav-link::after {
  content: attr(title);
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 10px;
  padding: 6px 10px;
  background: #0f2a30;
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 200;
}
.sidebar:not(.open) .nav-link:hover::after { opacity: 1; }

.nav-divider { height: 1px; background: rgba(255,255,255,.18); margin: 10px 6px; }

.sidebar-toggle {
  margin-top: auto;
  width: 100%;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(255,255,255,.20);
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
  flex-shrink: 0;
}
.sidebar-toggle:hover {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.4);
}
.sidebar-toggle svg { transition: transform .25s; }
.sidebar.open .sidebar-toggle svg { transform: rotate(180deg); }

/* ============ Main Content ============ */
.main-content {
  flex: 1;
  padding: 20px 22px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
}

/* ============ Topbar ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius);
  padding: 10px 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 18px rgba(15,118,110,.10);
  border: 1px solid rgba(0,191,166,.20);
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
  min-height: 62px;
  position: relative;
  z-index: 50;
  background-image:
    radial-gradient(circle at 0% 0%, rgba(0,191,166,.15) 0%, transparent 30%),
    radial-gradient(circle at 15% 100%, rgba(15,118,110,.08) 0%, transparent 35%),
    linear-gradient(135deg, #ffffff 0%, #f3fbfa 60%, #e8f7f4 100%);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}
.topbar h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--teal-deep);
}
.topbar-actions {
  display: flex;
  gap: 8px;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

.user-chip { position: relative; z-index: 60; }
.user-chip-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 6px;
  border-radius: 12px;
  background: rgba(255,255,255,.7);
  border: 1.5px solid rgba(0,191,166,.18);
  cursor: pointer;
  transition: .2s;
  font-family: inherit;
}
.user-chip-btn:hover {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0,191,166,.15);
}
.user-chip-btn .user-info { text-align: left; line-height: 1.35; }
.user-chip-btn .user-info strong { font-size: 12.5px; display: block; color: var(--teal-deep); }
.user-chip-btn .user-info small { font-size: 10.5px; color: var(--text-muted); }
.user-chip-btn .avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--teal-deep) 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 3px 8px rgba(0,191,166,.3);
}
.user-chip-btn .chevron {
  color: var(--text-muted);
  transition: transform .2s;
}
.user-chip.open .user-chip-btn .chevron { transform: rotate(180deg); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 190px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: 0 15px 40px rgba(15,42,48,.18);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: .2s;
  z-index: 500;
}
.user-chip.open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: .15s;
}
.dropdown-item:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.dropdown-item-danger { color: var(--danger); }
.dropdown-item-danger:hover {
  background: var(--danger-soft);
  color: #b91c1c;
}

/* ============ Filters ============ */
.filters-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-right: auto;
}
.filter-field {
  position: relative;
  display: flex;
  align-items: center;
  background: #f7fbfb;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: .2s;
  height: 38px;
}
.filter-field:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0,191,166,.12);
}
.filter-field svg {
  width: 15px; height: 15px;
  margin: 0 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.filter-field input,
.filter-field select {
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  padding: 0 10px 0 4px;
  height: 100%;
  cursor: pointer;
}
.filter-field input {
  cursor: text;
  min-width: 180px;
}
.filter-field.search-field { min-width: 220px; max-width: 280px; }
.filter-field.search-field input { width: 100%; }
.filter-field.select-field { min-width: 150px; }
.filter-field.select-field select { min-width: 110px; }

.count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 8px;
  margin-right: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  vertical-align: middle;
}

/* ============ Cards ============ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
  background: linear-gradient(135deg, #ffffff 0%, #f7fcfb 100%);
}
.card-header .header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-header h3 { font-size: 14.5px; font-weight: 700; color: var(--teal-deep); margin: 0; }
.card-body { padding: 20px; }

/* ============ Tabs ============ */
.tabs {
  display: flex;
  gap: 6px;
  align-items: center;
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1.5px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}
.tab-btn:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,191,166,.25);
}
.tab-btn.active .count-chip {
  background: rgba(255,255,255,.25);
  color: #fff;
}
.tab-btn svg { flex-shrink: 0; }

.tab-content { display: none; flex: 1; min-height: 0; flex-direction: column; }
.tab-content.active { display: flex; }

/* ============ Stats Row ============ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.stat-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: .25s;
  position: relative;
  overflow: hidden;
  min-height: 82px;
}
.stat-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15,42,48,.12);
}
.stat-tile::after {
  content: '';
  position: absolute;
  top: -30px; left: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  pointer-events: none;
}
.stat-tile-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,.85);
  box-shadow: 0 3px 8px rgba(15,42,48,.08);
  position: relative;
  z-index: 1;
}
.stat-tile-icon svg { width: 22px; height: 22px; }
.stat-tile-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.stat-tile-label {
  font-size: 11.5px;
  font-weight: 600;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-tile-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.tile-total { background: linear-gradient(135deg, #00BFA6 0%, #0d9488 100%); color: #fff; }
.tile-total .stat-tile-label { color: rgba(255,255,255,.85); }
.tile-total .stat-tile-icon { color: #0d9488; }
.tile-pending { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #78350f; }
.tile-pending .stat-tile-label { color: #92400e; }
.tile-pending .stat-tile-icon { color: #d97706; }
.tile-rejected { background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%); color: #7f1d1d; }
.tile-rejected .stat-tile-label { color: #991b1b; }
.tile-rejected .stat-tile-icon { color: #dc2626; }
.tile-approved { background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%); color: #1e3a8a; }
.tile-approved .stat-tile-label { color: #1e40af; }
.tile-approved .stat-tile-icon { color: #2563eb; }
.tile-active { background: linear-gradient(135deg, #bbf7d0 0%, #86efac 100%); color: #14532d; }
.tile-active .stat-tile-label { color: #166534; }
.tile-active .stat-tile-icon { color: #16a34a; }

/* ============ Table Card ============ */
.table-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.table-wrapper {
  flex: 1;
  overflow: auto;
  background: var(--white);
  min-height: 0;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
}
table.data-table thead th {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
  font-size: 12.5px;
  padding: 12px 10px;
  text-align: center;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 5;
  border-left: 1px solid rgba(255,255,255,.15);
  border-right: 1px solid rgba(255,255,255,.15);
}
table.data-table thead th:first-child { border-right: none; }
table.data-table thead th:last-child { border-left: none; }

table.data-table tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border-soft);
  border-left: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
table.data-table tbody td:first-child { border-right: none; }
table.data-table tbody td:last-child { border-left: none; }

table.data-table tbody tr:nth-child(odd) { background: #f8fbfb; }
table.data-table tbody tr:nth-child(even) { background: var(--white); }
table.data-table tbody tr:hover { background: var(--primary-soft); }

table.data-table th.th-name,
table.data-table td.td-name {
  text-align: right;
  padding-right: 16px;
}

.ltr-cell {
  direction: ltr;
  text-align: center;
  font-family: 'Segoe UI', Tahoma, monospace;
  letter-spacing: 1px;
}
.center-cell { text-align: center !important; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* ============ Pagination ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: linear-gradient(135deg, #ffffff 0%, #f7fcfb 100%);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.page-btn, .page-num {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
}
.page-btn:hover:not(:disabled), .page-num:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-num.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}
.page-numbers { display: flex; gap: 4px; flex-wrap: wrap; }
.page-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 12px;
}

/* ============ Status cell ============ */
.status-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.status-select {
  padding: 5px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  max-width: 190px;
  transition: .2s;
}
.status-select:hover { border-color: var(--primary); }
.status-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,191,166,.15);
}

.action-buttons {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

/* ============ Badges ============ */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-pending  { background: #fff7ed; color: #c2410c; }
.badge-progress { background: #eff6ff; color: #1d4ed8; }
.badge-done     { background: #f0fdfa; color: #047857; }
.badge-rejected { background: #fef2f2; color: #b91c1c; }
.badge-default  { background: #f3f4f6; color: #4b5563; }
.badge[title] { cursor: help; }

/* ============ Form rows ============ */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 4px;
}
.form-row.full { grid-template-columns: 1fr; }

.form-row .form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}
.form-row .form-group .form-control,
.form-row .form-group .mobile-input {
  height: 46px;
  min-height: 46px;
}
.form-row .form-group select.form-control {
  height: 46px;
  padding-top: 0;
  padding-bottom: 0;
}
.form-group textarea.form-control {
  height: auto;
  min-height: 90px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ============ Modal ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,42,48,.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(15,42,48,.2);
}
.modal.modal-lg { max-width: 720px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.modal-header h4 { font-size: 16px; font-weight: 700; color: var(--teal-deep); }
.modal-close {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: none;
  background: #f0f4f6;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: .2s;
}
.modal-close:hover { background: #e2e9ed; color: var(--text); }

.modal-body { max-height: 65vh; overflow-y: auto; padding-left: 2px; }
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 18px;
}
.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--primary-soft);
  border-radius: 10px;
  border: 1px solid rgba(0,191,166,.15);
}
.modal p { color: var(--text-muted); margin-bottom: 20px; font-size: 13.5px; }
.modal h4 { margin-bottom: 10px; font-size: 16px; }

/* ============ Checklist ============ */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: .2s;
  background: var(--white);
  user-select: none;
}
.check-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.check-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.check-box {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .2s;
  position: relative;
}
.check-item input:checked + .check-box {
  background: var(--primary);
  border-color: var(--primary);
}
.check-item input:checked + .check-box::after {
  content: '';
  position: absolute;
  width: 6px; height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -2px);
}
.check-text {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}
.check-label { font-size: 13.5px; color: var(--text); font-weight: 500; }
.tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.tag-required { background: #fee2e2; color: #b91c1c; }
.tag-optional { background: #e0f2fe; color: #0369a1; }

/* ============ Mobile Input ============ */
.mobile-input {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: .2s;
  background: var(--white);
  direction: ltr;
}
.mobile-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0,191,166,.15);
}
.mobile-prefix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  font-family: 'Segoe UI', Tahoma, monospace;
  font-size: 15px;
  border-right: 1.5px solid var(--border);
  user-select: none;
  letter-spacing: 1px;
}
.mobile-input .form-control {
  border: none;
  border-radius: 0;
  box-shadow: none !important;
  font-family: 'Segoe UI', Tahoma, monospace;
  letter-spacing: 2px;
  text-align: left;
  direction: ltr;
}
.mobile-input .form-control:focus { outline: none; }

/* ============ Notes Content ============ */
.notes-content {
  background: #f7fbfb;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 40vh;
  overflow-y: auto;
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 22px;
  border-radius: 12px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(15,42,48,.25);
  z-index: 2000;
  opacity: 0;
  transition: .3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background: var(--primary); }
.toast-error { background: var(--danger); }

/* ============ Responsive ============ */
.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--teal-deep);
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

@media (max-width: 1280px) {
  .stats-row { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  body, html { overflow: auto; height: auto; }
  .app-layout { height: auto; min-height: 100vh; }
  .main-content { height: auto; }

  .sidebar {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: var(--sidebar-expanded);
    transform: translateX(100%);
    box-shadow: -10px 0 30px rgba(15,42,48,.2);
    transition: transform .3s ease;
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar .brand-text,
  .sidebar .nav-label { opacity: 1; }
  .sidebar .sidebar-toggle { display: none; }

  .menu-toggle { display: inline-flex; }
  .login-card { padding: 32px 24px; }
  .modal.modal-lg { max-width: 100%; }

  .table-card { flex: none; }
  .table-wrapper { max-height: 65vh; }

  .user-chip-btn .user-info { display: none; }
  .user-dropdown { left: auto; right: 0; }

  .stats-row { grid-template-columns: repeat(2, 1fr); }

  .filters-form { gap: 6px; width: 100%; margin-right: 0; }
  .filter-field.search-field { max-width: 100%; flex: 1; }
  .filter-field { height: 36px; }
  .filter-field input { min-width: 100px; }
}

@media (max-width: 520px) {
  .stats-row { grid-template-columns: 1fr; }
  .filter-field.search-field,
  .filter-field.select-field { min-width: 100%; flex: 1; }
}