@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700&family=Tajawal:wght@400;500;700&display=swap');

:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #334155;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #0f766e;
  --primary2: #10b981;
  --danger: #dc2626;
  --ok: #16a34a;
  --wait: rgb(233, 144, 72);
  --shadow: 0 10px 25px rgba(17, 24, 39, 0.08);
  --radius: 16px;

  /* Sidebar */
  --sidebar-bg: #0f766e;
  --sidebar-bg2: #10b981;
  --sidebar-text: rgba(255, 255, 255, 0.92);
  --sidebar-muted: rgba(255, 255, 255, 0.74);
  --sidebar-hover: rgba(255, 255, 255, 0.1);
}

.text-primary {
  color: var(--primary);
}
.text-primary2 {
  color: var(--primary2);
}
.text-ok {
  color: var(--ok);
}
.text-danger {
  color: var(--danger);
}
.text-wait {
  color: var(--wait);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui,
    sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}
body.rtl h1,
body.rtl h2,
body.rtl h3,
body.rtl h4,
body.rtl h5,
body.rtl h6 {
  font-family: 'Tajawal', sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}
.container {
  width: 90%;
  max-width: none;
  margin: 24px auto;
  padding: 0 16px;
}

/* ===== Dashboard (match screenshot) ===== */
.welcome-banner {
  border-radius: 22px;
  padding: 28px;
  background: linear-gradient(
    135deg,
    #0f766e 0%,
    #0d9488 70%,
    #10b981 100%
  ) !important;
  color: #f8fafc;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow2);
}
.welcome-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
      600px 200px at 20% 0%,
      rgba(255, 255, 255, 0.16),
      transparent 55%
    ),
    radial-gradient(
      500px 240px at 90% 30%,
      rgba(255, 255, 255, 0.1),
      transparent 60%
    );
  opacity: 0.95;
  pointer-events: none;
}
.wb-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}
.wb-icon {
  width: 74px;
  height: 74px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.wb-icon i {
  font-size: 34px;
  opacity: 0.9;
}
.wb-title {
  font-weight: 950;
  font-size: clamp(1.2rem, 2vw, 2.05rem);
  margin-bottom: 4px;
}
.wb-sub {
  font-weight: 750;
  opacity: 0.9;
}
.wb-tools .input {
  min-width: 220px;
  background: rgba(255, 255, 255, 0.92);
}
.wb-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 980px) {
  .wb-inner {
    grid-template-columns: 1fr;
  }
  .wb-tools .input {
    width: 100%;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow2);
}
.stat-bg {
  position: absolute;
  inset-inline-start: -10px;
  bottom: -14px;
  font-size: 84px;
  opacity: 0.08;
  transform: rotate(-14deg);
  color: var(--brand1);
}
.stat-label {
  font-weight: 900;
  color: var(--muted);
}
.stat-value {
  font-weight: 950;
  font-size: 2.25rem;
  margin-top: 6px;
}
.stat-meta {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 750;
  font-size: 0.9rem;
}
.stat-foot {
  margin-top: 10px;
}
.stat-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(2, 6, 23, 0.06);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.02);
}
.mini span {
  font-weight: 850;
  color: var(--muted);
}
.mini b {
  font-weight: 950;
}

/* icon colors for done/failed (requested) */
.text-ok i {
  color: var(--ok);
}
.text-danger i {
  color: var(--danger);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246, 247, 251, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: white;
  font-weight: 800;
  box-shadow: var(--shadow);
}
.brand-title {
  font-weight: 800;
}
.brand-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.btn {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
}
.btn-primary {
  border-color: transparent;
  background: var(--primary);
  color: white;
}
.btn-ghost {
  background: transparent;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}
.badge.ok {
  color: var(--ok);
  border-color: rgba(22, 163, 74, 0.2);
  background: rgba(22, 163, 74, 0.08);
}
.badge.bad {
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.2);
  background: rgba(220, 38, 38, 0.08);
}
.badge.pending {
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.2);
  background: rgba(180, 83, 9, 0.08);
}

.grid {
  display: grid;
  gap: 14px;
}
.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 10px 0;
  font-size: 16px;
}
.muted {
  color: var(--muted);
}
.hr {
  height: 1px;
  background: var(--line);
  margin: 14px 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
}
.table th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

/* Actions (objective view) */
.action-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.action-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.action-title {
  font-weight: 950;
}
.action-note {
  border: 1px dashed rgba(17, 24, 39, 0.14);
  background: rgba(17, 24, 39, 0.03);
  border-radius: 16px;
  padding: 12px;
}
.action-file {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  outline: none;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.row > * {
  flex: 1;
}

.kpi {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfbff);
}
.kpi .v {
  font-size: 26px;
  font-weight: 900;
  margin-top: 6px;
}
.small {
  font-size: 12px;
}
.notice {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 12px;
}
.notice.unread {
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.06);
}

/* RTL + language */
body.rtl {
  direction: rtl;
  font-family: 'Tajawal', system-ui, -apple-system, Segoe UI, Tahoma, Arial;
  font-family: 'Tajawal', sans-serif;
}
body {
  font-family: system-ui, -apple-system, Segoe UI, Tahoma, Arial, 'Tajawal';
}

/* Language switcher */
.lang-switcher {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
}
body.rtl .lang-switcher {
  right: auto;
  left: 12px;
}
.lang-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.lang-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.lang-option.active {
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.lang-option i {
  font-size: 12px;
}

/* Dropdown */
.dd {
  position: relative;
  display: inline-block;
}
.dd-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dd-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, 92vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 22px 55px rgba(17, 24, 39, 0.18);
  overflow: hidden;
  display: none;
}
body.rtl .dd-menu {
  right: auto;
  left: 0;
}
.dd.open .dd-menu {
  display: block;
}
.dd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(246, 247, 251, 0.9);
  border-bottom: 1px solid var(--line);
}
.dd-list {
  max-height: 320px;
  overflow: auto;
}
.dd-item {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  gap: 12px;
}
.dd-item:last-child {
  border-bottom: 0;
}
.dd-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--danger);
  margin-top: 6px;
  flex: 0 0 auto;
}
.dd-title {
  font-weight: 900;
  margin: 0;
}
.dd-meta {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  margin-top: 2px;
}
.dd-foot a {
  display: block;
  text-align: center;
  padding: 12px 14px;
  font-weight: 900;
}

/* Notification badge */
.notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px rgba(220, 38, 38, 0.25);
}

/* ===== Empty states ===== */
.empty-state {
  background: #fff;
  border: 1px dashed rgba(2, 6, 23, 0.18);
  border-radius: 20px;
  padding: 22px 18px;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  text-align: center;
}
.es-ic {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(15, 118, 110, 0.1);
  border: 1px solid rgba(15, 118, 110, 0.14);
  color: var(--brand1);
  margin-bottom: 10px;
}
.es-ic i {
  font-size: 28px;
}
.es-title {
  font-weight: 950;
  font-size: 1.1rem;
}
.es-sub {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 750;
  max-width: 56ch;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.pg {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow);
}
.pg:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow2);
}
.pg.disabled {
  opacity: 0.45;
  pointer-events: none;
}
.pg-info {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  font-weight: 900;
  color: var(--muted);
}
body.rtl .notif-badge {
  right: auto;
  left: -6px;
}

/* ===== Modern Sidebar Layout (v2) ===== */
:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --brand1: #0f766e;
  --brand2: #10b981;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  --shadow2: 0 18px 45px rgba(2, 6, 23, 0.12);
  --radius: 18px;
}

body {
  background: var(--bg);
  color: var(--text);
}
.app-shell {
  display: flex;
  min-height: 100vh;
}
.side-nav {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 270px;
  background: linear-gradient(180deg, #0d9488 0%, #0f766e 50%, #115e59 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 16px;
  z-index: 1200;
}
body.rtl .side-nav {
  left: auto;
  right: 0;
  border-right: 0;
  border-left: 1px solid var(--border);
}
.side-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 8px 14px;
}
.side-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  display: block;
  margin: 0 auto;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.22);
  transition: transform 0.3s ease;
}
.side-logo:hover {
  transform: scale(1.05);
}

.side-brand .t1 {
  font-weight: 950;
  color: #fff;
  line-height: 1.2;
}
.side-brand .t2 {
  color: var(--sidebar-muted);
  font-weight: 750;
  font-size: 0.86rem;
  line-height: 1.25;
}

.side-links {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.side-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 850;
  transition: 0.18s ease;
  border: 1px solid transparent;
}
.side-links a i {
  width: 18px;
  text-align: center;
}
.side-links a:hover {
  background: var(--sidebar-hover);
  color: #fff;
  transform: translateY(-1px);
}
.side-links a.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.side-footer {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-footer .btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.side-footer .btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.side-footer .muted {
  color: var(--sidebar-muted);
}
body.rtl .side-footer {
  left: 16px;
  right: 16px;
}

.main-area {
  margin-left: 270px;
  width: 100%;
}
body.rtl .main-area {
  margin-left: 0;
  margin-right: 270px;
}

.topbar2 {
  position: sticky;
  top: 0;
  height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  z-index: 1100;
}

/* Center badge (like screenshot) */
.topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.access-text {
  color: #9ca3af !important;
  font-size: 0.875rem;
}
.role-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5em 0.8em;
  font-weight: 600;
  letter-spacing: 0.025em;
  border-radius: 0.375rem;

  --bs-badge-padding-x: 0.65em;
  --bs-badge-padding-y: 0.35em;
  --bs-badge-font-size: 0.75em;
  --bs-badge-font-weight: 700;

  padding: var(--bs-badge-padding-y) var(--bs-badge-padding-x);
  font-size: var(--bs-badge-font-size);
  font-weight: var(--bs-badge-font-weight);
  line-height: 1;
  color: var(--bs-badge-color);
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
}
.role-pill.ok {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.18);
  color: var(--ok);
}
.role-pill.danger {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.18);
  color: var(--danger);
}

@media (max-width: 900px) {
  .topbar-center {
    display: none;
  }
}
.page-title {
  font-weight: 950;
  font-size: 1.05rem;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2000;
}
.modal.open {
  display: block;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(8px);
}
.modal-card {
  position: relative;
  width: min(520px, calc(100% - 32px));
  margin: 12vh auto 0;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  padding: 18px;
}
.modal-head {
  display: flex;
  gap: 12px;
  align-items: center;
}
.modal-icon {
  width: 25px;
  height: 25px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(220, 38, 38, 0.034);
  color: var(--danger);
}
.modal-title {
  font-weight: 950;
  font-size: 1.05rem;
}
.modal-sub {
  color: var(--muted);
  font-weight: 750;
  margin-top: 2px;
}
.modal-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Auth (Login) */
body.auth-page {
  background: radial-gradient(
      1200px 600px at 30% 10%,
      rgba(16, 185, 129, 0.18),
      transparent 55%
    ),
    radial-gradient(
      900px 500px at 90% 30%,
      rgba(15, 118, 110, 0.16),
      transparent 52%
    ),
    var(--bg);
  min-height: 100vh;
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.auth-card {
  width: min(520px, 100%);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(17, 24, 39, 0.12);
  backdrop-filter: blur(10px);
  padding: 22px;
}
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.auth-brand img {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  border: 2px solid rgba(15, 118, 110, 0.15);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  object-fit: contain;
}

.auth-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1.2;
  text-align: center;
}

.auth-sub {
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
  text-align: center;
}

.input-ic {
  position: relative;
}
.input-ic > i {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 12px;
  color: var(--muted);
}
body.rtl .input-ic > i {
  left: auto;
  right: 12px;
}
.input-ic .input {
  padding-left: 40px;
}
body.rtl .input-ic .input {
  padding-left: 12px;
  padding-right: 40px;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand1), var(--brand2));
}

.container {
  width: 90%;
  max-width: none;
  margin: 24px auto;
  padding: 0 16px;
}

/* Small devices */
@media (max-width: 900px) {
  .side-nav {
    position: fixed;
    transform: translateX(-105%);
    transition: 0.2s ease;
  }
  body.rtl .side-nav {
    transform: translateX(105%);
  }
  .side-nav.open {
    transform: translateX(0);
  }
  .main-area {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .mobile-toggle {
    display: inline-flex !important;
  }
}
.mobile-toggle {
  display: none;
}

/* Kebab menu */
.kebab {
  position: relative;
  display: inline-block;
}
.kebab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 10px 25px rgba(2, 6, 23, 0.06);
  cursor: pointer;
}
.kebab-menu {
  position: absolute;
  top: 44px;
  inset-inline-end: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow2);
  padding: 8px;
  display: none;
  z-index: 1400;
}
.kebab.open .kebab-menu {
  display: block;
}
.kebab-menu a,
.kebab-menu button {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 10px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  font-weight: 850;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.kebab-menu a:hover,
.kebab-menu button:hover {
  background: #f1f5f9;
}

/* Toasts */
.toast-area {
  position: fixed;
  bottom: 16px;
  inset-inline-end: 16px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  width: min(360px, 92vw);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow2);
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: toastIn 0.18s ease-out;
}
@keyframes toastIn {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.toast .ic {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
}
.toast.success .ic {
  background: linear-gradient(135deg, #16a34a, #22c55e);
}
.toast.error .ic {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}
.toast.info .ic {
  background: linear-gradient(135deg, #0f766e, #10b981);
}
.toast .t {
  font-weight: 950;
  margin: 0;
}
.toast .m {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 2px;
}
.toast .x {
  margin-inline-start: auto;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
}

/* Notifications page cards */
.notif-cards {
  display: grid;
  gap: 12px;
}
.notif-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex;
  gap: 12px;
}
.notif-card.unread {
  border-color: rgba(239, 68, 68, 0.28);
}
.notif-card .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ef4444;
  margin-top: 6px;
}
.notif-card .meta {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

/* Pointer cursors */
a,
button,
.btn,
[role='button'],
.stat-card,
.clickable,
input[type='submit'],
input[type='button'] {
  cursor: pointer;
}

/* Modern buttons (override) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.625rem 1.1rem;
  border-radius: 12px;
  border: 0;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  background: rgba(15, 118, 110, 0.1);
  color: #0f766e;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease,
    color 0.2s ease;
  user-select: none;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.14);
  background: rgba(15, 118, 110, 0.14);
}
.btn:active {
  transform: translateY(0px);
}

.btn-primary {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #115e59 0%, #0f766e 100%);
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.28);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.22);
}
.btn-danger:hover {
  box-shadow: 0 16px 34px rgba(220, 38, 38, 0.28);
}

.btn-secondary {
  background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);
  color: #fff;
}
.btn-secondary:hover {
  box-shadow: 0 16px 34px rgba(100, 116, 139, 0.22);
}

.btn-warning {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: #fff;
}
.btn-warning:hover {
  box-shadow: 0 16px 34px rgba(245, 158, 11, 0.24);
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 14px;
}

/* Stat cards (match provided design) */
.stat-card {
  border-radius: 16px;
  border: none;
  padding: 0.75rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}
.stat-icon,
.stat-bg {
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 5rem;
  opacity: 0.1;
  transform: rotate(15deg);
  pointer-events: none;
}
body.rtl .stat-icon,
body.rtl .stat-bg {
  right: auto;
  left: -10px;
  transform: rotate(-15deg);
}

.stat-label {
  color: #64748b;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-value {
  font-size: 2.9rem; /* bigger + clearer */
  font-weight: 800;
  margin-bottom: 0.35rem;
  color: #0f172a;
  line-height: 1.05;
}

/* Center modal perfectly */
.modal-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

/* Axis stats button */
.btn-axis-stats {
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.14),
    rgba(20, 184, 166, 0.1)
  );
  color: #0f766e;
  border: 1px solid rgba(15, 118, 110, 0.18);
}
.btn-axis-stats i {
  transition: transform 0.2s ease;
}
.btn-axis-stats:hover {
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.2),
    rgba(20, 184, 166, 0.14)
  );
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.16);
}
.btn-axis-stats:hover i {
  transform: translateX(-2px);
}
body.rtl .btn-axis-stats:hover i {
  transform: translateX(2px);
}

/* Notice (notifications) layout */
.notice-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.notice-open {
  margin-inline-start: auto;
}

body.rtl .btn-axis-stats i {
  transform: rotate(180deg);
}

.stat-card .badge {
  font-size: 1.1rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-weight: 800;
}

/* ===== Dashboard stat cards (accent + compact) ===== */
.stats-grid {
  gap: 14px;
}

.stat-card .stat-icon i {
  font-size: 6.5rem;
}
.stat-card .stat-value {
  font-size: 2rem;
  color: var(--accent, var(--primary));
}
.stat-card.accent-teal {
  --accent: #0f766e;
}
.stat-card.accent-blue {
  --accent: #2563eb;
}
.stat-card.accent-purple {
  --accent: #7c3aed;
}
.stat-card.accent-orange {
  --accent: #ea580c;
}
.stat-card.accent-green {
  --accent: #16a34a;
}
.stat-card.accent-red {
  --accent: #dc2626;
}
.stat-card.accent-teal .stat-icon {
  background: rgba(15, 118, 110, 0.12);
}
.stat-card.accent-blue .stat-icon {
  background: rgba(37, 99, 235, 0.12);
}
.stat-card.accent-purple .stat-icon {
  background: rgba(124, 58, 237, 0.12);
}
.stat-card.accent-orange .stat-icon {
  background: rgba(234, 88, 12, 0.12);
}
.stat-card:hover {
  transform: translateY(-2px);
}

/* Notifications pager */
.pager {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pager .page {
  padding: 6px 10px;
  border: 1px solid rgba(2, 6, 23, 0.1);
  border-radius: 10px;
  background: #fff;
  font-weight: 800;
  color: #0f172a;
}
.pager .page.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

/* ===== Sidebar divider + centered brand ===== */
.side-brand {
  text-align: center;
}
.side-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.22);
  margin: 14px 12px 18px 12px;
}

.welcome-banner.compact {
  padding: 22px;
}

/* Accent colors for stat cards (keep faded corner icons) */
.stat-card {
  --accent: var(--brand2);
}
.stat-card .stat-value {
  color: var(--accent);
}
.stat-card .stat-icon {
  color: var(--accent);
}
.stat-card.accent-teal {
  --accent: #10b981;
}
.stat-card.accent-blue {
  --accent: #cc4242;
}
.stat-card.accent-purple {
  --accent: #7c3aed;
}
.stat-card.accent-orange {
  --accent: #ea580c;
}

/* 1) افتراضيًا: مخفي */
.mobile-toggle {
  display: none !important;
}

/* 2) غير في الشاشات الصغيرة: يظهر */
@media (max-width: 900px) {
  .mobile-toggle {
    display: inline-flex !important;
  }
}


/* Link cards (dashboard + actions list) */
.link-cards{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.link-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 14px;
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,1));
  border-radius:18px;
  text-decoration:none;
  color:inherit;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.link-card:hover{
  transform: translateY(-1px);
  border-color: rgba(16,185,129,.35);
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.10);
}
.lc-main{ flex:1; min-width:0; }
.lc-title{
  font-weight:950;
  font-size:1.02rem;
  line-height:1.35;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.lc-meta{ margin-top:6px; display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.lc-chev{
  width:36px; height:36px; border-radius:12px;
  display:grid; place-items:center;
  background: rgba(15,118,110,.08);
  color: var(--primary);
}
.action-card{ cursor:default; }
.lc-side{ display:flex; align-items:center; gap:10px; }

/* Icon button */
.icon-btn{
  width:36px; height:36px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.9);
  display:grid; place-items:center;
  cursor:pointer;
  box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.icon-btn:hover{ transform: translateY(-1px); border-color: rgba(59,130,246,.25); }
.icon-btn:disabled{ opacity:.55; cursor:not-allowed; transform:none; }

/* Action details accordion */
.action-details{
  margin-top:-6px;
}
.action-details-inner{
  padding:14px 14px 16px;
  border:1px dashed rgba(148,163,184,.65);
  border-radius:18px;
  background: rgba(255,255,255,.85);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}
.detail-box{
  border:1px solid var(--line);
  background: rgba(248,250,252,.9);
  border-radius:16px;
  padding:12px;
}

/* Mini stat cards for objective view */
.mini-stats{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
@media (max-width: 860px){
  .mini-stats{ grid-template-columns: 1fr; }
}
.mini-stat-card{
  border:1px solid var(--line);
  background: var(--card);
  border-radius:20px;
  padding:14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
}
.mini-stat-hover{ cursor: pointer; }
.mini-stat-hover:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.10);
}
.mini-stat-faint{
  position:absolute;
  top:10px;
  left:12px;
  font-size:1.35rem;
  opacity:.14;
  pointer-events:none;
}
.mini-stat-label{ color: var(--muted); font-weight:850; font-size:.85rem; }
.mini-stat-value{ margin-top:10px; font-weight:950; display:flex; align-items:center; gap:10px; }

/* Softer notice */
.notice.soft{
  background: rgba(16,185,129,.06);
  border: 1px solid rgba(16,185,129,.18);
}

/* Objective hero tweaks */
.welcome-banner.objective-hero .wb-inner{ padding: 18px 16px; }

.objective-hero-icon{
  position:absolute;
  right: 8px;
  top: 2px;
  font-size: 2rem;
  opacity: .22;
}
.objective-hero-desc{
  margin-top:8px;
  font-size:.92rem;
  font-weight:500;
  opacity:.92;
}

/* Disabled link-button */
.btn.is-disabled{
  opacity: .55;
  pointer-events: auto;
}
.btn.is-disabled:hover{ transform:none; box-shadow:none; }



/* Messages */
.messages-layout{
  display:grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap:14px;
  align-items:start;
}
@media (max-width: 980px){
  .messages-layout{ grid-template-columns: 1fr; }
}
.messages-sidebar .list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.conv-item{
  display:block;
  text-decoration:none;
  color:inherit;
  border:1px solid var(--line);
  border-radius:18px;
  padding:12px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 12px 28px rgba(15,23,42,.05);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.conv-item:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(15,23,42,.10);
  border-color: rgba(16,185,129,.30);
}
.conv-item.active{
  border-color: rgba(16,185,129,.55);
  box-shadow: 0 0 0 3px rgba(16,185,129,.08), 0 16px 34px rgba(15,23,42,.10);
}
.conv-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.conv-name{ font-weight:950; }
.conv-time{ color:var(--muted); font-size:.78rem; white-space:nowrap; }
.conv-meta{ margin-top:6px; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.conv-preview{ margin-top:8px; color:var(--muted); font-size:.92rem; line-height:1.45; }
.msg-unread-badge,
.side-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:22px;
  border-radius:999px;
  background: linear-gradient(135deg,#ef4444,#f97316);
  color:#fff;
  font-weight:900;
  font-size:.78rem;
  padding:0 7px;
  box-shadow: 0 10px 22px rgba(239,68,68,.28);
}
.side-links a{ position:relative; }
.side-badge{
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
}
html[dir="ltr"] .side-badge{
  right:12px;
  left:auto;
}
.chat-shell{
  display:flex;
  flex-direction:column;
  min-height: 620px;
}
.chat-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid var(--line);
  padding-bottom:12px;
  margin-bottom:14px;
}
.chat-title{ font-weight:950; font-size:1.05rem; }
.chat-box{
  flex:1;
  min-height:380px;
  max-height:62vh;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:6px 2px 6px;
}
.msg-row{ display:flex; }
.msg-row.mine{ justify-content:flex-start; }
.msg-row.theirs{ justify-content:flex-end; }
html[dir="ltr"] .msg-row.mine{ justify-content:flex-end; }
html[dir="ltr"] .msg-row.theirs{ justify-content:flex-start; }
.msg-bubble{
  max-width:min(76%, 720px);
  border-radius:22px;
  padding:12px 14px;
  box-shadow: 0 14px 34px rgba(15,23,42,.08);
  border:1px solid var(--line);
}
.msg-row.mine .msg-bubble{
  background: linear-gradient(135deg, rgba(15,118,110,.10), rgba(16,185,129,.12));
  border-color: rgba(16,185,129,.24);
}
.msg-row.theirs .msg-bubble{
  background: rgba(255,255,255,.95);
}
.msg-author{ font-weight:900; margin-bottom:6px; }
.msg-body{ white-space:pre-wrap; line-height:1.75; }
.msg-meta{ margin-top:8px; color:var(--muted); font-size:.78rem; }
.chat-compose{
  margin-top:14px;
  border-top:1px solid var(--line);
  padding-top:14px;
}
.chat-compose .input{
  min-height:110px;
  resize:vertical;
}
.empty-chat{
  flex:1;
  min-height:380px;
  display:grid;
  place-items:center;
  text-align:center;
  color:var(--muted);
}
.empty-chat .es-ic{ font-size:2rem; margin-bottom:10px; opacity:.6; }


.years-filter-wrap{position:relative;min-width:210px}
.years-filter-label{display:block;margin-bottom:6px}
.years-filter-dropdown{position:relative}
.years-filter-dropdown summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;padding:10px 14px;border:1px solid rgba(15,23,42,.08);border-radius:14px;background:#fff;cursor:pointer;box-shadow:0 4px 14px rgba(15,23,42,.05);transition:border-color .2s ease, box-shadow .2s ease, transform .2s ease}
.years-filter-dropdown summary::-webkit-details-marker{display:none}
.years-filter-dropdown summary:hover{border-color:rgba(15,118,110,.24);box-shadow:0 10px 24px rgba(15,118,110,.10)}
.years-filter-dropdown[open] summary{border-color:rgba(13,148,136,.35);box-shadow:0 0 0 4px rgba(20,184,166,.10), 0 12px 26px rgba(15,118,110,.12)}
.years-filter-trigger{display:flex;align-items:center;gap:10px;min-width:0;flex:1}
.years-filter-icon{width:34px;height:34px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#ecfeff 0%,#ccfbf1 100%);color:#0f766e;flex:none}
.years-filter-text{min-width:0;display:flex;flex-direction:column;gap:2px}
.years-filter-title{font-size:13px;color:#64748b;line-height:1.2}
.years-filter-value{font-weight:700;color:#0f172a;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}
.years-filter-caret{color:#64748b;transition:transform .2s ease;flex:none}
.years-filter-dropdown[open] .years-filter-caret{transform:rotate(180deg)}
.years-filter-box{position:absolute;top:calc(100% + 8px);left:0;z-index:20;width:min(380px, 92vw);padding:14px;max-height:240px;overflow:auto;border:1px solid rgba(15,23,42,.08);border-radius:18px;background:#fff;box-shadow:0 22px 48px rgba(15,23,42,.16)}
.years-filter-grid{display:flex;gap:10px;flex-wrap:wrap}
.year-option{position:relative;display:inline-flex}
.year-option input{position:absolute;opacity:0;pointer-events:none}
.year-option span{display:inline-flex;align-items:center;justify-content:center;min-width:78px;padding:9px 14px;border-radius:999px;border:1px solid rgba(15,23,42,.08);background:#f8fafc;color:#0f172a;font-weight:700;cursor:pointer;transition:all .2s ease}
.year-option:hover span{border-color:rgba(15,118,110,.24);background:#fff}
.year-option input:checked + span{color:#fff;border-color:transparent;background:linear-gradient(135deg,#0f766e 0%,#0d9488 55%,#10b981 100%);box-shadow:0 10px 24px rgba(15,118,110,.20)}
.year-option input:focus-visible + span{outline:3px solid rgba(16,185,129,.18);outline-offset:2px}
.years-filter-hint{margin-top:10px;line-height:1.6}
@media (max-width: 768px){.years-filter-wrap{min-width:100%}.years-filter-box{width:100%;max-height:none}.years-filter-value{max-width:100%}}
