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

:root {
  --bg: #f5f6fb;
  --bg-soft: #ffffff;
  --surface: #3a3f63;
  --surface-strong: #2e314d;
  --text: #e8e8e8;
  --text-muted: #a6a9b8;
  --ink: #1f2338;
  --line: #d7dbe7;
  --cta: #c2a96b;
  --cta-strong: #b1944e;
  --ok: #2e9f72;
  --danger: #cc5a60;
  --shadow-lg: 0 24px 55px rgba(21, 25, 43, 0.13);
  --shadow-sm: 0 8px 20px rgba(28, 34, 60, 0.08);
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: "Tajawal", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at -10% -20%, rgba(194, 169, 107, 0.24), transparent 70%),
    radial-gradient(900px 400px at 110% 0%, rgba(58, 63, 99, 0.18), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 48%, #eef1f8 100%);
}

.topbar {
  background: linear-gradient(130deg, var(--surface-strong) 0%, var(--surface) 55%, #454a73 100%);
  color: var(--text);
  padding: 16px var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 32px rgba(24, 29, 49, 0.35);
}

.topbar strong {
  font-family: "Sora", "Tajawal", sans-serif;
  font-size: 21px;
  letter-spacing: 0.02em;
}

.topbar span,
.topbar a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.topbar > * {
  min-width: 0;
}

.topbar span {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  text-align: end;
  overflow-wrap: anywhere;
}

.topbar a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.container {
  width: min(1240px, 95%);
  margin: var(--space-xl) auto;
  min-width: 0;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 255, 0.98));
  border: 1px solid rgba(59, 67, 108, 0.14);
  border-radius: 18px;
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
  animation: fadeSlide 320ms ease-out both;
  min-width: 0;
}

.card h2,
.card h3 {
  font-family: "Sora", "Tajawal", sans-serif;
  color: #262c47;
  margin: 0 0 var(--space-lg) 0;
}

.grid { display: grid; gap: var(--space-md); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

label {
  font-size: 13px;
  color: #464b6d;
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #cfd5e6;
  border-radius: 12px;
  background: #ffffff;
  color: #232842;
  font: inherit;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cta);
  box-shadow: 0 0 0 3px rgba(194, 169, 107, 0.26);
  transform: translateY(-1px);
}

input[readonly] {
  background: #f3f5fb;
  color: #313758;
}

/* Keep native controls for checkboxes/radios (do not stretch full width). */
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  transform: none;
  box-shadow: none;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: 2px solid rgba(194, 169, 107, 0.55);
  outline-offset: 2px;
  box-shadow: none;
}

button, .btn {
  border: 0;
  border-radius: 11px;
  padding: 10px 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: "Sora", "Tajawal", sans-serif;
  font-weight: 600;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
  white-space: nowrap;
}

button:hover, .btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cta) 0%, #d4bd88 100%);
  color: #25222f;
  box-shadow: 0 8px 16px rgba(194, 169, 107, 0.34);
}

.btn-primary:hover { filter: brightness(1.03); }

.btn-success {
  background: linear-gradient(135deg, #35b785, var(--ok));
  color: #fff;
  box-shadow: 0 8px 16px rgba(46, 159, 114, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #de7076, var(--danger));
  color: #fff;
  box-shadow: 0 8px 16px rgba(204, 90, 96, 0.28);
}

.btn-muted {
  background: #e7eaf4;
  color: #2d3456;
  border: 1px solid #d2d7e7;
}

.btn[disabled], button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table thead th {
  background: linear-gradient(180deg, #3f446b 0%, #343957 100%);
  color: var(--text);
  font-family: "Sora", "Tajawal", sans-serif;
  font-size: 13px;
  padding: 11px 10px;
  text-align: start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.table tbody td {
  background: #ffffff;
  border-bottom: 1px solid #ebedf5;
  color: #2a304e;
  padding: 10px;
  text-align: start;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.table tbody td .btn,
.table tbody td button {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.table tbody tr:nth-child(even) td {
  background: #f8f9fd;
}

.badge {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
}

.badge-pending { background: #fff4dd; color: #8f5a00; }
.badge-ok { background: #dff7ed; color: #145f42; }
.badge-no { background: #fde3e6; color: #8a1f36; }

.msg {
  padding: 12px 13px;
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid transparent;
  font-weight: 600;
}

.msg-ok {
  background: #e2f8ee;
  color: #115f3d;
  border-color: #bde8d4;
}

.msg-err {
  background: #fde8eb;
  color: #7f2331;
  border-color: #f4c3cc;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.kpi {
  background: linear-gradient(160deg, #ffffff 0%, #edf1fb 100%);
  border: 1px solid #d8dcec;
  border-radius: 15px;
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.kpi > div:first-child {
  color: #596082;
  font-weight: 700;
}

.kpi .v {
  font-family: "Sora", "Tajawal", sans-serif;
  font-size: 30px;
  margin-top: var(--space-sm);
  color: #2c3050;
}

.suggestions {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 6px);
  max-height: 280px;
  overflow: auto;
  border: 1px solid #ccd3e6;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

.suggestion-item {
  display: block;
  width: 100%;
  text-align: start;
  border: 0;
  border-bottom: 1px solid #edf1fa;
  background: #fff;
  color: #293054;
  padding: 11px 12px;
  cursor: pointer;
}

.suggestion-item:hover { background: #f3f6ff; }
.suggestion-other { font-weight: 700; color: #70571f; }

.live-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #de7076, var(--danger));
  color: #fff;
  font-family: "Sora", "Tajawal", sans-serif;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 7px 14px rgba(204, 90, 96, 0.34);
}

.live-toast {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 3000;
  background: #2f3556;
  color: #e8e8e8;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow-lg);
  font-weight: 600;
}

.suppliers-card {
  overflow: hidden;
}

.suppliers-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) minmax(160px, 1fr) auto;
  gap: var(--space-md);
  align-items: end;
}

.suppliers-summary {
  margin: 10px 0 14px;
  padding: 10px 12px;
  background: #f6f8ff;
  border: 1px solid #dbe1f1;
  border-radius: 12px;
  display: grid;
  gap: 6px;
  color: #2c3353;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.suppliers-table td {
  vertical-align: top;
}

.supplier-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-actions {
  flex-wrap: nowrap;
  align-items: center;
}

.user-actions form {
  margin: 0;
}

.user-actions .btn {
  white-space: nowrap;
}

.password-inline-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #4a547c;
}

.suppliers-pagination {
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-indicator {
  background: #eef2fb;
  border: 1px solid #d5ddef;
  border-radius: 10px;
  padding: 8px 10px;
  color: #31395e;
  font-weight: 700;
}

.suppliers-table-compact thead th {
  padding: 9px 9px;
  font-size: 12px;
}

.suppliers-table-compact tbody td {
  padding: 7px 9px;
  font-size: 14px;
  line-height: 1.25;
  min-width: 90px;
}

.suppliers-table-compact .btn {
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 13px;
}

#profit_status.profit-win {
  background: #e5f8ef;
  color: #13603f;
  border-color: #bfe9d4;
  font-weight: 700;
}

#profit_status.profit-loss {
  background: #fde8ec;
  color: #8c2130;
  border-color: #f4c6ce;
  font-weight: 700;
}

#profit_status.profit-neutral {
  background: #eef2fb;
  color: #3a4368;
  border-color: #d7deef;
  font-weight: 700;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .grid-2, .grid-3, .kpis { grid-template-columns: 1fr; }
  .suppliers-toolbar { grid-template-columns: 1fr; }
  .suppliers-pagination { justify-content: flex-start; }
  .topbar { padding: 14px 15px; }
  .topbar strong { font-size: 18px; }
  .topbar span { justify-content: flex-start; text-align: start; }
  .user-actions { flex-wrap: wrap; }
}
/* Dashboard polish */
.dashboard-header {
  margin: 0 0 10px;
}

.dashboard-header h1 {
  margin: 0;
  font-family: "Sora", "Tajawal", sans-serif;
  font-size: clamp(24px, 2.2vw, 32px);
  color: #202742;
  letter-spacing: 0.01em;
}

.dashboard-header p {
  margin: 5px 0 0;
  color: #525c80;
  max-width: 72ch;
  font-size: 14px;
}

.dashboard-container {
  width: min(1700px, 98.5%);
  min-width: 0;
}

.dashboard-main {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.top-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.dashboard-container .card {
  padding: 18px;
}

.dashboard-main .kpis {
  margin: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi {
  position: relative;
  min-height: 116px;
  border: 1px solid #d8deee;
  border-radius: 17px;
  padding: 14px;
  background:
    radial-gradient(200px 90px at 100% 0%, rgba(117, 149, 220, 0.12), transparent 72%),
    linear-gradient(180deg, #ffffff 0%, #f5f8ff 100%);
}

.kpi::after {
  content: "";
  position: absolute;
  inset: auto 18px 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(53, 79, 138, 0.74), rgba(103, 130, 194, 0.08));
}

.kpi .kpi-label {
  font-size: 14px;
  font-weight: 700;
  color: #4d567a;
  letter-spacing: 0.01em;
}

.kpi .v {
  margin-top: 10px;
  font-size: clamp(26px, 2.6vw, 34px);
  color: #1f2745;
}

.kpi-pending {
  border-color: #ebc6cc;
  background:
    radial-gradient(180px 90px at 100% 0%, rgba(216, 102, 112, 0.14), transparent 75%),
    linear-gradient(180deg, #fff8f9 0%, #fff0f2 100%);
}

.kpi-pending::after {
  background: linear-gradient(90deg, rgba(178, 59, 74, 0.82), rgba(178, 59, 74, 0.12));
}

.daily-panel,
.actions-panel,
.pending-panel {
  background:
    radial-gradient(560px 130px at 100% 0%, rgba(88, 107, 170, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.98));
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-head h2,
.actions-panel h2,
.pending-title {
  margin: 0;
  font-family: "Sora", "Tajawal", sans-serif;
  font-size: clamp(20px, 1.9vw, 24px);
  color: #1f2746;
  letter-spacing: 0.01em;
}

.section-head p,
.actions-panel p {
  margin: 6px 0 0;
  color: #586286;
}

.overview-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #ccd8f1;
  background: linear-gradient(135deg, #ecf2ff 0%, #dfe9ff 100%);
  color: #2a3d6b;
  font-family: "Sora", "Tajawal", sans-serif;
  font-weight: 700;
  white-space: nowrap;
}

.daily-list {
  display: grid;
  gap: 11px;
}

.daily-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  border: 1px solid #dbe2f2;
  border-radius: 13px;
  background: #ffffff;
  padding: 12px 13px;
  color: #273155;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease;
}

.daily-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(37, 56, 104, 0.13);
  border-color: #c5d2f0;
  background-color: #fcfdff;
}

.daily-item strong {
  display: block;
  font-family: "Sora", "Tajawal", sans-serif;
  margin-bottom: 4px;
}

.daily-main span {
  display: block;
  margin-top: 2px;
}

.daily-main span strong {
  display: inline;
  margin: 0 4px 0 0;
  font-family: inherit;
  font-size: 12px;
}

.daily-item span,
.daily-item small,
.daily-item time {
  color: #5a6388;
}

.daily-item small {
  display: block;
  margin-top: 4px;
}

.daily-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.btn-sm {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.actions-panel {
  padding-bottom: 18px;
}

.tools-navbar {
  margin-bottom: 14px;
  padding: 14px 16px;
}

.tools-navbar h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.tools-subtitle {
  margin: 0 0 10px;
  color: #5b6589;
  font-size: 14px;
}

.tools-navbar .actions-grid {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tools-navbar .actions-grid-primary,
.tools-navbar .actions-grid-secondary {
  display: grid;
  flex-wrap: initial;
}

.tools-navbar .actions-grid .btn-action {
  flex: 0 1 auto;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.tools-navbar .quick-search-form {
  margin-top: 8px;
  gap: 8px;
}

.tools-navbar .quick-search-input {
  flex: 1 1 420px;
  max-width: none;
  min-height: 40px;
}

.actions-grid {
  margin-top: 13px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.actions-grid-primary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0;
  margin-bottom: 10px;
}

.actions-grid-secondary {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tool-groups {
  display: grid;
  gap: 10px;
  margin: 4px 0 10px;
}

.tool-group {
  border: 1px solid #d8e0f2;
  border-radius: 14px;
  background: linear-gradient(180deg, #fdfefe 0%, #f3f7ff 100%);
  box-shadow: 0 8px 18px rgba(43, 62, 105, 0.08);
  padding: 8px;
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}

.tool-group:hover {
  border-color: #c7d2ec;
  box-shadow: 0 12px 24px rgba(43, 62, 105, 0.12);
}

.tool-group[open] {
  border-color: #becce9;
  box-shadow: 0 16px 28px rgba(40, 60, 104, 0.14);
}

.tool-group summary {
  appearance: none;
  -webkit-appearance: none;
  list-style: none;
  cursor: pointer;
  font-family: "Sora", "Tajawal", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #293a66;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef3ff 0%, #e2eafd 100%);
  border: 1px solid #cfdaf2;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.tool-group > summary {
  display: flex;
}

.tool-group summary:hover {
  background: linear-gradient(135deg, #e7eefc 0%, #d9e4fb 100%);
  border-color: #bdccee;
}

.tool-group[open] summary {
  color: #1f2f58;
  background: linear-gradient(135deg, #dde8ff 0%, #d2e0fb 100%);
  border-color: #b8c9ed;
}

.tool-group summary::-webkit-details-marker {
  display: none;
}

.tool-group summary::marker {
  content: "";
}

.tool-group summary::after {
  content: "\25B8";
  color: #314a82;
  font-size: 13px;
  line-height: 1;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid #b5c5e9;
  background: #f6f9ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.tool-group[open] summary::after {
  content: "\25B8";
  transform: rotate(90deg);
  background: #edf3ff;
  border-color: #9fb5e4;
}

.tool-group .actions-grid {
  margin-top: 10px;
  padding: 0 2px 4px;
}

.tool-group .actions-grid .btn-action {
  min-height: 42px;
  border-radius: 11px;
  font-size: 14px;
}

.dashboard-main .btn-primary {
  background: linear-gradient(135deg, #2f4e84 0%, #3b639f 100%);
  color: #edf2ff;
  box-shadow: 0 8px 18px rgba(38, 64, 111, 0.28);
}

.dashboard-main .btn-primary:hover {
  filter: brightness(1.04);
}

.btn-action {
  min-height: 46px;
  justify-content: flex-start;
  border-radius: 12px;
  padding-inline: 14px;
  background: linear-gradient(135deg, #1f365f 0%, #2a4574 100%);
  color: #eef2ff;
  border: 1px solid #36507f;
  box-shadow: 0 10px 22px rgba(28, 49, 88, 0.21);
  white-space: normal;
  text-wrap: balance;
  line-height: 1.25;
}

.btn-action:hover {
  filter: brightness(1.05);
}

.btn-action-neutral {
  background: linear-gradient(135deg, #e9eef9 0%, #dde5f4 100%);
  border-color: #cfd8ec;
  box-shadow: none;
  color: #27335a;
}

.btn-action-danger {
  background: linear-gradient(135deg, #b74e57 0%, #cb656e 100%);
  border-color: #c8777e;
  color: #fff3f4;
}

.quick-search-form {
  margin-top: 13px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.quick-search-input {
  max-width: 560px;
  border-radius: 12px;
  background: #fbfcff;
}

.pending-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.pending-panel {
  margin-bottom: 0;
}

.pending-table-wrap {
  overflow: auto;
  border-radius: 14px;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.pending-table-wrap .table {
  min-width: 100%;
}

.pending-table-wrap .table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.pending-table-wrap .table td small {
  display: block;
  margin-top: 4px;
  color: #5a6388;
}

.request-history-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.request-history-table {
  min-width: 1700px;
}

.request-history-table td,
.request-history-table th {
  white-space: nowrap;
  vertical-align: top;
}

.request-history-table td:nth-child(6),
.request-history-table td:nth-child(7),
.request-history-table td:nth-child(12),
.request-history-table td:nth-child(13) {
  white-space: normal;
  min-width: 190px;
}

.history-action-cell {
  white-space: nowrap !important;
  min-width: 150px;
}

.pending-empty,
.daily-empty {
  text-align: center;
  padding: 12px;
  color: #5e688e;
  background: #f7f9ff;
  border: 1px dashed #cad5ef;
  border-radius: 12px;
}

.details-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
  min-width: 0;
}

.details-table th,
.details-table td {
  vertical-align: middle;
}

.finance-panel {
  border-color: #d7deef;
}

.finance-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.finance-item {
  border-radius: 12px;
  border: 1px solid #dbe1f1;
  padding: 11px 12px;
  display: grid;
  gap: 4px;
}

.finance-item span {
  color: #5d678e;
  font-weight: 700;
  font-size: 13px;
}

.finance-item strong {
  font-family: "Sora", "Tajawal", sans-serif;
  font-size: 24px;
  color: #1f2746;
}

.finance-sale {
  background: linear-gradient(180deg, #eef8f3 0%, #e2f2ea 100%);
  border-color: #c8e3d5;
}

.finance-cost {
  background: linear-gradient(180deg, #fff4e7 0%, #fdebd7 100%);
  border-color: #f0d4b2;
}

.finance-profit {
  background: linear-gradient(180deg, #e4f8ef 0%, #d2f0e2 100%);
  border-color: #b9e2cc;
}

.finance-loss {
  background: linear-gradient(180deg, #ffecef 0%, #ffdce2 100%);
  border-color: #f2bcc8;
}

.finance-neutral {
  background: linear-gradient(180deg, #eef2fb 0%, #e2e8f7 100%);
  border-color: #cfd9ef;
}

.finance-note {
  border-radius: 11px;
  border: 1px solid transparent;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}

.field-error {
  border: 1px solid #efb3be !important;
  background: #fff0f3 !important;
  color: #862437 !important;
}

.field-error-inline {
  color: #8f2133 !important;
}

.notes-error {
  border-radius: 10px;
  padding: 10px;
}

.decision-meta {
  color: #505a82;
  font-weight: 700;
}

.decision-actions {
  margin-top: 12px;
  display: grid;
  gap: 14px;
}

.reject-form {
  border: 1px solid #efc1c9;
  border-radius: 12px;
  background: #fff5f7;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.reject-form label {
  margin: 0;
}

.reject-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.reject-field-chip {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid #efc8d0;
  border-radius: 10px;
  background: #fff;
  font-weight: 600;
  color: #6f2232;
}

.reject-field-chip input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.employee-reject-alert {
  border: 1px solid #efc2ca;
  background: #fff3f5;
  border-radius: 10px;
  padding: 9px 10px;
  color: #7c2433;
}

.circulars-card {
  border: 1px solid #cfd8f1;
  background:
    radial-gradient(460px 130px at 100% 0%, rgba(82, 108, 179, 0.14), transparent 72%),
    linear-gradient(180deg, #fdfefe 0%, #f4f7ff 100%);
}

.circulars-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.circulars-list {
  display: grid;
  gap: 8px;
}

.circular-item {
  border: 1px solid #dae2f5;
  border-radius: 11px;
  background: #ffffff;
  padding: 10px 11px;
}

.circular-item-latest {
  border-color: #bfd0f4;
  box-shadow: 0 8px 16px rgba(60, 90, 151, 0.12);
}

.circular-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.circular-item strong {
  color: #263159;
  font-family: "Sora", "Tajawal", sans-serif;
}

.circular-item small {
  color: #606b93;
}

.circular-item p {
  margin: 0;
  color: #3d486f;
  line-height: 1.45;
}

/* Login page */
.login-page {
  min-height: 100vh;
  display: grid;
  align-content: center;
  padding: 24px 0 12px;
}

.login-shell {
  width: min(980px, 94%);
  display: grid;
  grid-template-columns: 1.1fr minmax(320px, 0.9fr);
  gap: 18px;
  margin: 0 auto;
}

.login-intro {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(420px 160px at 10% -5%, rgba(194, 169, 107, 0.2), transparent 70%),
    linear-gradient(145deg, #2a3356 0%, #364171 60%, #415187 100%);
  color: #eef2ff;
  border-color: rgba(255, 255, 255, 0.15);
}

.logo-stage {
  width: 170px;
  min-height: 64px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  box-shadow: 0 10px 24px rgba(10, 14, 30, 0.24);
}

.login-logo {
  width: auto;
  max-width: 124px;
  max-height: 42px;
  height: auto;
  object-fit: contain;
  display: block;
  opacity: 0.96;
}

.login-kicker {
  margin: 0 0 8px;
  color: #d9e4ff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: "Sora", "Tajawal", sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.login-intro h1 {
  margin: 0 0 10px;
  font-family: "Sora", "Tajawal", sans-serif;
  font-size: clamp(24px, 2.6vw, 34px);
  color: #ffffff;
}

.login-note {
  margin: 0;
  max-width: 44ch;
  color: #d4def6;
  line-height: 1.6;
  font-size: 15px;
}

.login-form-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 255, 0.99));
}

.login-form-subtitle {
  margin: -8px 0 14px;
  color: #5c6488;
}

.login-form {
  display: grid;
  gap: 11px;
}

.login-submit {
  margin-top: 2px;
  min-height: 44px;
}

.login-foot {
  margin: 10px auto 0;
  width: min(980px, 94%);
  display: flex;
  justify-content: space-between;
  color: #697194;
  font-size: 12px;
}

@media (max-width: 1360px) {
  .dashboard-main .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1240px) {
  .top-panels {
    grid-template-columns: 1fr;
  }

  .details-layout {
    grid-template-columns: 1fr;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .dashboard-header h1 {
    font-size: 27px;
  }

  .dashboard-main .kpis {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .daily-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .daily-meta {
    justify-items: start;
  }

  .quick-search-form .btn {
    width: 100%;
  }

  .tools-navbar .actions-grid .btn-action {
    flex-basis: 100%;
    white-space: normal;
  }

  .actions-grid-primary {
    grid-template-columns: 1fr;
  }

  .login-page {
    padding-top: 14px;
  }

  .login-shell {
    width: min(640px, 94%);
    gap: 14px;
  }

  .logo-stage {
    width: 154px;
    height: 58px;
    margin-bottom: 14px;
  }

  .login-foot {
    width: min(640px, 94%);
  }
}

@media (max-width: 1400px) {
  .table-wrap .table {
    min-width: 1200px;
  }

  .pending-table-wrap .table {
    min-width: 1200px;
  }
}

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

@media (max-width: 860px) {
  .table-wrap .table,
  .pending-table-wrap .table {
    min-width: 980px;
  }
}

.pwa-install-btn {
  position: fixed;
  inset-inline-start: 16px;
  bottom: 16px;
  z-index: 9998;
  border: 1px solid #2f4a82;
  background: linear-gradient(135deg, #2f4e84 0%, #3b639f 100%);
  color: #eef2ff;
  border-radius: 999px;
  padding: 9px 14px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(29, 52, 94, 0.32);
}

.pwa-install-btn:hover {
  filter: brightness(1.05);
}

@media (max-width: 980px) {
  .pwa-install-btn {
    inset-inline-start: 12px;
    bottom: 12px;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 12px;
  }
}


.lang-switcher {
  position: fixed;
  bottom: 16px;
  inset-inline-end: 16px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(32, 38, 64, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 30px rgba(14, 18, 33, 0.35);
  border-radius: 999px;
  padding: 6px;
  backdrop-filter: blur(8px);
}

.lang-switcher button {
  border: 0;
  border-radius: 999px;
  padding: 7px 13px;
  background: transparent;
  color: #d9dfef;
  font-size: 12px;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.lang-switcher button.is-active {
  background: linear-gradient(135deg, #d7bf88 0%, #bfa26b 100%);
  color: #202233;
  font-weight: 700;
}

.app-back-btn {
  position: static;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: "Sora", "Tajawal", sans-serif;
  font-weight: 600;
  font-size: 12px;
  box-shadow: none;
}

.app-back-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.app-back-btn-icon {
  font-size: 13px;
  line-height: 1;
}

.topbar {
  position: relative;
}

.topbar .app-back-btn {
  margin-inline-end: 12px;
}

html[dir="rtl"] .topbar .app-back-btn {
  margin-inline-end: 0;
  margin-inline-start: 12px;
}

html[dir="rtl"] body {
  font-family: "Tajawal", "Segoe UI", sans-serif;
}

html[dir="rtl"] .topbar,
html[dir="rtl"] .section-head,
html[dir="rtl"] .daily-item,
html[dir="rtl"] .finance-note {
  text-align: right;
}

html[dir="rtl"] .topbar {
  flex-direction: row-reverse;
}

html[dir="rtl"] .actions-grid,
html[dir="rtl"] .grid,
html[dir="rtl"] .kpis {
  direction: rtl;
}

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