:root {
  --bg: #f6f2ea;
  --bg-alt: #eaf3f6;
  --surface: #ffffff;
  --surface-alt: #fdf9f3;
  --primary: #0b7285;
  --primary-dark: #0a4d62;
  --accent: #e07a5f;
  --accent-soft: #f2c14e;
  --text: #1f2937;
  --muted: #6b7280;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Cairo", sans-serif;
  color: var(--text);
  background: linear-gradient(120deg, var(--bg), var(--bg-alt));
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 15%, rgba(11, 114, 133, 0.14), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(224, 122, 95, 0.18), transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(242, 193, 78, 0.2), transparent 50%);
  z-index: -1;
}

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

.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(165deg, var(--primary), var(--primary-dark));
  color: #f8fafc;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 20px;
}

.brand-title {
  font-weight: 700;
  font-size: 18px;
}

.brand-subtitle {
  font-size: 12px;
  color: rgba(248, 250, 252, 0.7);
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #f1fbff;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.menu-item i {
  width: 20px;
  text-align: center;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateX(4px);
  box-shadow: 0 12px 24px rgba(3, 29, 36, 0.25);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  font-size: 13px;
  line-height: 1.6;
}

.footer-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  margin-bottom: 10px;
  font-size: 12px;
}

.content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.page-title {
  font-size: 20px;
  font-weight: 700;
}

.page-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  font-size: 12px;
  color: var(--muted);
}

.pill.accent {
  background: rgba(224, 122, 95, 0.15);
  color: #9a3f2a;
}

.nav-toggle {
  display: none;
  border: none;
  background: rgba(15, 23, 42, 0.06);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
}

.main {
  padding: 28px;
  flex: 1;
}

.footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px 28px;
  color: var(--muted);
  font-size: 12px;
}

.footer-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  margin-bottom: 28px;
}

.hero.hero-single {
  grid-template-columns: 1fr;
}

.hero-text h1 {
  font-size: 32px;
  margin: 12px 0;
}

.hero-text p {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 18px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(11, 114, 133, 0.12);
  color: var(--primary-dark);
  font-size: 12px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-card {
  background: var(--surface);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-card-header h3 {
  margin: 0 0 4px;
}

.hero-card-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(242, 193, 78, 0.3);
  color: #8a5f07;
  font-size: 12px;
}

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

.mini-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px dashed rgba(148, 163, 184, 0.4);
  font-size: 13px;
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mini-tile i {
  font-size: 18px;
  color: var(--primary);
}

.mini-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.nav-card {
  display: flex;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 50px rgba(15, 23, 42, 0.16);
}

.nav-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(11, 114, 133, 0.12);
  display: grid;
  place-items: center;
  color: var(--primary);
  font-size: 18px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.header-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(11, 114, 133, 0.12);
  color: var(--primary-dark);
  font-size: 12px;
}

.form-card {
  background: var(--surface);
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-weight: 600;
}

.input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 114, 133, 0.15);
  outline: none;
}

.field-error {
  color: #b42318;
  font-size: 12px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

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

.input-row .input {
  flex: 1;
}

.btn-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: #fff;
  color: var(--primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.btn-icon.ghost {
  background: rgba(15, 23, 42, 0.08);
  border: none;
  color: var(--muted);
}

.btn-icon.disabled,
.btn-icon:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
  transform: none;
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
}

.field-hint.warning {
  color: #92400e;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(11, 114, 133, 0.3);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 999px;
  padding: 10px 20px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: 13px;
}

.alert.success {
  background: rgba(34, 197, 94, 0.15);
  color: #166534;
}

.field-checkbox {
  align-self: end;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(11, 114, 133, 0.6);
  position: relative;
  display: inline-block;
  transition: background 0.2s ease, border 0.2s ease;
}

.checkbox input:checked + .checkbox-box {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox input:checked + .checkbox-box::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
  top: 4px;
  left: 4px;
}

.checkbox-text {
  font-size: 14px;
}

.overlay {
  display: none;
}

.scan-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
}

.scan-modal.open {
  display: flex;
}

.scan-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  width: min(560px, 100%);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.scan-header h3 {
  margin: 0 0 6px;
}

.scan-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.scan-viewport {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0f172a;
  aspect-ratio: 4 / 3;
}

.scan-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-frame {
  position: absolute;
  inset: 14%;
  border: 2px dashed rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  box-shadow: 0 0 0 2000px rgba(15, 23, 42, 0.2) inset;
  pointer-events: none;
}

.scan-actions {
  display: flex;
  justify-content: flex-end;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 0 0 auto;
    width: 280px;
    transform: translateX(110%);
    transition: transform 0.3s ease;
    z-index: 30;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .overlay {
    display: none;
  }

  body.nav-open .overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 20;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

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

@media (max-width: 640px) {
  .topbar {
    padding: 16px;
  }

  .main {
    padding: 16px;
  }

  .footer {
    padding: 12px 16px 20px;
  }
}

.alert.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #92400e;
}

