@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --primary: #1a6c4f;
  --primary-dark: #0f4a35;
  --accent: #e9f2ec;
  --ink: #1f2a2f;
  --muted: #65707a;
  --border: #d9e0e6;
  --shadow: 0 18px 40px rgba(17, 36, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: #f7f9fa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.site-header {
  background: linear-gradient(90deg, #123326 0%, #1d3b30 45%, #2a7a5f 100%);
  border-bottom: 1px solid #163026;
  animation: slideDown 0.6s ease-out both;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  gap: 20px;
  flex-wrap: wrap;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.maintenance-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: linear-gradient(135deg, rgba(26, 108, 79, 0.08), rgba(26, 108, 79, 0.2));
}

.maintenance-card {
  width: min(520px, 100%);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 32px 24px;
  text-align: center;
}

.maintenance-card h1 {
  margin: 16px 0 8px;
  font-size: 1.6rem;
  color: #0b231a;
}

.maintenance-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.maintenance-hero {
  display: flex;
  justify-content: center;
  margin: 0 auto 12px;
}

.loader {
  width: 56px;
  padding: 8px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #1a6c4f;
  --_m: conic-gradient(#0000 10%, #000),
    linear-gradient(#000 0 0) content-box;
  -webkit-mask: var(--_m);
  mask: var(--_m);
  -webkit-mask-composite: source-out;
  mask-composite: subtract;
  animation: l3 1s infinite linear;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #ffffff;
  border-radius: 999px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-logo {
  display: block;
  object-fit: contain;
}

.brand-logo-desktop {
  width: 84px;
  height: 84px;
}

.brand-logo-mobile {
  display: none;
  width: 56px;
  height: 56px;
}

.brand-kicker {
  margin: 0;
  color: #062117;
  font-size: 0.95rem;
}

.brand-name {
  margin: 4px 0 0;
  font-size: 1.7rem;
  letter-spacing: 0.4px;
  color: #0b231a;
}

.header-nav {
  display: flex;
  gap: 8px 12px;
  flex-wrap: wrap;
}

.header-nav a {
  flex: 0 1 auto;
  padding: 8px 10px;
  white-space: nowrap;
  text-decoration: none;
  color: #f1f5f3;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.header-nav a:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.main-content {
  padding-bottom: 60px;
  flex: 1;
}

.hero {
  background: linear-gradient(120deg, #ffffff 60%, var(--accent));
  padding: 50px 0 40px;
  animation: fadeUp 0.7s ease-out both;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -24px;
  height: 24px;
  background: linear-gradient(to bottom, rgba(247, 249, 250, 0), #f7f9fa);
  pointer-events: none;
}

.hero-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
  align-items: center;
}

.hero-kicker {
  color: var(--primary);
  margin: 0 0 10px;
  font-weight: 600;
}

.hero-kicker-highlight {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #c59b1a;
  font-weight: 700;
}

.hero-kicker-icon {
  font-size: 1rem;
  line-height: 1;
}

.hero-text {
  color: var(--muted);
  line-height: 1.8;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-card {
  background: #ffffff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  animation: floatIn 0.8s ease-out both;
}

.hero-card ul {
  margin: 16px 0 0;
  padding-right: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.section {
  padding: 40px 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.info-card {
  background: #ffffff;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(27, 44, 36, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.info-card p {
  color: var(--muted);
}

.alert-stop {
  border-color: #f0b9b9;
  background: #fff4f4;
  color: #8b1d1a;
}

.alert-stop h2,
.alert-stop p {
  color: #8b1d1a;
}

.stop-card {
  margin: 28px auto;
  max-width: 720px;
  text-align: center;
}

@media (max-width: 720px) {
  .stop-card {
    max-width: 100%;
    margin: 16px 0;
    padding: 18px 16px;
    text-align: center;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(139, 29, 26, 0.12);
  }

  .stop-card h2 {
    font-size: 1.2rem;
  }

  .stop-card p {
    font-size: 0.95rem;
    line-height: 1.8;
  }
}

.list-card {
  margin: 12px 0 0;
  padding-right: 18px;
  color: var(--muted);
  line-height: 1.9;
}

.contact-grid {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}

.map-embed {
  margin-top: 18px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(27, 44, 36, 0.08);
}

.map-embed iframe {
  width: 100%;
  height: 360px;
  border: 0;
  display: block;
}

.spacer-sm {
  height: 8px;
}

.spacer-md {
  height: 16px;
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(27, 44, 36, 0.08);
}

.muted {
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button.primary {
  background: var(--primary);
  color: #ffffff;
}

.button.primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.button.outline {
  border-color: var(--primary);
  color: var(--primary);
  background: #ffffff;
}

.button.outline:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

.button.small {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.button.is-saving {
  background: #1a6c4f !important;
  border-color: #1a6c4f !important;
  color: #ffffff !important;
  transform: none;
}

.status-result {
  margin-top: 14px;
  padding: 10px 14px;
  background: #e9f2ec;
  border: 1px solid #cfe0d6;
  border-radius: 10px;
  color: var(--primary-dark);
  font-weight: 600;
}

.status-result.status-مرفوض {
  background: #fde8e8;
  border-color: #f5c2c2;
  color: #b42318;
}

.status-result.status-مقبول {
  background: #e7f6ee;
  border-color: #bfe7d1;
  color: #1a6c4f;
}

.status-result.status-تحت-المراجعة {
  background: #fff7d6;
  border-color: #f1df9a;
  color: #9a6a00;
}

.button.full {
  width: 100%;
}

.form-wrapper {
  max-width: 800px;
}

.form-header h2 {
  margin-bottom: 8px;
}

.form-header p {
  color: var(--muted);
}

.form-header .warning {
  color: #a33a2a;
  font-weight: 600;
}

.form-card {
  background: #ffffff;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: fadeUp 0.6s ease-out both;
}

.with-top-margin {
  margin-top: 12px;
}

.prepare-attendance-card {
  margin-top: 12px;
}

.form-card .button {
  margin-top: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 600;
}

input,
select,
textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 16px;
}

.form-grid label {
  min-width: 0;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  max-width: 100%;
}

.name-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.name-link:hover {
  text-decoration: underline;
}

.cell-date .mobile-time {
  display: none;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.status-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  border-color: transparent;
}

.guards-table .status-button,
.companies-table .status-button {
  display: inline-flex !important;
}

.status-button.status-مرفوض {
  background: #fde8e8;
  color: #b42318;
}

.status-button.status-مقبول {
  background: #e7f6ee;
  color: #1a6c4f;
}

.status-button.status-تحت-المراجعة {
  background: #fff7d6;
  color: #9a6a00;
}

@media (max-width: 1024px) {
  .guards-table th:nth-child(5),
  .guards-table td:nth-child(5),
  .companies-table th:nth-child(5),
  .companies-table td:nth-child(5) {
    display: none;
  }

  .cell-date .mobile-time {
    display: block;
  }

  .status-button {
    font-size: 0.78rem;
  }

  .status-button.status-مرفوض,
  .status-button.status-مقبول,
  .status-button.status-تحت-المراجعة {
    color: inherit;
  }
}

@media (min-width: 769px) {
  .form-grid input,
  .form-grid select,
  .form-grid textarea {
    min-height: 44px;
  }

  .button {
    min-height: 44px;
  }

  .button.small {
    min-height: 36px;
  }

  .status-button {
    display: inline-flex;
  }
}

.full-row {
  grid-column: 1 / -1;
}

.flash {
  background: var(--accent);
  border: 1px solid #cfe0d6;
  color: var(--primary-dark);
  padding: 12px 16px;
  border-radius: 10px;
  margin: 20px auto;
  width: min(1100px, 92%);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.dashboard-section {
  margin-bottom: 30px;
}

.section-switch {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.section-button {
  min-width: 180px;
}

.admin-dashboard .section-switch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  column-gap: 12px;
  row-gap: 10px;
}

.admin-dashboard .section-switch .button,
.admin-dashboard .section-button {
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
  padding: 10px 12px;
  min-height: 44px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  background: #eef1f4;
  color: #1f2937;
  border: 1px solid #d5dbe2;
}

.admin-dashboard .section-switch .section-button.is-active,
.admin-dashboard .section-button.is-active {
  background: #17a34a;
  border-color: #13813b;
  color: #fff;
}

.admin-dashboard .section-switch .button:hover,
.admin-dashboard .section-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

.admin-dashboard .section-switch .button:active,
.admin-dashboard .section-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
}

.admin-dashboard .button.accent-blue,
.admin-dashboard .button.accent-green,
.admin-dashboard .button.accent-yellow,
.admin-dashboard .button.accent-orange,
.admin-dashboard .button.accent-purple,
.admin-dashboard .button.accent-black,
.admin-dashboard .button.accent-white,
.admin-dashboard .button.danger,
.admin-dashboard .button.outline {
  background: #f6f8f9;
  border: 1px solid #d7dee2;
  color: #1f2a30;
}

.admin-dashboard .button.accent-blue:hover,
.admin-dashboard .button.accent-green:hover,
.admin-dashboard .button.accent-yellow:hover,
.admin-dashboard .button.accent-orange:hover,
.admin-dashboard .button.accent-purple:hover,
.admin-dashboard .button.accent-black:hover,
.admin-dashboard .button.accent-white:hover,
.admin-dashboard .button.danger:hover,
.admin-dashboard .button.outline:hover {
  background: #eef2f4;
}

.admin-dashboard .button.logout-button {
  border-radius: 10px;
  background: rgba(127, 29, 29, 0.78);
  border-color: rgba(127, 29, 29, 0.9);
  color: #ffffff;
}

.admin-dashboard .header-subtitle {
  margin-bottom: 6px;
}

.admin-dashboard .header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  color: #5b6870;
  font-size: 0.95rem;
}

.admin-dashboard .header-meta .meta-item {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid #e2e8ec;
  border-radius: 10px;
  background: #ffffff;
}

.admin-dashboard .header-meta .meta-label {
  font-size: 0.85rem;
  color: #6b7780;
}

.admin-dashboard .header-meta .meta-value {
  font-weight: 600;
  color: #1f2a30;
}

.admin-dashboard .dashboard-actions {
  align-self: flex-start;
}

.admin-dashboard .header-action-button {
  padding: 8px 12px;
  min-height: 38px;
  font-size: 0.95rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.admin-dashboard .header-action-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

.admin-dashboard .header-action-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
}

.admin-dashboard .notes-button {
  background: rgba(183, 121, 31, 0.78);
  border-color: rgba(183, 121, 31, 0.9);
  color: #ffffff;
}

.admin-dashboard .notes-button:hover {
  background: rgba(183, 121, 31, 1);
  border-color: rgba(183, 121, 31, 1);
}

.admin-dashboard .section-switch-box {
  padding: 14px;
  border: 1px solid #e2e8ec;
  border-radius: 14px;
  background: #f7fafb;
}

.admin-dashboard .report-preview {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #e2e8ec;
  border-radius: 12px;
  background: #fbfcfd;
}

.admin-dashboard .reports-preview-area {
  margin-top: 18px;
}

.admin-dashboard .report-preview.report-preview-standalone {
  margin-top: 0;
}

.admin-dashboard .report-preview.report-preview-standalone + .report-preview-standalone {
  margin-top: 16px;
}

.admin-dashboard .report-preview-box {
  padding: 12px;
  border: 1px solid #d7dee2;
  border-radius: 10px;
  background: #ffffff;
}

.admin-dashboard .report-frame {
  width: 100%;
  min-height: 520px;
  border: 1px solid #d7dee2;
  border-radius: 10px;
  background: #ffffff;
}

.admin-dashboard .preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

@media (min-width: 900px) {
  .admin-dashboard .dashboard-header {
    padding: 18px 22px;
    border: 1px solid #e2e8ec;
    border-radius: 14px;
    background: #ffffff;
  }
}

.permissions-grid {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: #ffffff;
}

.permissions-grid .checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.permissions-grid .checkbox input:checked {
  accent-color: #2f855a;
}

.permissions-grid .checkbox:has(input:checked) {
  background: rgba(82, 190, 128, 0.2);
  border-color: rgba(46, 125, 87, 0.45);
}

.section-content {
  display: none;
}

.section-content.is-visible {
  display: block;
}

.table-wrapper {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  animation: fadeUp 0.6s ease-out both;
}

.details-row {
  display: none;
}

.details-row.is-open {
  display: table-row;
}


table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
}

.guards-table th:last-child,
.guards-table td:last-child {
  text-align: right;
}

.guards-table .details-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: auto;
}

th,
td {
  padding: 12px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  word-break: break-word;
}

.guards-table th,
.guards-table td {
  vertical-align: middle;
}


th {
  background: #f2f5f7;
}

.empty {
  text-align: center;
  color: var(--muted);
}

.details {
  max-width: 260px;
  white-space: pre-wrap;
}

.details-box summary {
  list-style: none;
}

.details-box summary::-webkit-details-marker {
  display: none;
}

.details-card {
  margin-top: 12px;
  background: #f8fbf9;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.details-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.profile-photo {
  margin: 12px 0;
  display: flex;
  justify-content: flex-start;
}

.profile-photo img {
  width: 180px;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.camera-box {
  margin: 16px 0;
  display: grid;
  gap: 12px;
}

.camera-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.camera-box video,
.camera-box img {
  width: 100%;
  max-height: 320px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #000;
  object-fit: cover;
}

.button-row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.button-row .button {
  flex: 1 1 auto;
}

.guard-details-actions {
  align-items: stretch;
}

.guard-details-actions > .button,
.guard-details-actions > form {
  flex: 0 0 150px;
}

.guard-details-actions > form .button {
  width: 100%;
}

.guard-details-actions > .button,
.guard-details-actions > form .button {
  min-height: 44px;
  padding: 10px 12px;
  font-size: clamp(0.75rem, 1.3vw, 0.9rem);
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .guard-details-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .guard-details-actions > .button,
  .guard-details-actions > form {
    flex: 0 0 auto;
  }

  .guard-details-actions > .button,
  .guard-details-actions > form .button {
    width: 130px;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.82rem;
    margin-inline: auto;
  }
}

.button-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.toggle-button {
  background: #1f6f4a;
  border-color: #1f6f4a;
  color: #ffffff;
}

.toggle-button.is-off {
  background: #d9534f;
  border-color: #d9534f;
  color: #ffffff;
}

.button.accent-green {
  background: #1f6f4a;
  border-color: #1f6f4a;
  color: #ffffff;
}

.button.accent-yellow {
  background: #e6c85a;
  border-color: #e6c85a;
  color: #1d2b1f;
}

.button.accent-red {
  background: #d9534f;
  border-color: #d9534f;
  color: #ffffff;
}

.button.logout-button {
  background: #7d1f1f;
  border-color: #7d1f1f;
  color: #ffffff;
}

.button.logout-button:hover {
  background: #631818;
  border-color: #631818;
  color: #ffffff;
}

.guard-details-actions .button {
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.guard-details-actions .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

.guard-details-actions .button:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
}

.guard-details-actions .button.accent-yellow {
  background: rgba(230, 200, 90, 0.88);
  border-color: rgba(230, 200, 90, 0.95);
  color: #1d2b1f;
}

.guard-details-actions .button.accent-yellow:hover {
  background: rgba(230, 200, 90, 1);
  border-color: rgba(230, 200, 90, 1);
}

.guard-details-actions .button.accent-red,
.guard-details-actions .button.danger {
  background: rgba(217, 83, 79, 0.88);
  border-color: rgba(217, 83, 79, 0.95);
  color: #ffffff;
}

.guard-details-actions .button.accent-red:hover,
.guard-details-actions .button.danger:hover {
  background: rgba(217, 83, 79, 1);
  border-color: rgba(217, 83, 79, 1);
}

.guard-details-actions .button.outline {
  background: rgba(31, 111, 74, 0.88);
  border-color: rgba(31, 111, 74, 0.95);
  color: #ffffff;
}

.guard-details-actions .button.outline:hover {
  background: rgba(31, 111, 74, 1);
  border-color: rgba(31, 111, 74, 1);
}

.button.permission-mini {
  padding: 6px 14px;
  min-width: auto;
  font-size: 0.85rem;
}

.button.pdf-mini {
  padding: 6px 12px;
  min-width: 0;
  font-size: 0.85rem;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(16, 24, 16, 0.55);
  padding: 24px 16px 16px;
  z-index: 99998;
}

.loading-overlay.is-visible {
  display: flex;
}

.loading-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px 22px;
  min-width: 240px;
  text-align: center;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e9edf2;
  overflow: hidden;
  margin: 12px 0 6px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: #2f855a;
  transition: width 0.2s ease;
}

.button.accent-blue {
  background: #2b6cb0;
  border-color: #2b6cb0;
  color: #ffffff;
}

.button.accent-white {
  background: #ffffff;
  border-color: #d3d7de;
  color: #1a202c;
}

.button.accent-white:hover {
  background: #f3f5f8;
  border-color: #c0c6cf;
}

.button.accent-orange {
  background: #dd6b20;
  border-color: #dd6b20;
  color: #ffffff;
}

.button.accent-purple {
  background: #6b46c1;
  border-color: #6b46c1;
  color: #ffffff;
}

.button.accent-black {
  background: #101010;
  border-color: #101010;
  color: #ffffff;
}

.button.danger {
  background: #d9534f;
  border-color: #d9534f;
  color: #ffffff;
}

.site-warning {
  margin-top: 8px;
  font-weight: 700;
  text-align: center;
  padding: 8px 10px;
  border-radius: 8px;
}

.site-warning.status-out {
  background: rgba(217, 83, 79, 0.18);
  color: #a52622;
  border: 1px solid rgba(217, 83, 79, 0.35);
}

.site-warning.status-warn {
  background: rgba(230, 200, 90, 0.28);
  color: #8a6d00;
  border: 1px solid rgba(230, 200, 90, 0.45);
}

.site-alert {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 17, 12, 0.45);
  z-index: 2000;
}

.site-alert.hidden {
  display: none;
}

.site-alert-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px 20px;
  max-width: 440px;
  width: 92%;
  text-align: center;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.site-alert-card p {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.6;
}

.site-alert.status-out .site-alert-card {
  border-color: rgba(217, 83, 79, 0.5);
}

.site-alert.status-warn .site-alert-card {
  border-color: rgba(230, 200, 90, 0.6);
}

.location-cell.status-out-cell {
  background: #f1aeb5;
  color: #1f2a2f;
  font-weight: 700;
}

.location-cell.status-warn-cell {
  background: #ffe08a;
  color: #1f2a2f;
  font-weight: 700;
}

.location-cell.status-ok-cell {
  background: #8fd4b8;
  color: #1f2a2f;
  font-weight: 700;
}

.location-cell.status-stale-cell {
  background: #9bbef5;
  color: #1f2a2f;
  font-weight: 700;
}

.summary-panel {
  display: none;
}

.summary-panel.is-open {
  display: block;
}

.attendance-type-cell.status-working-cell {
  background: #e0b85b;
  color: #1f2a2f;
  font-weight: 700;
}

.bot-meta {
  font-size: 16px;
  font-weight: 600;
  color: #1f2a2f;
}

.checkbox-wrapper-4 * {
  box-sizing: border-box;
}

.checkbox-wrapper-4 .cbx {
  user-select: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.2s ease;
  display: inline-block;
}

.checkbox-wrapper-4 .cbx:not(:last-child) {
  margin-right: 6px;
}

.checkbox-wrapper-4 .cbx:hover {
  background: rgba(0, 119, 255, 0.06);
}

.checkbox-wrapper-4 .cbx span {
  float: left;
  vertical-align: middle;
  transform: translate3d(0, 0, 0);
}

.checkbox-wrapper-4 .cbx span:first-child {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  transform: scale(1);
  border: 1px solid #cccfdb;
  transition: all 0.2s ease;
  box-shadow: 0 1px 1px rgba(0, 16, 75, 0.05);
}

.checkbox-wrapper-4 .cbx span:first-child svg {
  position: absolute;
  top: 3px;
  left: 2px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 16px;
  stroke-dashoffset: 16px;
  transition: all 0.3s ease;
  transition-delay: 0.1s;
  transform: translate3d(0, 0, 0);
}

.checkbox-wrapper-4 .cbx span:last-child {
  padding-left: 8px;
  line-height: 18px;
}

.checkbox-wrapper-4 .cbx:hover span:first-child {
  border-color: #07f;
}

.checkbox-wrapper-4 .inp-cbx {
  position: absolute;
  visibility: hidden;
}

.checkbox-wrapper-4 .inp-cbx:checked + .cbx span:first-child {
  background: #07f;
  border-color: #07f;
  animation: wave-4 0.4s ease;
}

.checkbox-wrapper-4 .inp-cbx:checked + .cbx span:first-child svg {
  stroke-dashoffset: 0;
}

.checkbox-wrapper-4 .inline-svg {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
  user-select: none;
}

.info-box {
  background: #f7f9fc;
  border: 1px solid #e0e6ef;
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.info-box .info-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
}

.info-box .info-value {
  font-size: 15px;
  font-weight: 600;
  color: #1f2a2f;
  word-break: break-word;
}

.info-box-wide {
  grid-column: span 2;
}

.bot-settings-grid > label,
.bot-settings-grid .checkbox-wrapper-4 {
  border: 1px solid #e0e6ef;
  border-radius: 10px;
  padding: 12px;
  background: #f9fbff;
}

.bot-settings-grid > label {
  display: block;
}

.bot-settings-grid .checkbox-wrapper-4 {
  display: inline-flex;
  align-items: center;
}

.site-monitor-sites {
  display: grid;
  gap: 10px;
}

.site-monitor-site-box {
  border: 1px solid #e0e6ef;
  border-radius: 10px;
  padding: 10px;
  background: #f9fbff;
}

.site-monitor-site-box select {
  width: 100%;
}

@media screen and (max-width: 640px) {
  .checkbox-wrapper-4 .cbx {
    width: 100%;
    display: inline-block;
  }
}

@keyframes wave-4 {
  50% {
    transform: scale(0.9);
  }
}

@media (max-width: 768px) {
  .container {
    width: min(1100px, 96%);
  }
  .city-working-cell {
    background: #e0b85b;
    color: #1f2a2f;
    font-weight: 700;
  }
  .button-row {
    flex-direction: column;
    gap: 8px;
  }

  .button-row .button {
    width: 100%;
  }

  .camera-row {
    grid-template-columns: 1fr;
  }

  .camera-box video,
  .camera-box img {
    max-height: 240px;
  }

  .photo-entry {
    grid-template-columns: 1fr;
  }

  .edit-button {
    display: none;
  }

  .mobile-edit-link {
    display: inline-flex;
  }

  .table-wrapper {
    border-radius: 10px;
  }

  table {
    font-size: 0.85rem;
    table-layout: auto;
  }

  th,
  td {
    padding: 6px 8px;
    line-height: 1.35;
  }

  .guard-manage-table th:last-child,
  .guard-manage-table td:last-child {
    display: none;
  }

  .review-table th:last-child,
  .review-table td:last-child,
  .review-table th:nth-child(6),
  .review-table td:nth-child(6) {
    display: none;
  }

  .review-table .review-details-cell {
    display: none;
  }

  .attendance-table th:nth-child(5),
  .attendance-table td:nth-child(5) {
    display: none;
  }

  .attendance-table th:nth-child(6),
  .attendance-table td:nth-child(6) {
    display: none;
  }

  .attendance-table {
    font-size: 0.78rem;
  }

  .attendance-table th,
  .attendance-table td {
    padding: 5px 6px;
    line-height: 1.3;
  }

  /* تقليل عرض عمود الموقع في جدول الجولات */
  .guard-attendance-table th:nth-child(3),
  .guard-attendance-table td:nth-child(3) {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* تحسينات جدول الجولات على الشاشات الصغيرة */
@media (max-width: 768px) {
  .guard-attendance-table {
    font-size: 0.75rem;
  }

  .guard-attendance-table th,
  .guard-attendance-table td {
    padding: 4px 5px;
    line-height: 1.2;
  }

  /* تقليل عرض عمود الموقع أكثر على الموبايل */
  .guard-attendance-table th:nth-child(3),
  .guard-attendance-table td:nth-child(3) {
    max-width: 100px;
    font-size: 0.7rem;
  }

  /* تقليل عرض عمود الوقت على الموبايل */
  .guard-attendance-table th:nth-child(2),
  .guard-attendance-table td:nth-child(2) {
    max-width: 120px;
    font-size: 0.7rem;
  }

  /* تحسين عرض عمود النوع */
  .guard-attendance-table th:nth-child(1),
  .guard-attendance-table td:nth-child(1) {
    max-width: 140px;
    font-size: 0.7rem;
  }

  /* تحسين أزرار عرض التفاصيل */
  .guard-attendance-table .button {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  .guard-attendance-table {
    font-size: 0.7rem;
  }

  .guard-attendance-table th,
  .guard-attendance-table td {
    padding: 3px 4px;
  }

  /* إخفاء عمود الوردية على الشاشات الصغيرة جداً */
  .guard-attendance-table th:nth-child(4),
  .guard-attendance-table td:nth-child(4) {
    display: none;
  }

  /* تقليل عرض الأعمدة أكثر */
  .guard-attendance-table th:nth-child(3),
  .guard-attendance-table td:nth-child(3) {
    max-width: 80px;
  }

  .guard-attendance-table th:nth-child(2),
  .guard-attendance-table td:nth-child(2) {
    max-width: 100px;
  }

  .guard-attendance-table th:nth-child(1),
  .guard-attendance-table td:nth-child(1) {
    max-width: 120px;
  }
}

@media (max-width: 1024px) {
  .review-table .review-details-cell,
  .review-table th:last-child,
  .review-table td:last-child,
  .review-table th:nth-child(6),
  .review-table td:nth-child(6) {
    display: none;
  }
}

@media (max-width: 1024px) {
  .sites-table .review-details-cell,
  .sites-table th:last-child,
  .sites-table td:last-child {
    display: table-cell;
  }
}

.mobile-edit-link {
  display: none;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

.cell-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.cell-primary {
  font-weight: 600;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.table-actions .inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.table-actions .inline-form:has(.table-action-input) {
  order: 1;
  flex-basis: 80%;
}

.table-actions .inline-form:has(.button.danger) {
  order: 1;
}

.table-actions .inline-form:has(.button:not(.danger)) {
  order: 1;
}

.table-action-input {
  width: 110px;
}

.auto-checkout-label {
  color: #c0392b;
  font-weight: 700;
}

.archive-search-form {
  margin-bottom: 12px;
}

.working-guard-proxy {
  background: #eef9f1;
}

.bot-meta-item {
  background: #f8fbf9;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bot-meta {
  margin-top: 12px;
}


@media (max-width: 720px) {
  .archive-table {
    font-size: 0.8rem;
  }

  .archive-table th,
  .archive-table td {
    padding: 6px 8px;
  }
}

.archive-table .details-row td {
  padding-top: 6px;
}

.archive-table .details-card {
  margin-top: 6px;
}

@media (max-width: 768px) {
  .name-text {
    display: none;
  }

  .mobile-edit-link {
    display: inline-flex;
  }
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-inline {
  align-items: flex-end;
  flex-wrap: nowrap;
}

.filter-inline label {
  display: flex;
  flex-direction: column;
}

.filter-box {
  display: inline-flex;
  justify-content: flex-end;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 10px;
  max-width: 420px;
  width: fit-content;
  margin-left: auto;
  box-shadow: 0 8px 18px rgba(27, 44, 36, 0.04);
}

.filter-box.wide {
  max-width: 100%;
  width: 100%;
  justify-content: flex-start;
}

.guard-search-box {
  max-width: 520px;
  width: 100%;
}

.guard-search-form label {
  flex: 1 1 360px;
  min-width: 0;
}

.guard-search-form input {
  width: 100%;
}

.guard-search-form .button {
  flex: 0 0 auto;
}

@media (min-width: 1024px) {
  .guard-search-box {
    max-width: 720px;
  }

  .guard-search-form label {
    flex-basis: 520px;
  }
}


@media (max-width: 720px) {
  .attendance-filter-box {
    padding: 6px 8px;
  }

  .attendance-filter-form {
    gap: 6px;
  }

  .attendance-filter-form label {
    font-size: 0.85rem;
  }

  .attendance-filter-form select,
  .attendance-filter-form input {
    height: 36px;
    font-size: 0.85rem;
  }

  .attendance-filter-form .button {
    padding: 8px 12px;
    font-size: 0.85rem;
    height: 36px;
  }
}

.filter-box.wide .filter-inline label {
  min-width: 160px;
}

.attendance-header {
  flex-wrap: wrap;
  gap: 12px 16px;
}

.attendance-header .attendance-filter {
  flex: 0 0 auto;
  width: fit-content;
}

@media (min-width: 1024px) {
  .attendance-header {
    align-items: flex-end;
  }

  .attendance-header > div:first-child {
    flex: 0 0 auto;
  }

  .attendance-header .attendance-filter {
    flex: 1 1 auto;
  }
}

@media (max-width: 900px) {
  .filter-inline {
    flex-wrap: wrap;
  }
  .filter-box {
    justify-content: stretch;
  }
}

.info-card.compact {
  padding: 14px;
  margin-top: 12px;
  background: #f7faf8;
}

.guard-assign-preview {
  margin-top: 8px;
  color: var(--muted);
}

.photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.photo-entry {
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: 8px;
  background: #f4f8f5;
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 10px;
  margin-top: 6px;
}

.photo-entry img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 22, 18, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 16px;
  z-index: 99999;
}

.modal-overlay.is-open {
  display: flex;
}

.modal-card {
  width: min(92vw, 520px);
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(17, 36, 28, 0.2);
  padding: 16px;
}

@media (max-width: 720px) {
  .modal-card {
    width: min(90vw, 380px);
    max-height: 70vh;
    overflow-y: auto;
  }
}

.modal-card .modal-close {
  display: block;
  width: 100%;
  margin-top: 30px;
  margin-bottom: 1px;
}

.notes-page .modal-card .modal-close {
  background: #c62828;
  border-color: #c62828;
  color: #ffffff;
}

.modal-card .button {
  margin-top: 8px;
}

.form-card .button + .button {
  margin-top: 10px;
}

.form-card .button-outline {
  margin-top: 10px;
}

.form-card .button.outline.small {
  margin-top: 10px;
}

.form-card label + .button.outline.small {
  margin-top: 12px;
}

.hidden {
  display: none;
}

.preview-photo {
  width: 100%;
  max-width: 240px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.info-grid {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.info-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.info-key {
  font-weight: 600;
  color: var(--primary-dark);
}

.info-value {
  color: var(--ink);
  word-break: break-word;
}

.alerts-table td {
  vertical-align: top;
}

.alerts-table .details-card {
  min-width: 260px;
  margin-left: auto;
  margin-right: 0;
}

.alerts-table .details-box {
  display: block;
}

.alerts-table .alerts-row td {
  vertical-align: middle;
  white-space: nowrap;
}

.alerts-table .alerts-row td:last-child {
  white-space: normal;
}

.alert-details-modal .modal-card {
  width: min(92vw, 680px);
}

@media (min-width: 1024px) {
  .alerts-table .details-card {
    min-width: 560px;
  }
}

.filter-form {
  margin: 20px 0;
}

.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.toggle-box {
  background: #f7faf9;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  min-height: 44px;
}

.toggle-box input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #b8c7bf;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #fff;
  transition: all 0.2s ease;
}

.toggle-box input[type="checkbox"]::after {
  content: "";
  width: 10px;
  height: 6px;
  border: 2px solid #ffffff;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.15s ease;
}

.toggle-box input[type="checkbox"]:checked {
  background: #1a6c4f;
  border-color: #1a6c4f;
  box-shadow: 0 0 0 3px rgba(26, 108, 79, 0.15);
}

.toggle-box input[type="checkbox"]:checked::after {
  transform: rotate(-45deg) scale(1);
}

.toggle-box:has(input[type="checkbox"]:checked) {
  background: #eef6f1;
  border-color: #1a6c4f;
}

.toggle-box input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(26, 108, 79, 0.25);
  outline-offset: 2px;
}

.admin-user-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 16px;
  background: #ffffff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.mini-chart {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin-top: 12px;
  background: conic-gradient(
    #1a6c4f 0% calc(var(--p1) * 1%),
    #9fcab6 calc(var(--p1) * 1%) 100%
  );
}

.mini-chart.three {
  background: conic-gradient(
    #1a6c4f 0% calc(var(--p1) * 1%),
    #f4c84a calc(var(--p1) * 1%) calc((var(--p1) + var(--p2)) * 1%),
    #d9534f calc((var(--p1) + var(--p2)) * 1%) 100%
  );
}

.mini-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.stats-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}

.stats-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #f8fbf9;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-inline: 4px;
}

.dot-guard {
  background: #1a6c4f;
}

.dot-company {
  background: #9fcab6;
}

.dot-accept {
  background: #1a6c4f;
}

.dot-review {
  background: #f4c84a;
}

.dot-reject {
  background: #d9534f;
}

.chart-wrapper {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.chart-row {
  display: grid;
  grid-template-columns: 140px 1fr 60px;
  gap: 12px;
  align-items: center;
}

@media (max-width: 900px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
  }

  .hero {
    padding: 36px 0 30px;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .button {
    flex: 1 1 160px;
  }

  .dashboard-header {
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .brand-logo-mobile {
    width: 10px;
    height: 10px;
  }

  .brand-name {
    font-size: 1.5rem;
  }

  .brand-kicker {
    font-size: 1rem;
  }

  .brand-block {
    gap: 10px;
  }

  .brand-logo-desktop {
    display: none;
  }

  .brand-logo-mobile {
    display: block;
  }

  .brand-kicker {
    color: #dfeee6;
  }

  .brand-name {
    color: #ffffff;
  }

  .brand-name {
    font-size: 1.4rem;
  }

  .header-nav {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .header-nav a {
    flex: 1 1 25%;
  }

  .hero-content {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .section-switch {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .section-button {
    flex: 1 1 180px;
  }

  .chart-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .chart-bar {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .header-nav {
    gap: 4px 8px;
    justify-content: flex-end;
  }

  .header-nav a {
    flex: 0 0 auto;
  }

  .section-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .section-switch .button,
  .section-button {
    min-width: 0;
    width: 100%;
    padding: 8px 10px;
    font-size: 0.85rem;
  }
}

@media (max-width: 400px) {
  .header-nav {
    justify-content: flex-end;
    gap: 6px 10px;
  }
}

@media (max-width: 360px) {
  .header-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, max-content));
    justify-content: end;
    column-gap: 8px;
    row-gap: 6px;
  }

  .header-nav a {
    flex: 0 0 auto;
  }

  .header-nav a:last-child {
    grid-column: 2;
  }
}

@media (max-width: 300px) {
  .header-nav {
    grid-template-columns: 1fr;
    justify-items: end;
  }

  .header-nav a {
    flex: 0 0 auto;
  }

  .section-switch {
    flex-direction: column;
  }

  .section-button {
    width: 100%;
  }
}
@media (max-width: 560px) {
  .container {
    width: 90%;
  }

  .hero-card {
    padding: 18px;
  }

  .info-card {
    padding: 16px;
  }

  .form-card {
    padding: 18px;
  }

  table {
    min-width: 0;
  }

  .details-card {
    padding: 10px;
  }

  html {
    font-size: 9px;
  }

  .button {
    padding: 8px 12px;
    border-radius: 10px;
  }

  input,
  select,
  textarea {
    padding: 6px 8px;
  }

  .form-grid {
    gap: 12px;
  }
}

@media (max-width: 400px) {
  html {
    font-size: 12.5px;
  }

  table {
    font-size: 0.8rem;
  }

  .button {
    padding: 7px 10px;
  }
}

@media (max-width: 720px) {
  .header-content {
    align-items: stretch;
  }

  .header-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    justify-content: end;
  }

  .header-nav a {
    width: 100%;
    text-align: center;
  }
}

.chart-bar {
  height: 10px;
  background: #e7f2ec;
  border-radius: 999px;
  overflow: hidden;
}

.chart-bar span {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}

.mono {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.85rem;
}

.status-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 999px;
  background: #e4efe9;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.9rem;
}

.status-مرفوض {
  background: #fde8e8;
  color: #b42318;
}

.status-مقبول {
  background: #e7f6ee;
  color: #1a6c4f;
}

.status-تحت-المراجعة {
  background: #fff7d6;
  color: #9a6a00;
}

.inline-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-inline {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: nowrap;
  width: 100%;
}

.filter-box.wide .filter-inline label,
.filter-box.wide .filter-inline .button {
  flex: 1 1 0;
  min-width: 0;
}

.filter-box.wide .filter-inline select,
.filter-box.wide .filter-inline input {
  width: 100%;
  height: 44px;
}

.filter-box.wide .filter-inline .button {
  height: 44px;
}

.inline-form.update-form {
  align-items: flex-start;
}

.inline-form.update-form label,
.inline-form.update-form .button {
  width: 100%;
  max-width: 360px;
  align-self: flex-start;
  text-align: right;
}

.inline-form.update-form + .action-stack .button.full {
  max-width: 360px;
}

.inline-form.update-form select,
.inline-form.update-form input {
  width: 100%;
}

.inline-form select,
.inline-form input {
  min-width: 160px;
}

.action-stack {
  margin-top: 10px;
}

.details-card p,
.details-card pre {
  word-break: break-word;
}

.info-value {
  word-break: break-word;
}

.site-chip.current {
  background: #8fd4b8;
  border-radius: 10px;
  padding: 6px 10px;
}

.site-chip.previous {
  background: #f1aeb5;
  border-radius: 10px;
  padding: 6px 10px;
}

.log-warn {
  background: #fcf8e3;
}

.log-critical {
  background: #f8d7da;
}

@media (max-width: 720px) {
  .inline-form select,
  .inline-form input {
    min-width: 0;
    width: 100%;
  }

  .guard-edit-content {
    max-height: 70vh;
    overflow-y: auto;
  }

  .log-white-table th,
  .log-white-table td {
    font-size: 0.85rem;
    padding: 8px 6px;
  }
}

.reason-details {
  margin: 12px 0 0;
}

.reason-details p {
  margin-top: 12px;
}

.reason-button {
  display: inline-flex;
  padding: 8px 14px;
  font-size: 0.85rem;
}

.site-footer {
  background: #0f1f18;
  color: #cbd5d1;
  padding: 30px 0;
  animation: fadeUp 0.6s ease-out both;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 21, 0.45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 16px;
  z-index: 99998;
}

.loading-overlay.is-visible {
  display: flex;
}

.loading-card {
  width: min(90vw, 420px);
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(17, 36, 28, 0.2);
  padding: 18px 20px;
  text-align: center;
}

.status-modal {
  position: fixed;
  inset: 0;
  background: rgba(14, 22, 18, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.status-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.status-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 14px 30px rgba(17, 36, 28, 0.25);
  min-width: 260px;
  max-width: 90vw;
}

.status-modal.is-success .status-card {
  border: 1px solid #b7e4c7;
  background: #f6fffa;
}

.status-modal.is-error .status-card {
  border: 1px solid #f3b7b7;
  background: #fff5f5;
}

.work-timer-card {
  margin: 16px 0;
  text-align: center;
}

.work-timer-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1f2a30;
  margin: 8px 0 4px;
  letter-spacing: 1px;
}

.notes-page .notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.notes-page .notes-card {
  margin-bottom: 18px;
}

.notes-page .notes-hub {
  display: grid;
  gap: 12px;
}

.notes-page .notes-hub .button {
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.notes-page .notes-hub .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

.notes-page .notes-hub .button:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
}

.notes-page .notes-hub .button.accent-blue {
  background: rgba(43, 108, 176, 0.78);
  border-color: rgba(43, 108, 176, 0.9);
}

.notes-page .notes-hub .button.accent-blue:hover {
  background: rgba(43, 108, 176, 1);
  border-color: rgba(43, 108, 176, 1);
}

.notes-page .notes-hub .button.accent-red {
  background: rgba(217, 83, 79, 0.78);
  border-color: rgba(217, 83, 79, 0.9);
}

.notes-page .notes-hub .button.accent-red:hover {
  background: rgba(217, 83, 79, 1);
  border-color: rgba(217, 83, 79, 1);
}

.notes-page .notes-subtitle {
  margin: 16px 0 10px;
}

.notes-page .notes-table td,
.notes-page .notes-table th {
  font-size: 0.92rem;
}

@media (max-width: 768px) {
  .notes-page .notes-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .notes-page .dashboard-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .notes-page .notes-card {
    padding: 14px;
  }

  .notes-page .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .notes-page .table-wrapper {
    overflow-x: auto;
  }
}

@media (max-width: 768px) {
  .notes-page .notes-table thead {
    display: none;
  }

  .notes-page .notes-table,
  .notes-page .notes-table tbody,
  .notes-page .notes-table tr,
  .notes-page .notes-table td {
    display: block;
    width: 100%;
  }

  .notes-page .notes-table tr {
    border: 1px solid #e6ece8;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 12px;
    background: #ffffff;
  }

  .notes-page .details-row,
  .notes-page .details-row.is-open {
    display: none !important;
  }

  .notes-page .details-row .details-card {
    display: none !important;
  }


  .notes-page .notes-table td {
    padding: 6px 4px;
  }

  .notes-page .notes-table td::before {
    content: attr(data-label);
    display: block;
    color: #6b7a74;
    font-size: 0.8rem;
    margin-bottom: 4px;
  }

  .notes-page .notes-table tr:not(.details-row) td:not([data-label="العنوان"]):not([data-label="الإجراءات"]) {
    display: none;
  }

  .notes-page .notes-table .button-row {
    gap: 8px;
  }
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 768px) {
  .dashboard-actions {
    width: 100%;
    flex-direction: column-reverse;
    align-items: stretch;
  }
}

.loading-bar {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1a6c4f, #9fcab6, #1a6c4f);
  background-size: 200% 100%;
  animation: loadingSlide 1.2s ease-in-out infinite;
  margin-bottom: 12px;
}

@keyframes loadingSlide {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  text-align: right;
}

.footer-grid > div {
  padding-left: 16px;
}

.footer-grid > div:not(:last-child) {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-grid p {
  margin: 6px 0;
}

.footer-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: #ffffff;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  color: #cbd5d1;
}

.footer-links a {
  color: #cbd5d1;
  text-decoration: none;
}

.footer-links a:hover {
  color: #ffffff;
}

.locations-inline {
  color: var(--muted);
}

.link-muted {
  color: var(--primary);
  text-decoration: none;
}

.link-muted:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.status-warn {
  color: #b07b00;
  margin-top: 6px;
}

.status-out {
  color: #b3332f;
  margin-top: 6px;
}

.review-action {
  margin-top: 10px;
}

.footer-grid div:first-child p:first-child {
  font-weight: 600;
}

@media (max-width: 640px) {
  .footer-grid {
    text-align: center;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid > div {
    padding-left: 0;
    border-left: none;
  }

  .footer-grid > div:not(:last-child) {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .footer-brand,
  .footer-help {
    grid-column: 1 / -1;
  }

  .footer-overview,
  .footer-support {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding-bottom: 12px;
    margin-bottom: 12px;
  }
}

@media (max-width: 720px) {
  .header-content {
    position: relative;
    padding-top: 24px;
    padding-bottom: 12px;
    align-items: center;
  }

  .menu-toggle {
    position: absolute;
    top: 20px;
    left: 12px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .brand-block {
    flex-direction: row;
    align-items: center;
    text-align: right;
    gap: 10px;
    justify-content: flex-start;
    margin-left: auto;
    margin-right: 12px;
  }

  .brand-text {
    align-items: flex-start;
    flex: 1 1 auto;
    min-width: 0;
  }

  .brand-kicker,
  .brand-name {
    max-width: 440px;
    line-height: 1.4;
  }

  .brand-kicker {
    font-size: 0.85rem;
  }

  .brand-name {
    font-size: 1.25rem;
  }
  .brand-logo-mobile {
    width: 120px;
    height: 120px;
  }

  .header-nav {
    display: none;
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
  }

  .header-nav.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .header-nav.is-open a {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .brand-block {
    margin-left: auto;
    margin-right: 12px;
    gap: 8px;
    justify-content: flex-start;
    text-align: right;
  }

  .brand-text {
    max-width: 100%;
    align-items: flex-start;
  }

  .brand-kicker {
    font-size: 0.78rem;
  }

  .brand-name {
    font-size: 1.1rem;
  }

  .brand-logo-mobile {
    width: 88px;
    height: 88px;
  }

  .header-content {
    padding-top: 32px;
    padding-bottom: 30px;
  }

  .menu-toggle {
    top: 100px;
    left: 16px;
  }
}

@keyframes l3 {
  to {
    transform: rotate(1turn);
  }
}

/* Hide scrollbar */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
}
