:root {
  --bg-1: #eef8f6;
  --bg-2: #fff8ee;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --ink: #0f172a;
  --muted: #5a6475;
  --main: #0f766e;
  --main-600: #0b5f59;
  --main-700: #0a4d48;
  --accent: #f97316;
  --border: #d8e3ea;
  --ring: rgba(15, 118, 110, 0.18);
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: "Cairo", sans-serif;
  color: var(--ink);
  background: linear-gradient(145deg, var(--bg-1), var(--bg-2));
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

.hero-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(15, 118, 110, 0.11), transparent 30%),
    radial-gradient(circle at 84% 72%, rgba(249, 115, 22, 0.11), transparent 30%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0));
}

.main-nav {
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.navbar-brand {
  color: var(--main) !important;
  letter-spacing: 0.2px;
}

.nav-link {
  color: var(--ink) !important;
  font-weight: 700;
  border-radius: 10px;
  padding: 0.38rem 0.75rem !important;
  transition: all 0.18s ease;
}

.nav-link.active,
.nav-link:hover {
  background: rgba(15, 118, 110, 0.12);
  color: var(--main) !important;
}

.page-wrap {
  position: relative;
  z-index: 1;
}

.page-head {
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.page-head-title {
  margin: 0;
  font-size: clamp(1.05rem, 2.1vw, 1.45rem);
  font-weight: 800;
  color: #134e4a;
}

.page-head-desc {
  color: var(--muted);
  font-size: 0.92rem;
}

.page-head-actions {
  display: flex;
  gap: 0.5rem;
}

.quick-action-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(216, 227, 234, 0.85);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
  overflow-x: auto;
}

.quick-action-title,
.quick-action-bar a {
  white-space: nowrap;
}

.quick-action-title {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 800;
}

.quick-action-bar a {
  padding: 0.35rem 0.7rem;
  color: var(--main-700);
  text-decoration: none;
  background: #fff;
  border: 1px solid #dce8e7;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
}

.quick-action-bar a:hover,
.quick-action-bar a:focus {
  color: #fff;
  background: var(--main);
  border-color: var(--main);
}

.panel-card,
.metric-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.panel-card::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 14px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.8), rgba(249, 115, 22, 0.62));
}

.metric-card {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
}

.metric-label {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
}

.metric-value {
  font-size: clamp(1.2rem, 2.3vw, 1.68rem);
  font-weight: 800;
  line-height: 1.2;
}

.panel-title {
  font-weight: 800;
  margin-bottom: 0.85rem;
  color: #134e4a;
}

.quick-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-muted);
  border: 1px solid #e8eef3;
  border-radius: 12px;
  padding: 0.62rem 0.8rem;
  margin-bottom: 0.5rem;
}

.quick-metric strong {
  color: #0f172a;
}

.workflow-panel {
  overflow: hidden;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.workflow-step {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 142px;
  padding: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(145deg, #ffffff, #f8fcfb);
  border: 1px solid #dbe8e4;
  border-radius: 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.workflow-step:hover,
.workflow-step:focus {
  color: var(--ink);
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.11);
  transform: translateY(-2px);
}

.workflow-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: #fff;
  background: var(--main);
  border-radius: 999px;
  font-weight: 800;
}

.workflow-step strong {
  color: #134e4a;
  font-size: 0.96rem;
}

.workflow-step small {
  color: var(--muted);
  line-height: 1.7;
}

.form-step-title {
  margin-top: 0.25rem;
  padding: 0.4rem 0.65rem;
  color: #134e4a;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.13);
  border-radius: 10px;
  font-weight: 800;
}

.form-hint,
.simple-note {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

.simple-note {
  padding: 0.55rem 0.7rem;
  background: #fff8ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
}

.report-help {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem;
  color: #475569;
  background: #f8fbfd;
  border: 1px solid #e6edf2;
  border-radius: 12px;
  font-size: 0.88rem;
}

.btn {
  font-weight: 700;
  border-radius: 10px;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

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

.btn-main {
  background: var(--main);
  border-color: var(--main);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
}

.btn-main:hover,
.btn-main:focus {
  background: var(--main-600);
  border-color: var(--main-600);
  color: #fff;
}

.btn-outline-main {
  border-color: var(--main);
  color: var(--main);
}

.btn-outline-main:hover,
.btn-outline-main:focus {
  background: rgba(15, 118, 110, 0.12);
  color: var(--main-700);
  border-color: var(--main-700);
}

.form-label {
  color: #334155;
  font-weight: 700;
  font-size: 0.88rem;
}

.form-control,
.form-select {
  border-radius: 10px;
  border-color: #cfd9e0;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.form-control::placeholder {
  color: #8a96a8;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(15, 118, 110, 0.54);
  box-shadow: 0 0 0 0.22rem var(--ring);
}

.alert {
  border-radius: 12px;
  border-width: 1px;
}

.table-responsive {
  border: 1px solid #e6edf2;
  border-radius: 12px;
  overflow: auto;
}

.table {
  margin-bottom: 0;
  min-width: 640px;
  background: #fff;
}

.table > :not(caption) > * > * {
  border-bottom-color: #edf2f7;
  vertical-align: middle;
  padding: 0.62rem 0.7rem;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #334155;
  font-weight: 800;
  background: #f8fbfd;
  white-space: nowrap;
}

.table tbody tr:nth-child(odd) {
  background: rgba(248, 250, 252, 0.45);
}

.table-hover tbody tr:hover {
  background: rgba(15, 118, 110, 0.07);
}

.badge {
  font-weight: 700;
}

.print-table-wrap {
  overflow: auto;
}

.app-footer {
  position: relative;
  z-index: 1;
  margin: 1rem auto 1.5rem;
  padding: 0.9rem 1rem;
  max-width: 1320px;
  color: #64748b;
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.8;
}

.auth-card {
  margin-top: 6vh;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  padding: 0.28rem 0.62rem;
  background: rgba(15, 118, 110, 0.1);
  color: var(--main-700);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.reveal-in {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.reveal-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

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

  .main-nav .d-flex.align-items-center {
    margin-top: 0.45rem;
  }

  .panel-card,
  .metric-card {
    border-radius: 14px;
    padding: 0.88rem;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 0.95rem;
  }

  .workflow-steps {
    grid-template-columns: 1fr;
  }

  .table {
    min-width: 560px;
  }
}

@media print {
  .main-nav,
  .no-print,
  .btn,
  form,
  .app-footer,
  .page-head {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .panel-card,
  .metric-card {
    box-shadow: none;
    border-color: #b8c3ce;
  }

  .panel-card::before {
    display: none;
  }

  .print-panel {
    padding: 0;
    border: 0;
  }
}
