:root {
  --card-color: #1e3a8a;
  --card-font-size: 14px;
  --card-bg-opacity: 0.1;
  --card-bg-img: none;
  --erp-primary: #1e3a8a;
  --erp-primary-600: #1d4ed8;
  --erp-primary-50: #eff6ff;
  --erp-success: #059669;
  --erp-danger: #dc2626;
  --erp-warning: #d97706;
  --erp-bg: #f6f8fb;
  --erp-surface: #ffffff;
  --erp-surface-muted: #f8fafc;
  --erp-border: #e2e8f0;
  --erp-border-strong: #cbd5e1;
  --erp-text: #0f172a;
  --erp-muted: #64748b;
  --erp-muted-2: #94a3b8;
  --erp-radius: 12px;
  --erp-radius-lg: 14px;
  --erp-shadow: 0 18px 45px rgba(15, 23, 42, 0.07);
}

* {
  box-sizing: border-box;
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}
.hidden {
  display: none !important;
}
#printArea {
  display: none;
}
[hidden] {
  display: none !important;
}
body {
  font-family:
    "IBM Plex Sans Arabic",
    "Inter",
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--erp-bg);
  color: var(--erp-text);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

:lang(en),
[dir="ltr"],
input[dir="ltr"],
.font-mono {
  font-family:
    "Inter",
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
}

button,
a,
input,
select,
textarea {
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

button {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.28);
  outline-offset: 2px;
}

button:disabled,
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.auth-screen {
  display: flex;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 18%, rgba(29, 78, 216, 0.1), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #eef4fb 100%);
}

.auth-shell {
  display: grid;
  width: min(100%, 1120px);
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 440px);
  gap: 18px;
  align-items: stretch;
}

.auth-brand-panel,
.auth-card {
  border-radius: var(--erp-radius-lg);
}

.auth-brand-panel {
  position: relative;
  display: flex;
  min-height: 590px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid rgba(191, 219, 254, 0.45);
  background:
    linear-gradient(145deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0) 44%),
    linear-gradient(145deg, #1e3a8a 0%, #1d4ed8 100%);
  padding: 34px;
  color: #ffffff;
  box-shadow: var(--erp-shadow);
}

.auth-brand-panel::after {
  position: absolute;
  inset: auto -120px -150px auto;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  content: "";
}

.auth-logo-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-logo-mark {
  display: inline-flex;
  height: 58px;
  width: 58px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.auth-logo-mark img {
  max-height: 42px;
  max-width: 42px;
  object-fit: contain;
}

.auth-eyebrow {
  display: block;
  color: #bfdbfe;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.auth-brand-panel h1,
.auth-card h2 {
  margin: 0;
  font-weight: 950;
  line-height: 1.35;
}

.auth-brand-panel h1 {
  color: #ffffff;
  font-size: 30px;
}

.auth-lede {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: auto 0 28px;
  color: #e0edff;
  font-size: 18px;
  font-weight: 650;
  line-height: 2;
}

.auth-proof-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.auth-proof-item {
  display: flex;
  min-height: 84px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  padding: 12px;
  color: #ffffff;
}

.auth-proof-item i {
  color: #dbeafe;
  font-size: 18px;
}

.auth-proof-item span {
  font-size: 12px;
  font-weight: 850;
}

.auth-card {
  display: flex;
  min-height: 590px;
  flex-direction: column;
  border: 1px solid var(--erp-border);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--erp-shadow);
}

.auth-card__header {
  padding: 28px 28px 18px;
}

.auth-card__kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--erp-primary);
  font-size: 12px;
  font-weight: 950;
}

.auth-card h2 {
  color: #0f172a;
  font-size: 24px;
}

.auth-card p {
  margin: 6px 0 0;
  color: var(--erp-muted);
  font-size: 13px;
  font-weight: 750;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 0 28px;
  border: 1px solid var(--erp-border);
  border-radius: 12px;
  background: #f8fafc;
  padding: 4px;
}

.auth-tab {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
}

.auth-tab:hover {
  background: #ffffff;
  color: var(--erp-primary);
}

.auth-tab.is-active {
  background: var(--erp-primary);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(30, 58, 138, 0.2);
}

.auth-card__body {
  flex: 1;
  padding: 22px 28px 28px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field span {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.auth-input {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--erp-border-strong);
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 750;
  outline: none;
}

.auth-input[dir="ltr"] {
  text-align: left;
}

.auth-input:hover {
  border-color: #93c5fd;
}

.auth-input:focus {
  border-color: var(--erp-primary-600);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.1);
}

.auth-submit {
  display: inline-flex;
  min-height: 50px;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 4px;
  border-radius: 12px;
  background: var(--erp-primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 950;
  box-shadow: 0 14px 28px rgba(30, 58, 138, 0.2);
}

.auth-submit:hover {
  background: var(--erp-primary-600);
  transform: translateY(-1px);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: var(--erp-primary-50);
  padding: 11px 12px;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.7;
}

.auth-note i {
  margin-top: 4px;
}

.app-sidebar {
  width: 244px;
  max-width: calc(100vw - 48px);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-left: 1px solid var(--erp-border);
  color: var(--erp-text);
  box-shadow: -16px 0 36px rgba(15, 23, 42, 0.08);
}

.sidebar-close {
  position: absolute;
  left: 14px;
  top: 14px;
  display: inline-flex;
  min-height: 40px;
  min-width: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #475569;
}

.sidebar-close:hover {
  background: #f1f5f9;
  color: var(--erp-primary);
}

.sidebar-brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--erp-border);
}

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

.sidebar-logo {
  display: inline-flex;
  height: 42px;
  width: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(30, 58, 138, 0.08);
}

.sidebar-logo img {
  max-height: 30px;
  max-width: 30px;
  object-fit: contain;
}

.sidebar-center-title {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.sidebar-center-caption {
  margin-top: 2px;
  color: var(--erp-muted);
  font-size: 11px;
  font-weight: 700;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  background: #ffffff;
}

.sidebar-user-icon {
  display: inline-flex;
  height: 34px;
  width: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--erp-primary-50);
  color: var(--erp-primary);
}

.sidebar-user-name {
  margin: 0;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.4;
}

.sidebar-user-role {
  margin: 1px 0 0;
  color: var(--erp-muted);
  font-size: 11px;
  font-weight: 700;
}

.sidebar-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: var(--erp-muted);
  font-size: 11px;
  font-weight: 800;
}

.sidebar-status-row span:last-child {
  color: var(--erp-success);
}

.sidebar-nav {
  padding: 10px 10px 12px;
}

.nav-group {
  padding: 8px 0;
}

.nav-group + .nav-group {
  border-top: 1px solid #eef2f7;
}

.nav-group-label {
  margin: 0 8px 6px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
}

.nav-btn {
  position: relative;
  display: flex;
  min-height: 40px;
  width: 100%;
  align-items: center;
  gap: 10px;
  border-radius: 11px;
  padding: 8px 10px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.nav-btn::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 0;
  bottom: 8px;
  width: 3px;
  border-radius: 999px 0 0 999px;
  background: transparent;
}

.nav-btn:hover {
  background: #f1f5f9;
  color: var(--erp-primary);
}

.nav-btn:active {
  transform: scale(0.99);
}

.nav-btn.is-active {
  background: var(--erp-primary-50);
  color: var(--erp-primary);
}

.nav-btn.is-active::before {
  background: var(--erp-primary);
}

.nav-icon {
  display: inline-flex;
  height: 28px;
  width: 28px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
}

.nav-btn:hover .nav-icon,
.nav-btn.is-active .nav-icon {
  background: #dbeafe;
  color: var(--erp-primary);
}

.sidebar-footer {
  padding: 12px 14px 16px;
  border-top: 1px solid var(--erp-border);
  background: rgba(248, 250, 252, 0.82);
}

.btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 11px;
  border: 1px solid transparent;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 900;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--erp-primary);
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(30, 58, 138, 0.16);
}

.btn-primary:hover {
  background: var(--erp-primary-600);
}

.btn-secondary {
  border-color: var(--erp-border);
  background: #ffffff;
  color: #334155;
}

.btn-secondary:hover {
  border-color: #bfdbfe;
  background: var(--erp-primary-50);
  color: var(--erp-primary);
}

.btn-danger {
  background: #fff1f2;
  color: #b91c1c;
  border-color: #fecdd3;
}

.btn-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

.app-main {
  background:
    linear-gradient(180deg, #f8fbff 0%, var(--erp-bg) 270px),
    var(--erp-bg);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.86);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.app-header__title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-header__title {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.35;
}

.app-header__subtitle {
  margin: 1px 0 0;
  color: var(--erp-muted);
  font-size: 13px;
  font-weight: 700;
}

.app-header__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-icon-button {
  display: inline-flex;
  min-height: 42px;
  min-width: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  border: 1px solid var(--erp-border);
  background: #ffffff;
  color: #475569;
}

.app-icon-button:hover {
  border-color: #bfdbfe;
  background: var(--erp-primary-50);
  color: var(--erp-primary);
}

.status-chip,
.date-chip,
.athan-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  border: 1px solid var(--erp-border);
  background: #ffffff;
  padding: 6px 10px;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.athan-chip {
  border-color: #bfdbfe;
  background: var(--erp-primary-50);
  color: var(--erp-primary);
}

.inventory-bell {
  position: relative;
  color: var(--erp-warning);
}

.inventory-bell__dot {
  position: absolute;
  top: 8px;
  right: 8px;
  height: 9px;
  width: 9px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  background: var(--erp-danger);
}

.app-content-shell {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 22px;
}

.dashboard-page {
  flex-direction: column;
  gap: 18px;
}

.tab-content.active.dashboard-page {
  display: flex;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: 16px;
  align-items: stretch;
  padding: 18px;
  border: 1px solid #dbeafe;
  border-radius: var(--erp-radius-lg);
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 58%, #eff6ff 100%);
}

.dashboard-hero__eyebrow,
.section-eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--erp-primary);
  font-size: 12px;
  font-weight: 950;
}

.dashboard-hero h1 {
  margin: 0;
  color: #0f172a;
  font-size: 28px;
  font-weight: 950;
  line-height: 1.35;
}

.dashboard-hero p {
  margin: 6px 0 0;
  max-width: 720px;
  color: #475569;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.75;
}

.hero-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hero-status {
  min-height: 82px;
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  background: rgba(255, 255, 255, 0.8);
  padding: 12px;
}

.hero-status span {
  color: var(--erp-muted);
  font-size: 11px;
  font-weight: 900;
}

.hero-status strong {
  display: block;
  margin-top: 5px;
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  min-height: 150px;
  grid-column: span 2;
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  background: var(--erp-surface);
  padding: 14px;
}

.stat-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.stat-card__top,
.dashboard-section__header,
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stat-card__label {
  color: var(--erp-muted);
  font-size: 12px;
  font-weight: 950;
}

.stat-card__icon {
  display: inline-flex;
  height: 34px;
  width: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--erp-primary-50);
  color: var(--erp-primary);
}

.stat-card__value {
  display: block;
  margin-top: 14px;
  color: #0f172a;
  font-size: 30px;
  font-weight: 950;
  line-height: 1.15;
}

.stat-card__unit {
  color: var(--erp-muted);
  font-size: 12px;
  font-weight: 900;
}

.stat-card__trend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--erp-muted);
  font-size: 12px;
  font-weight: 800;
}

.tone-success {
  color: var(--erp-success) !important;
}

.tone-danger {
  color: var(--erp-danger) !important;
}

.tone-warning {
  color: var(--erp-warning) !important;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.dashboard-section {
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  background: var(--erp-surface);
  overflow: hidden;
}

.dashboard-section__header {
  padding: 15px 16px 12px;
  border-bottom: 1px solid var(--erp-border);
}

.dashboard-section__title {
  margin: 0;
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
}

.dashboard-section__subtitle {
  margin: 2px 0 0;
  color: var(--erp-muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-section__body {
  padding: 14px 16px 16px;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-action-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 70px;
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  background: #ffffff;
  padding: 11px;
  text-align: right;
}

.quick-action-card:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
  color: var(--erp-primary);
  box-shadow: 0 12px 24px rgba(30, 58, 138, 0.07);
}

.quick-action-card:active {
  transform: scale(0.99);
}

.quick-action-card__icon {
  display: inline-flex;
  height: 38px;
  width: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--erp-primary-50);
  color: var(--erp-primary);
  font-size: 15px;
}

.quick-action-card__title {
  display: block;
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}

.quick-action-card__meta {
  display: block;
  margin-top: 2px;
  color: var(--erp-muted);
  font-size: 11px;
  font-weight: 750;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-item,
.attention-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eef2f7;
}

.activity-item:last-child,
.attention-item:last-child {
  border-bottom: 0;
}

.activity-item strong,
.attention-item strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}

.activity-item span,
.attention-item span {
  color: var(--erp-muted);
  font-size: 12px;
  font-weight: 750;
}

.attention-item__icon {
  display: inline-flex;
  height: 32px;
  width: 32px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #fffbeb;
  color: var(--erp-warning);
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--erp-border);
  background: #f8fafc;
  padding: 3px 9px;
  color: #475569;
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.badge-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #047857;
}

.badge-danger {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #b91c1c;
}

.badge-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.table-toolbar {
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--erp-border);
  background: #fbfdff;
}

.table-toolbar__filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-input,
.table-select {
  min-height: 38px;
  border: 1px solid var(--erp-border);
  border-radius: 10px;
  background: #ffffff;
  padding: 8px 10px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}

.table-input {
  min-width: min(260px, 100%);
}

.table-input:focus,
.table-select:focus {
  border-color: #93c5fd;
}

.data-table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  text-align: right;
}

.data-table thead th {
  border-bottom: 1px solid var(--erp-border);
  background: #f8fafc;
  color: #64748b;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 950;
}

.data-table tbody td {
  border-bottom: 1px solid #eef2f7;
  color: #334155;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 750;
  vertical-align: middle;
}

.data-table tbody tr:hover td {
  background: #f8fbff;
}

.table-action {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--erp-border);
  background: #ffffff;
  color: #334155;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 900;
}

.table-action:hover {
  border-color: #bfdbfe;
  background: var(--erp-primary-50);
  color: var(--erp-primary);
}

.empty-state {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px;
  color: var(--erp-muted);
  text-align: center;
}

.empty-state__icon {
  display: inline-flex;
  height: 42px;
  width: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 17px;
}

.empty-state strong {
  margin-top: 10px;
  color: #334155;
  font-size: 14px;
  font-weight: 950;
}

.empty-state span {
  margin-top: 3px;
  color: var(--erp-muted);
  font-size: 12px;
  font-weight: 750;
}

.metric-split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric-split__item {
  border: 1px solid var(--erp-border);
  border-radius: 11px;
  background: #fbfdff;
  padding: 10px;
}

.metric-split__item span {
  color: var(--erp-muted);
  font-size: 11px;
  font-weight: 900;
}

.metric-split__item strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 17px;
  font-weight: 950;
}

.finance-stat {
  min-height: 140px;
}

/* Shared ERP polish for legacy screens still built from Tailwind utility blocks. */
.app-main .tab-content:not(.dashboard-page) {
  gap: 18px;
}

.app-main .tab-content .bg-white.rounded-xl,
.app-main .tab-content .bg-white.rounded-2xl,
.app-main .dashboard-section {
  border: 1px solid var(--erp-border) !important;
  border-radius: var(--erp-radius-lg) !important;
  background: var(--erp-surface) !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.055) !important;
}

.app-main .tab-content .border-t-4 {
  border-top-width: 1px !important;
}

.app-main .tab-content .shadow,
.app-main .tab-content .shadow-sm,
.app-main .tab-content .shadow-md,
.app-main .tab-content .shadow-lg {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.055) !important;
}

.app-main .tab-content h2,
.app-main .tab-content h3,
.app-main .tab-content h4 {
  color: #0f172a;
  letter-spacing: 0;
}

.app-main .tab-content h2 i,
.app-main .tab-content h3 i,
.app-main .tab-content h4 i {
  color: var(--erp-primary);
  font-size: 0.9em;
}

.app-main .tab-content .border-b {
  border-color: var(--erp-border) !important;
}

.app-main form.bg-gray-50,
.app-main .tab-content div.bg-gray-50.border,
.app-main .tab-content form.bg-gray-50.border,
.app-main .tab-content section.bg-gray-50.border,
.app-main .tab-content div.bg-blue-50,
.app-main .tab-content form.bg-blue-50,
.app-main .tab-content section.bg-blue-50,
.app-main .tab-content div.bg-green-50,
.app-main .tab-content form.bg-green-50,
.app-main .tab-content section.bg-green-50,
.app-main .tab-content div.bg-red-50,
.app-main .tab-content form.bg-red-50,
.app-main .tab-content section.bg-red-50,
.app-main .tab-content div.bg-yellow-50,
.app-main .tab-content form.bg-yellow-50,
.app-main .tab-content section.bg-yellow-50,
.app-main .tab-content div.bg-purple-50,
.app-main .tab-content form.bg-purple-50,
.app-main .tab-content section.bg-purple-50,
.app-main .tab-content div.bg-indigo-50,
.app-main .tab-content form.bg-indigo-50,
.app-main .tab-content section.bg-indigo-50 {
  border: 1px solid var(--erp-border) !important;
  border-radius: var(--erp-radius) !important;
  background: var(--erp-surface-muted) !important;
}

.app-main label {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.45;
}

.app-main input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
.app-main select,
.app-main textarea {
  min-height: 44px;
  border: 1px solid var(--erp-border-strong) !important;
  border-radius: 11px !important;
  background: #ffffff !important;
  color: #0f172a;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 750;
  outline: none;
}

.app-main input[type="file"] {
  padding: 8px 10px;
}

.app-main input::placeholder,
.app-main textarea::placeholder {
  color: #94a3b8;
  font-weight: 650;
}

.app-main input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):hover,
.app-main select:hover,
.app-main textarea:hover {
  border-color: #93c5fd !important;
}

.app-main input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):focus,
.app-main select:focus,
.app-main textarea:focus {
  border-color: var(--erp-primary-600) !important;
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.11);
}

.app-main input:disabled,
.app-main select:disabled,
.app-main textarea:disabled {
  cursor: not-allowed;
  background: #f1f5f9 !important;
  color: #94a3b8;
}

.app-main input[type="checkbox"],
.app-main input[type="radio"] {
  accent-color: var(--erp-primary);
}

.app-main button:not(.nav-btn):not(.app-icon-button):not(.sidebar-close):not(.quick-action-card):not(.table-action):not(.btn) {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px !important;
  border: 1px solid transparent;
  padding: 8px 13px;
  font-weight: 900;
  line-height: 1.4;
  box-shadow: none !important;
}

.app-main button:not(.nav-btn):not(.app-icon-button):not(.sidebar-close):not(.quick-action-card):not(.table-action):not(.btn):hover {
  transform: translateY(-1px);
}

.app-main button:not(.nav-btn):not(.app-icon-button):not(.sidebar-close):not(.quick-action-card):not(.table-action):not(.btn):active {
  transform: translateY(0);
}

.app-main button[class*="bg-primary"],
.app-main button[class*="bg-blue"],
.app-main button[class*="bg-indigo"],
.app-main button[class*="bg-purple"],
.app-main button[class*="bg-gray-800"],
.app-main button[class*="bg-dark"] {
  background: var(--erp-primary) !important;
  color: #ffffff !important;
}

.app-main button[class*="bg-primary"]:hover,
.app-main button[class*="bg-blue"]:hover,
.app-main button[class*="bg-indigo"]:hover,
.app-main button[class*="bg-purple"]:hover,
.app-main button[class*="bg-gray-800"]:hover,
.app-main button[class*="bg-dark"]:hover {
  background: var(--erp-primary-600) !important;
}

.app-main button[class*="bg-success"],
.app-main button[class*="bg-green"] {
  background: var(--erp-success) !important;
  color: #ffffff !important;
}

.app-main button[class*="bg-success"]:hover,
.app-main button[class*="bg-green"]:hover {
  background: #047857 !important;
}

.app-main button[class*="bg-danger"],
.app-main button[class*="bg-red"] {
  background: var(--erp-danger) !important;
  color: #ffffff !important;
}

.app-main button[class*="bg-danger"]:hover,
.app-main button[class*="bg-red"]:hover {
  background: #b91c1c !important;
}

.app-main button[class*="bg-warning"],
.app-main button[class*="bg-yellow"] {
  background: var(--erp-warning) !important;
  color: #ffffff !important;
}

.app-main button[class*="bg-warning"]:hover,
.app-main button[class*="bg-yellow"]:hover {
  background: #b45309 !important;
}

.app-main button:not([class*="bg-"]):not(.nav-btn):not(.app-icon-button):not(.sidebar-close):not(.quick-action-card):not(.table-action):not(.btn):hover {
  background: #f8fafc;
}

.app-main .data-table-wrap,
.app-main .overflow-x-auto.border {
  border: 1px solid var(--erp-border) !important;
  border-radius: var(--erp-radius) !important;
  background: #ffffff;
}

.app-main table:not(.report-table):not(.my-schedule-table),
.app-main .erp-table {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0;
  text-align: right;
}

.app-main table:not(.report-table):not(.my-schedule-table) thead th {
  position: relative;
  border-bottom: 1px solid var(--erp-border) !important;
  background: #f8fafc !important;
  color: #475569 !important;
  padding: 11px 14px !important;
  font-size: 12px !important;
  font-weight: 950 !important;
  white-space: nowrap;
}

.app-main table:not(.report-table):not(.my-schedule-table) tbody td {
  border-bottom: 1px solid #eef2f7 !important;
  color: #334155;
  padding: 11px 14px !important;
  font-size: 13px;
  font-weight: 750;
  vertical-align: middle;
}

.app-main table:not(.report-table):not(.my-schedule-table) tbody tr:last-child td {
  border-bottom: 0 !important;
}

.app-main table:not(.report-table):not(.my-schedule-table) tbody tr:hover td {
  background: #f8fbff;
}

.app-main table:not(.report-table):not(.my-schedule-table) td[dir="ltr"],
.app-main table:not(.report-table):not(.my-schedule-table) .font-mono {
  font-variant-numeric: tabular-nums;
}

.app-main table:not(.report-table):not(.my-schedule-table) button:not([class*="bg-"]) {
  min-height: 34px;
  min-width: 34px;
  border-radius: 9px !important;
  color: #64748b;
}

.app-main table:not(.report-table):not(.my-schedule-table) button:not([class*="bg-"]):hover {
  background: #f1f5f9;
  color: var(--erp-primary);
}

.app-main table span[class*="bg-green-100"],
.app-main table span[class*="bg-red-100"],
.app-main table span[class*="bg-yellow-100"],
.app-main table span[class*="bg-blue-100"] {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px !important;
  border: 1px solid currentColor;
  background: #ffffff !important;
  padding: 3px 9px !important;
  font-size: 11px !important;
  font-weight: 950 !important;
}

.empty-state--table {
  min-height: 118px;
  margin: 0;
}

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

  .stat-card {
    grid-column: span 1;
  }

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

@media (max-width: 767px) {
  .auth-screen {
    align-items: flex-start;
    padding: 16px;
  }

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

  .auth-card {
    order: 1;
  }

  .auth-brand-panel,
  .auth-card {
    min-height: auto;
  }

  .auth-brand-panel {
    order: 2;
    padding: 22px;
  }

  .auth-lede {
    margin: 26px 0 18px;
    font-size: 15px;
  }

  .auth-proof-grid {
    grid-template-columns: 1fr;
  }

  .auth-card__header,
  .auth-card__body {
    padding-inline: 20px;
  }

  .auth-tabs {
    margin-inline: 20px;
  }

  .app-header {
    align-items: flex-start;
    padding: 12px;
  }

  .app-header__meta {
    justify-content: flex-start;
  }

  .date-chip {
    display: none;
  }

  .app-content-shell {
    padding: 14px;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
    padding: 14px;
  }

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

  .kpi-grid,
  .metric-split {
    grid-template-columns: 1fr;
  }

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

  .table-toolbar {
    align-items: stretch;
  }

  .table-toolbar__filters,
  .table-input,
  .table-select {
    width: 100%;
  }

  .app-main .dashboard-section__header,
  .app-main .tab-content .flex.justify-between.items-center {
    align-items: stretch;
    flex-direction: column;
  }

  .app-main .dashboard-section__header .btn,
  .app-main .tab-content button {
    width: 100%;
  }

  .app-main table button,
  .app-main .app-icon-button,
  .app-main .quick-action-card {
    width: auto;
  }

  .app-main .tab-content .overflow-x-auto,
  .app-main .data-table-wrap {
    max-width: 100%;
  }

  .app-main table:not(.report-table):not(.my-schedule-table) {
    min-width: 640px;
  }
}

@media (min-width: 768px) {
  .sidebar-close,
  .app-menu-toggle {
    display: none !important;
  }
}

@media (max-width: 460px) {
  .auth-tabs {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel h1 {
    font-size: 24px;
  }

  .auth-card h2 {
    font-size: 21px;
  }

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

  .app-header {
    flex-direction: column;
  }
}

@media print {
  body * {
    visibility: hidden;
  }
  #printArea,
  #printArea * {
    visibility: visible;
  }
  #printArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 0;
    padding: 0;
  }
  .no-print {
    display: none !important;
  }
  .report-table {
    width: 100%;
    border-collapse: collapse;
    direction: rtl;
    margin-bottom: 20px;
    table-layout: auto;
  }
  .report-table th,
  .report-table td {
    border: 1px solid #000;
    padding: 6px;
    text-align: center;
    font-size: 12px;
  }
  .report-header {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #1e3a8a;
    border-bottom: 3px solid #333;
    padding-bottom: 10px;
  }

  .thermal-receipt {
    width: 80mm;
    padding: 5px;
    font-family: monospace;
    font-size: 12px;
    direction: rtl;
    color: #000;
    text-align: center;
    margin: 0 auto;
  }
  .thermal-receipt h2 {
    font-size: 16px;
    margin-bottom: 2px;
  }
  .thermal-receipt .line {
    border-bottom: 1px dashed #000;
    margin: 5px 0;
  }
  .thermal-receipt table {
    width: 100%;
    font-size: 11px;
  }
  .thermal-receipt td {
    text-align: right;
    padding: 2px;
  }
}

.my-schedule-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  direction: rtl;
  background: #fff;
  margin-bottom: 20px;
}
.my-schedule-table th,
.my-schedule-table td {
  border: 2px solid #94a3b8 !important;
  padding: 12px;
  font-size: 14px;
  color: #1e293b;
}
.my-schedule-table th {
  background-color: #f1f5f9 !important;
  font-weight: 900;
  color: #1e3a8a;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.my-schedule-table td.day-cell {
  background-color: #f8fafc !important;
  font-weight: 900;
  width: 120px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.my-schedule-table td.empty-cell {
  background-color: #f8fafc !important;
  color: #cbd5e1;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.sched-item {
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.sched-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.sched-item-title {
  font-weight: 900;
  color: #1e3a8a;
  display: block;
  font-size: 14px;
}
.sched-item-teacher {
  color: #475569;
  display: block;
  font-size: 12px;
  font-weight: bold;
  margin-top: 2px;
}
.sched-item-time {
  font-weight: 900;
  color: #ef4444;
  display: block;
  font-size: 12px;
  margin-top: 2px;
  direction: ltr;
}

.id-card-modern {
  width: 8.5cm;
  height: 5.4cm;
  border-radius: 12px;
  padding: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  page-break-inside: avoid;
  margin: 10px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  border: 2px solid var(--card-color);
  background: white;
  color: #111827;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  font-size: var(--card-font-size);
}
.id-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--card-bg-img);
  background-size: cover;
  background-position: center;
  opacity: var(--card-bg-opacity);
  z-index: 0;
}
.id-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

@keyframes ring {
  0% {
    transform: rotate(0);
  }
  10% {
    transform: rotate(15deg);
  }
  20% {
    transform: rotate(-15deg);
  }
  30% {
    transform: rotate(10deg);
  }
  40% {
    transform: rotate(-10deg);
  }
  50% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(0);
  }
}
.bell-alert {
  animation: ring 2s ease-in-out infinite;
  color: #ef4444;
}
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #1e3a8a;
  color: white;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  padding: 5px;
  z-index: 9999;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.show-loader {
  transform: translateY(0) !important;
}
.custom-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.timeline-item {
  position: relative;
  padding-right: 20px;
  border-right: 2px solid #e2e8f0;
  margin-bottom: 15px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #3b82f6;
  right: -7px;
  top: 5px;
}

.net-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 5px;
}
.net-online {
  background-color: #10b981;
  box-shadow: 0 0 5px #10b981;
}
.net-offline {
  background-color: #ef4444;
  box-shadow: 0 0 5px #ef4444;
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}
