/* ============================================================
   Yvora · PPWR Compliance — Design System CSS
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --navy:        #1B3A5C;
  --navy-light:  #2a4f7a;
  --navy-dark:   #122740;
  --green:       #2D5F4A;
  --green-light: #3a7a60;
  --green-dark:  #1f4434;
  --yellow:      #E8B847;
  --yellow-light:#f0cb6e;
  --yellow-dark: #c99a2e;
  --cream:       #F7F3EB;
  --cream-dark:  #ede7da;
  --white:       #ffffff;
  --gray-50:     #f9fafb;
  --gray-100:    #f3f4f6;
  --gray-200:    #e5e7eb;
  --gray-300:    #d1d5db;
  --gray-400:    #9ca3af;
  --gray-500:    #6b7280;
  --gray-600:    #4b5563;
  --gray-700:    #374151;
  --gray-800:    #1f2937;
  --gray-900:    #111827;
  --red:         #dc2626;
  --red-light:   #fee2e2;
  --orange:      #ea580c;
  --orange-light:#ffedd5;
  --blue:        #2563eb;
  --blue-light:  #dbeafe;
  --sidebar-w:   220px;
  --topbar-h:    56px;
  --radius:      8px;
  --radius-sm:   4px;
  --radius-lg:   12px;
  --shadow:      0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:   0 10px 25px rgba(0,0,0,.12), 0 4px 10px rgba(0,0,0,.08);
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition:  all .18s ease;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font); }

/* ── App Shell ─────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .02em;
}

.sidebar-logo-sub {
  font-size: .65rem;
  color: var(--yellow);
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-section-label {
  font-size: .65rem;
  font-weight: 600;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 14px 18px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: rgba(255,255,255,.72);
  font-size: .875rem;
  font-weight: 500;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
  cursor: pointer;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: var(--white);
  text-decoration: none;
  border-left-color: rgba(255,255,255,.2);
}

.nav-item.active {
  background: var(--green);
  color: var(--white);
  border-left-color: var(--yellow);
}

.nav-item .nav-icon {
  width: 18px;
  text-align: center;
  font-size: .95rem;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: .68rem;
  color: rgba(255,255,255,.45);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.5);
  font-size: .78rem;
  padding: 5px 0;
  transition: var(--transition);
  text-decoration: none;
}
.sidebar-logout:hover { color: #fff; text-decoration: none; }

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 12px;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gray-400);
  font-size: .8rem;
}

.topbar-breadcrumb .bc-sep { color: var(--gray-300); }
.topbar-breadcrumb .bc-current { color: var(--gray-600); font-weight: 500; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.topbar-company {
  font-size: .78rem;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 4px 10px;
  border-radius: var(--radius);
}

/* ── Page Body ─────────────────────────────────────────────── */
.page-body {
  flex: 1;
  padding: 24px;
}

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

.page-header-left { display: flex; flex-direction: column; gap: 3px; }
.page-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-800);
}
.page-subtitle { font-size: .83rem; color: var(--gray-500); }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
}

.card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--gray-800);
}

.card-subtitle { font-size: .78rem; color: var(--gray-500); margin-top: 2px; }

/* ── KPI Cards ─────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: var(--transition);
}

.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.kpi-icon.green  { background: #dcfce7; color: var(--green); }
.kpi-icon.red    { background: var(--red-light); color: var(--red); }
.kpi-icon.orange { background: var(--orange-light); color: var(--orange); }
.kpi-icon.blue   { background: var(--blue-light); color: var(--blue); }
.kpi-icon.yellow { background: #fef9c3; color: #854d0e; }
.kpi-icon.navy   { background: #dbeafe; color: var(--navy); }

.kpi-info { flex: 1; }
.kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.1;
}
.kpi-label { font-size: .75rem; color: var(--gray-500); margin-top: 2px; }

/* ── Stat Button Filters ───────────────────────────────────── */
.stat-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.stat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: var(--transition);
}

.stat-btn:hover { border-color: var(--green); color: var(--green); }
.stat-btn.active { border-color: var(--green); background: var(--green); color: #fff; }

.stat-btn .sb-count {
  background: rgba(0,0,0,.1);
  border-radius: 10px;
  padding: 1px 6px;
  font-weight: 700;
  font-size: .75rem;
}
.stat-btn.active .sb-count { background: rgba(255,255,255,.25); }

/* ── Data Table ────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: .83rem;
}

.data-table th {
  background: var(--gray-50);
  padding: 10px 12px;
  text-align: left;
  font-size: .72rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }

.td-code { font-family: monospace; font-weight: 600; color: var(--navy); font-size: .8rem; }
.td-name { font-weight: 500; color: var(--gray-800); }
.td-muted { color: var(--gray-400); font-size: .78rem; }
.td-actions { white-space: nowrap; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Risk Badges */
.badge-risk-ok       { background: #dcfce7; color: #166534; }
.badge-risk-medium   { background: #fef9c3; color: #854d0e; }
.badge-risk-high     { background: var(--orange-light); color: #9a3412; }
.badge-risk-critical { background: var(--red-light); color: #991b1b; }

/* Grade Badges */
.badge-grade-A { background: #dcfce7; color: #166534; }
.badge-grade-B { background: var(--blue-light); color: #1e40af; }
.badge-grade-C { background: #fef9c3; color: #854d0e; }
.badge-grade-D { background: var(--red-light); color: #991b1b; }

/* Doc Status Badges */
.badge-doc-missing  { background: var(--red-light); color: #991b1b; }
.badge-doc-partial  { background: #fef9c3; color: #854d0e; }
.badge-doc-complete { background: #dcfce7; color: #166534; }

/* EPR Status Badges */
.badge-epr-active   { background: #dcfce7; color: #166534; }
.badge-epr-pending  { background: #fef9c3; color: #854d0e; }
.badge-epr-missing  { background: var(--red-light); color: #991b1b; }
.badge-epr-expired  { background: var(--gray-200); color: var(--gray-600); }

/* Declaration Status Badges */
.badge-decl-valid   { background: #dcfce7; color: #166534; }
.badge-decl-draft   { background: var(--blue-light); color: #1e40af; }
.badge-decl-expired { background: var(--gray-200); color: var(--gray-600); }

/* Generic */
.badge-secondary { background: var(--gray-200); color: var(--gray-600); }
.badge-warning   { background: #fef9c3; color: #854d0e; }
.badge-info      { background: var(--blue-light); color: #1e40af; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}
.btn-primary:hover { background: var(--green-light); border-color: var(--green-light); color: #fff; text-decoration: none; }

.btn-secondary {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn-secondary:hover { background: var(--navy-light); border-color: var(--navy-light); color: #fff; text-decoration: none; }

.btn-outline {
  background: transparent;
  color: var(--green);
  border-color: var(--green);
}
.btn-outline:hover { background: var(--green); color: #fff; text-decoration: none; }

.btn-outline-navy {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline-navy:hover { background: var(--navy); color: #fff; text-decoration: none; }

.btn-danger {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border-color: var(--gray-200);
}
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); text-decoration: none; }

.btn-sm { padding: 5px 10px; font-size: .75rem; }
.btn-xs { padding: 3px 7px; font-size: .7rem; }
.btn-lg { padding: 10px 22px; font-size: .9rem; }

.btn:disabled, .btn.disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 5px;
}
.form-label .req { color: var(--red); margin-left: 2px; }
.form-hint { font-size: .72rem; color: var(--gray-500); margin-top: 3px; }

.form-control {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: .83rem;
  font-family: var(--font);
  color: var(--gray-800);
  background: var(--white);
  transition: var(--transition);
  line-height: 1.4;
}

.form-control:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(45,95,74,.12);
}

.form-control.is-invalid { border-color: var(--red); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.12); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 70px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: .83rem;
  color: var(--gray-700);
}
.form-check input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--green); }

/* ── Filter Bar ────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-bar .form-control {
  width: auto;
  min-width: 140px;
}

.search-input {
  min-width: 220px;
  padding-left: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}

/* ── Modals ────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 30px 16px;
  overflow-y: auto;
}

.modal-overlay.active { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 720px;
  margin: auto;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

.modal-box.modal-lg { max-width: 860px; }
.modal-box.modal-sm { max-width: 480px; }

.modal-header {
  background: var(--navy);
  color: var(--white);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-shrink: 0;
}

.modal-title { font-size: .95rem; font-weight: 700; }
.modal-subtitle { font-size: .72rem; color: rgba(255,255,255,.6); margin-top: 2px; }

.modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  font-size: 1.3rem;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,.1); color: #fff; }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-shrink: 0;
}

/* Modal Sections */
.modal-section {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}

.modal-section-header {
  background: var(--gray-50);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.modal-section-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-section-title { font-size: .83rem; font-weight: 600; color: var(--gray-800); flex: 1; }

.modal-section-badge {
  font-size: .65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}
.msb-complete { background: #dcfce7; color: #166534; }
.msb-partial  { background: #fef9c3; color: #854d0e; }
.msb-empty    { background: var(--gray-200); color: var(--gray-500); }

.modal-section-body { padding: 14px; }

/* Progress bar in modal */
.modal-progress { padding: 0 20px 12px; }
.modal-progress-bar {
  height: 4px;
  background: rgba(255,255,255,.2);
  border-radius: 2px;
  overflow: hidden;
}
.modal-progress-fill {
  height: 100%;
  background: var(--yellow);
  border-radius: 2px;
  transition: width .3s ease;
}
.modal-progress-label {
  font-size: .68rem;
  color: rgba(255,255,255,.6);
  margin-top: 4px;
  text-align: right;
}

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: .83rem;
}

.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: var(--red-light); color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.alert-info    { background: var(--blue-light); color: #1e40af; border: 1px solid #bfdbfe; }

.alert-icon { font-weight: 700; flex-shrink: 0; }
.alert-msg  { flex: 1; }
.alert-close { background: none; border: none; color: inherit; opacity: .6; cursor: pointer; font-size: 1.1rem; margin-left: auto; }
.alert-close:hover { opacity: 1; }

/* Info Box */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--blue-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.info-box-icon { color: var(--blue); font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.info-box p { font-size: .8rem; color: #1e40af; line-height: 1.5; }
.info-box strong { font-weight: 600; }

.warning-box {
  background: #fef9c3;
  border: 1px solid #fde68a;
}
.warning-box .info-box-icon { color: #d97706; }
.warning-box p { color: #854d0e; }

/* ── Progress Bars ─────────────────────────────────────────── */
.progress {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}

.progress-bar.green  { background: var(--green); }
.progress-bar.yellow { background: var(--yellow); }
.progress-bar.red    { background: var(--red); }
.progress-bar.blue   { background: var(--blue); }
.progress-bar.orange { background: var(--orange); }

.progress-lg { height: 12px; }
.progress-sm { height: 5px; }

/* RC Progress Row */
.rc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: .8rem;
}
.rc-row-label { width: 100px; font-weight: 500; color: var(--gray-700); flex-shrink: 0; }
.rc-row-bar   { flex: 1; }
.rc-row-pct   { width: 50px; text-align: right; font-weight: 600; color: var(--gray-800); }
.rc-row-target { width: 65px; font-size: .72rem; color: var(--gray-400); }

/* ── Pagination ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  font-size: .78rem;
  color: var(--gray-500);
}

.pagination-pages { display: flex; gap: 4px; }
.pg-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--white);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: var(--transition);
}
.pg-btn:hover  { border-color: var(--green); color: var(--green); }
.pg-btn.active { background: var(--green); color: #fff; border-color: var(--green); }
.pg-btn.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* ── Toast Notifications ───────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 11px 16px;
  font-size: .83rem;
  min-width: 260px;
  max-width: 380px;
  animation: toastIn .25s ease;
  border-left: 4px solid var(--gray-300);
}

.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--yellow); }
.toast.info    { border-left-color: var(--blue); }

.toast-icon { font-size: .95rem; flex-shrink: 0; }
.toast-msg  { flex: 1; color: var(--gray-800); }
.toast-close { color: var(--gray-400); cursor: pointer; font-size: 1rem; line-height: 1; border: none; background: none; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Auth Pages ────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, var(--green) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 36px;
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo-text {
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.01em;
}

.auth-logo-sub {
  font-size: .72rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 2px;
}

.auth-title { font-size: 1.1rem; font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.auth-sub   { font-size: .82rem; color: var(--gray-500); margin-bottom: 20px; }
.auth-hint  { font-size: .75rem; color: var(--gray-400); text-align: center; margin-top: 14px; background: var(--gray-50); padding: 8px 12px; border-radius: var(--radius); }

.auth-footer {
  text-align: center;
  margin-top: 18px;
  font-size: .8rem;
  color: var(--gray-500);
}
.auth-footer a { color: var(--green); font-weight: 600; }

/* ── Reports ───────────────────────────────────────────────── */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.report-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.report-card:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.report-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.report-card-title { font-size: .9rem; font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.report-card-desc  { font-size: .78rem; color: var(--gray-500); line-height: 1.5; }

.report-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  margin-top: 10px;
}

/* ── Settings Tabs ─────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 9px 18px;
  font-size: .83rem;
  font-weight: 500;
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: -2px;
}

.tab-btn:hover  { color: var(--gray-800); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); font-weight: 700; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Dashboard Specifics ───────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-top: 20px;
}

.compliance-score-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0% var(--score-pct, 72%), var(--gray-200) var(--score-pct, 72%) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 auto 10px;
}

.score-inner {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.score-num { font-size: 1.3rem; font-weight: 800; color: var(--gray-800); }
.score-pct { font-size: .65rem; color: var(--gray-400); }

.deadline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
}
.deadline-item:last-child { border-bottom: none; }
.deadline-days {
  min-width: 52px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
}
.deadline-days.safe  { color: var(--green); }
.deadline-days.warn  { color: var(--orange); }
.deadline-days small { display: block; font-size: .6rem; font-weight: 500; color: var(--gray-400); }
.deadline-info p   { font-size: .8rem; font-weight: 600; color: var(--gray-800); }
.deadline-info span { font-size: .72rem; color: var(--gray-500); }

/* Quick Links */
.quick-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  padding: 11px 14px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--gray-700);
  font-size: .82rem;
  font-weight: 500;
}
.quick-link:hover { background: var(--navy); color: #fff; text-decoration: none; }
.quick-link .ql-icon { font-size: 1rem; }

/* Risk Distribution Chart (simple bars) */
.risk-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 80px;
  margin: 10px 0;
}

.risk-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.risk-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height .4s ease;
}
.risk-bar.ok       { background: var(--green); }
.risk-bar.medium   { background: var(--yellow); }
.risk-bar.high     { background: var(--orange); }
.risk-bar.critical { background: var(--red); }
.risk-bar-label { font-size: .65rem; color: var(--gray-400); }
.risk-bar-val   { font-size: .72rem; font-weight: 700; color: var(--gray-700); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .report-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .filter-bar .form-control { width: 100%; }
}

/* ── Utility ───────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-400); font-size: .78rem; }
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.flex-1 { flex: 1; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-sm  { font-size: .78rem; }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-navy  { color: var(--navy); }

/* empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-400);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 10px; }
.empty-state p { font-size: .85rem; }

/* Donut SVG score */
.score-donut { display: block; margin: 0 auto; }
