@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600&display=swap');

:root {
  --bg: #15120f;
  --bg-2: #1a1511;
  --panel: #211a16;
  --panel-2: #261f1a;
  --border: #302822;
  --text: #f1e9df;
  --muted: #b8aa9b;
  --heading: #f1e9df;
  --sidebar-text: #f1e9df;
  --accent: #c48a4a;
  --accent-2: #8f6b3f;
  --success: #7cc28a;
  --danger: #e07a7a;
  --checkbox-accent: #4aa3e2;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 14px;
}

* { box-sizing: border-box; }
input[type="checkbox"] { accent-color: var(--checkbox-accent); }

body {
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  background: radial-gradient(1200px 600px at 20% -20%, #2a211a 0%, transparent 60%),
              radial-gradient(800px 500px at 90% 0%, #241d17 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  margin: 0;
}

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: linear-gradient(180deg, #1c1612 0%, #17110e 100%);
  border-right: 1px solid var(--border);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2b211b, #3a2b22);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 700;
}

.brand-text {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--heading);
}

.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
}

.profile .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a2b22, #221b16);
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 700;
}

.profile .meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile .meta span {
  font-size: 12px;
  color: var(--muted);
}

.nav-title {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1.4px;
  color: var(--sidebar-text);
}

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

.nav-link {
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: var(--panel);
  border-color: var(--border);
  color: #fff;
}

.content {
  flex: 1;
  padding: 24px 32px 48px;
}

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

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

.menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 6px;
  cursor: pointer;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  color: var(--heading);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-actions .profile {
  margin-left: auto;
}

.search {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 260px;
  color: var(--muted);
}

.search input {
  background: transparent;
  border: none;
  color: var(--text);
  width: 100%;
  outline: none;
  font-size: 14px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: #2a211b;
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.5px;
}
.initial-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}
.remove-backup-link .icon {
  transition: color 0.2s ease;
}
.remove-backup-link:hover .icon {
  color: var(--accent);
}

.card {
  background: linear-gradient(180deg, #231c17, #201915);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--heading);
}

.card p {
  color: var(--muted);
  margin: 0 0 16px;
}

.mini-chart {
  height: 140px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(196, 138, 74, 0.22), rgba(196, 138, 74, 0.02)),
              radial-gradient(120px 80px at 20% 30%, rgba(196, 138, 74, 0.28), transparent 70%),
              #1b1511;
  border: 1px solid var(--border);
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }
.span-12 { grid-column: span 12; }

.metric {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.3px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1b140f;
  text-decoration: none;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.btn.secondary {
  background: #2a211b;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn.secondary.outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.reports-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.reports-actions .btn,
.reports-actions button {
  height: 40px;
  line-height: 1;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.reports-actions form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 12px; overflow: hidden; }
.table.checklist-table { table-layout: fixed; }
.table th, .table td { border-bottom: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: 0.6px; text-transform: uppercase; }
.table a {
  color: var(--accent);
  text-decoration: none;
}

.table a:hover {
  text-decoration: underline;
}

.table th a {
  color: var(--muted);
}

.table th a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.action-links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.action-links form {
  display: inline-flex;
  margin: 0;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--accent);
  line-height: 1;
}

.icon-link .icon {
  display: block;
}

.icon-link:hover {
  background: var(--panel-2);
  color: var(--accent);
  text-decoration: none;
}

.icon-btn {
  width: 22px;
  height: 22px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  padding: 2px;
}

.icon-btn.borderless {
  border: none;
}

.icon-btn.ai-summary-btn {
  width: 18px;
  height: 18px;
  padding: 0;
}

.icon-btn.ai-summary-btn .icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.icon-btn.ai-summary-btn.loading {
  opacity: 0.7;
  cursor: wait;
}

.icon-btn .icon {
  width: 14px;
  height: 14px;
  stroke-width: 1.8;
}

.icon-btn:disabled {
  opacity: 1;
  color: var(--accent);
}

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #1b1511;
  color: var(--text);
  font-size: 15px;
}

input,
textarea,
select {
  font-size: 15px !important;
}
.input.remark-field {
  min-height: 0;
}

.form-row { margin-bottom: 12px; }
.error { color: var(--danger); }
.notice { color: var(--success); }

.auth-body {
  min-height: 100vh;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 20px 32px 32px;
}

.auth-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: stretch;
  margin-top: 10px;
}

.auth-shell.auth-shell-single {
  grid-template-columns: 1fr;
  width: min(420px, 100%);
}

.auth-panel {
  background: linear-gradient(135deg, #241c16, #1b1511);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 420px;
}

.auth-panel h1 {
  font-family: 'Playfair Display', serif;
  margin: 0 0 10px;
  color: var(--heading);
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin-top: 0;
  font-family: 'Playfair Display', serif;
  margin-bottom: 4px;
  color: var(--heading);
}

.auth-form {
  display: grid;
  gap: 6px;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.auth-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.auth-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-card .notice,
.auth-card .error {
  margin: 6px 0 8px;
}

.auth-footer {
  font-size: 12px;
  color: var(--muted);
}

.fade-in {
  animation: none;
  opacity: 1;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .sidebar { width: 220px; }
  .dashboard-grid { grid-template-columns: repeat(6, 1fr); }
  .span-4 { grid-column: span 6; }
  .span-6 { grid-column: span 6; }
}

@media (max-width: 1024px) {
  .app { flex-direction: column; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 30;
  }
  body.menu-open .sidebar { transform: translateX(0); }
  body.menu-open .menu-overlay { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
  .menu-toggle { display: inline-flex; }
  .content { padding: 20px; }
  .topbar { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .topbar-left { flex: 1; min-width: 0; }
  .search { min-width: 0; width: 100%; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .span-4, .span-6, .span-12 { grid-column: span 2; }
}

@media (max-width: 1024px) {
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap .table {
    min-width: 720px;
  }
  .table-wrap.checklist-wrap .table {
    min-width: 900px;
  }
  .form-grid.three-col {
    grid-template-columns: 1fr;
  }
  .report-website-grid {
    grid-template-columns: 1fr !important;
  }
  .checklist-table th:nth-child(2),
  .checklist-table td:nth-child(2) {
    width: 250px;
  }
  .checklist-table colgroup col:nth-child(2) {
    width: 250px !important;
  }
  .website-form-grid {
    grid-template-columns: 1fr !important;
  }
  .followups-table td:nth-child(2),
  .followups-table th:nth-child(2) {
    white-space: nowrap;
  }
  .followups-table td:nth-child(6),
  .followups-table th:nth-child(6) {
    min-width: 320px;
  }
}

.followups-table {
  table-layout: auto;
}

.form-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.form-section-title {
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-weight: 600;
}

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

.form-section .form-row {
  margin-bottom: 0;
}

.info-compact {
  font-size: 14px;
  line-height: 1.35;
}

.info-compact .form-row {
  margin-bottom: 2px;
}
\n.form-grid.two-col {\n  grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n

.nav-group {
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0;
}

.nav-group[open] > .nav-link {
  background: var(--panel);
  border-color: var(--border);
}

.nav-group summary {
  list-style: none;
  cursor: pointer;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-sub {
  display: grid;
  gap: 6px;
  padding: 6px 8px 2px 18px;
}

.nav-sublink {
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
}

.nav-sublink:hover {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
}

.nav-group summary.nav-link {
  position: relative;
  padding-right: 28px;
}

.nav-group summary.nav-link::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-50%) rotate(-45deg);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.nav-group[open] summary.nav-link::after {
  transform: translateY(-50%) rotate(45deg);
  border-color: var(--accent);
}
.advance-search summary::-webkit-details-marker {
  display: none;
}
.advance-search-summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding-right: 24px;
  color: var(--accent);
  font-weight: 600;
}
.advance-search-summary::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-50%) rotate(-45deg);
  transition: transform 0.2s ease;
}
.advance-search[open] .advance-search-summary::after {
  transform: translateY(-50%) rotate(45deg);
}
.advance-search-form {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

@media (max-width: 1024px) {
  .advance-search-form {
    flex-direction: column;
    align-items: stretch;
  }
}
.accordion summary::-webkit-details-marker {
  display: none;
}
.accordion-summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  padding-right: 24px;
  color: var(--accent);
  font-weight: 600;
}
.accordion.audit-log .accordion-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.accordion.audit-log .accordion-summary::after {
  border-right-color: var(--muted);
  border-bottom-color: var(--muted);
}
.accordion-summary::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-50%) rotate(-45deg);
  transition: transform 0.2s ease;
}
.accordion[open] .accordion-summary::after {
  transform: translateY(-50%) rotate(45deg);
}


.form-row-span {
  grid-column: span 2;
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.status-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.status-stack label {
  font-size: 14px;
  color: var(--text);
}
.severity-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.severity-select {
  width: 120px;
  min-width: 120px;
  max-width: 140px;
  display: inline-block;
}
.severity-checks {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.severity-cell {
  width: 1%;
  white-space: nowrap;
}
.severity-cell + td,
.severity-cell + th {
  padding-left: 32px;
}
.severity-checks input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px transparent;
}
.severity-checks input.severity-minor-box {
  background-color: #fff;
  border-color: var(--border);
}
.severity-checks input.severity-major-box {
  background-color: #e0b84a;
  border-color: #e0b84a;
}
.severity-checks input.severity-critical-box {
  background-color: #e24a4a;
  border-color: #e24a4a;
}
.severity-checks input[type="checkbox"]:checked {
  box-shadow: inset 0 0 0 2px var(--checkbox-accent);
}
.severity-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.severity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: inline-block;
}
.severity-critical {
  background: #e24a4a;
  border-color: #e24a4a;
}
.severity-major {
  background: #e0b84a;
  border-color: #e0b84a;
}
.severity-minor {
  background: #f1e9df;
  border-color: var(--border);
}
.followup-resolved td {
  text-decoration: line-through;
  color: var(--muted);
}
.followup-critical td {
  background: #3a1e1e;
}
.followup-major td {
  background: #3a2d10;
}
.followup-save-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  align-self: stretch;
  height: auto;
  padding: 0 12px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.followup-save-btn .icon {
  stroke: currentColor;
}
.followup-save-btn:hover {
  background: rgba(196, 138, 74, 0.12);
}
.checklist-table td small {
  color: var(--muted);
}
.checklist-table th:nth-child(2),
.checklist-table td:nth-child(2) {
  width: 300px;
}
.checklist-table th:nth-child(4),
.checklist-table td:nth-child(4) {
  padding-left: 10px;
  border-left: 10px solid transparent;
}
.checklist-table {
  background: #2a221c;
}
.checklist-table th,
.checklist-table td {
  background: #2a221c;
}

.form-grid.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
