@font-face {
  font-family: "Almarai";
  src: url("/static/fonts/Almarai-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Almarai";
  src: url("/static/fonts/Almarai-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: "Almarai";
  src: url("/static/fonts/Almarai-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
}

:root {
  --background: 210 40% 98%;
  --foreground: 222 47% 11%;
  --muted: 210 40% 96%;
  --muted-foreground: 215 16% 47%;
  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;
  --popover: 0 0% 100%;
  --popover-foreground: 222 47% 11%;
  --border: 214 32% 91%;
  --input: 214 32% 91%;
  --primary: 198 90% 44%;
  --primary-foreground: 0 0% 100%;
  --secondary: 210 40% 96%;
  --secondary-foreground: 222 47% 11%;
  --accent: 37 91% 55%;
  --accent-foreground: 222 47% 11%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 98%;
  --ring: 37 91% 55%;
  --success: 144 55% 41%;
  --radius: 0.75rem;
  --font-sans: "Almarai", "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

body {
  margin: 0;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  direction: rtl;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  background: hsl(var(--background));
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 280px;
  border-inline-end: 1px solid hsl(var(--border) / 0.6);
  background: hsl(var(--card) / 0.75);
  backdrop-filter: blur(18px);
  display: none;
  flex-direction: column;
}

.app-sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border) / 0.6);
}

.app-sidebar-logo {
  height: 44px;
  width: 44px;
  border-radius: 999px;
  background: hsl(var(--primary) / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-sidebar-logo img {
  max-height: 70%;
  max-width: 70%;
}

.app-sidebar-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.app-sidebar-subtitle {
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
}

.app-nav {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
}

.app-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid transparent;
  color: hsl(var(--muted-foreground));
  transition: all 0.2s ease;
}

.app-nav-item:hover {
  background: hsl(var(--muted) / 0.7);
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

.app-nav-item.active {
  background: hsl(var(--primary) / 0.12);
  border-color: hsl(var(--primary) / 0.4);
  color: hsl(var(--primary));
}

.app-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
}

.app-nav-item.active .app-nav-icon {
  border-color: hsl(var(--primary) / 0.4);
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
}

.app-sidebar-footer {
  border-top: 1px solid hsl(var(--border) / 0.6);
  padding: 1rem 1.5rem;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid hsl(var(--border) / 0.6);
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(14px);
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
}

.app-header-caption {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.app-header-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-role-pill {
  display: none;
  padding: 0.45rem 0.75rem;
  border-radius: 0.9rem;
  border: 1px solid hsl(var(--border));
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
}

.app-content {
  flex: 1;
  padding: 1.5rem 1rem 2rem;
  background: hsl(var(--background) / 0.6);
}

.app-nav-mobile {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--border) / 0.6);
  background: hsl(var(--background) / 0.9);
}

.app-nav-pill {
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.app-nav-pill.active {
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  border-color: hsl(var(--primary) / 0.3);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.page-header-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0b9ad6;
}

.page-header-subtitle {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
}

.card-soft {
  border-radius: 1.25rem;
  border: 1px solid rgba(11, 154, 214, 0.12);
  background: rgba(255, 255, 255, 0.95);
  color: hsl(var(--card-foreground));
  box-shadow: 0 22px 38px rgba(11, 154, 214, 0.12);
  backdrop-filter: blur(6px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 2.5rem;
  padding: 0 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-sm {
  height: 2.2rem;
  padding: 0 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  height: 2.75rem;
  padding: 0 1.5rem;
  font-size: 1rem;
}

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.btn-primary:hover {
  background: hsl(var(--primary) / 0.9);
}

.btn-outline-primary {
  background: transparent;
  color: hsl(var(--primary));
  border-color: hsl(var(--primary) / 0.6);
}

.btn-outline-primary:hover {
  background: hsl(var(--primary) / 0.12);
}

.btn-success {
  background: hsl(var(--success));
  color: white;
  border-color: hsl(var(--success));
}

.btn-success:hover {
  background: hsl(var(--success) / 0.9);
}

.btn-outline-success {
  background: transparent;
  color: hsl(var(--success));
  border-color: hsl(var(--success) / 0.6);
}

.btn-outline-success:hover {
  background: hsl(var(--success) / 0.12);
}

.btn-secondary,
.btn-outline-secondary {
  color: hsl(var(--secondary-foreground));
}

.btn-secondary {
  background: hsl(var(--secondary));
  border-color: hsl(var(--secondary));
}

.btn-secondary:hover {
  background: hsl(var(--secondary) / 0.9);
}

.btn-outline-secondary {
  background: transparent;
  border-color: hsl(var(--border));
}

.btn-outline-secondary:hover {
  background: hsl(var(--muted));
}

.btn-warning {
  background: hsl(var(--accent));
  color: #1f2937;
  border-color: hsl(var(--accent));
}

.btn-warning:hover {
  background: hsl(var(--accent) / 0.9);
}

.btn-outline-warning {
  background: transparent;
  color: hsl(var(--accent));
  border-color: hsl(var(--accent) / 0.6);
}

.btn-outline-warning:hover {
  background: hsl(var(--accent) / 0.12);
}

.btn-danger {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  border-color: hsl(var(--destructive));
}

.btn-danger:hover {
  background: hsl(var(--destructive) / 0.9);
}

.btn-outline-danger {
  background: transparent;
  color: hsl(var(--destructive));
  border-color: hsl(var(--destructive) / 0.6);
}

.btn-outline-danger:hover {
  background: hsl(var(--destructive) / 0.12);
}

.btn-info {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.btn-info:hover {
  background: hsl(var(--primary) / 0.9);
}

.btn-outline-info {
  background: transparent;
  color: hsl(var(--primary));
  border-color: hsl(var(--primary) / 0.6);
}

.btn-outline-info:hover {
  background: hsl(var(--primary) / 0.12);
}

.form-control,
.form-select,
textarea {
  border-radius: 0.75rem;
  border: 1px solid rgba(11, 154, 214, 0.3);
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  box-shadow: 0 1px 0 rgba(11, 154, 214, 0.12);
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
  border-color: #0b9ad6;
  box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.35);
}

.form-label {
  color: #0b9ad6;
  font-weight: 600;
  font-size: 0.85rem;
}

.table {
  border-color: hsl(var(--border));
}

.table thead th {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  font-weight: 600;
}

.table-hover tbody tr:hover {
  background: hsl(var(--muted) / 0.6);
}

.pagination .page-link {
  border-radius: 0.65rem;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  margin: 0 0.2rem;
  transition: all 0.2s ease;
}

.pagination .page-item.active .page-link {
  background: hsl(var(--primary) / 0.15);
  border-color: hsl(var(--primary) / 0.4);
  color: hsl(var(--primary));
}

.alert {
  border-radius: 0.75rem;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: hsl(var(--background));
}

.auth-content {
  width: 100%;
  max-width: 520px;
}

@media (max-width: 991.98px) {
  .app-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .app-role-pill {
    display: inline-flex;
  }
}

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-content {
    padding: 1rem 0.75rem 1.5rem;
  }

  .table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table th,
  .table td {
    white-space: nowrap;
  }
}

@media (min-width: 992px) {
  .app-sidebar {
    display: flex;
  }

  .app-nav-mobile {
    display: none;
  }

  .app-content {
    padding: 2rem 2.5rem;
  }

  .app-role-pill {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
  }
}
