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

:root {
  --sidebar-bg: #2D3132;
  --sidebar-hover: #383e3f;
  --sidebar-active: #4d6b10;
  --primary: #95C11F;
  --primary-dark: #4d6b10;
  --primary-light: #E9F0D8;
  --bg: #eef0eb;
  --surface: #ffffff;
  --border: #dde3d5;
  --text: #2D3132;
  --text-muted: #6B7280;
  --text-light: #9ca3af;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.09);
  --radius: 8px;
  --radius-lg: 12px;
  --ok-bg: #E9F0D8; --ok-text: #4d6b10;
  --warn-bg: #fef3c7; --warn-text: #92400e;
  --danger-bg: #fee2e2; --danger-text: #991b1b;
  --neutral-bg: #f1f4ee; --neutral-text: #6B7280;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Hanken Grotesk", "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
}

/* ─── SIDEBAR ─────────────────────────────────── */
.sidebar {
  width: 215px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.brand-title {
  display: block;
  color: #f0f2ee;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.brand-sub {
  display: block;
  color: #95C11F;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: #9aaa8a;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.13s, color 0.13s;
  line-height: 1;
}

.nav-item:hover { background: var(--sidebar-hover); color: #d4e8b8; }
.nav-item.active { background: var(--primary); color: #2D3132; font-weight: 700; }
.nav-item svg { flex-shrink: 0; }
.nav-item.small { font-size: 12px; padding: 7px 10px; }

.sidebar-bottom {
  padding: 8px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.export-reports-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 10px;
  border-radius: 7px;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.13s;
}

.export-reports-btn:hover { background: var(--primary-dark); }

/* ─── MAIN WRAPPER ────────────────────────────── */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ─── TOPBAR ──────────────────────────────────── */
.topbar {
  height: 54px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  flex-shrink: 0;
}

.search-wrap {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0 12px;
  height: 34px;
}

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

.search-wrap input::placeholder { color: var(--text-light); }

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

.topbar-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.12s;
}

.topbar-icon:hover { background: #f8fafc; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  cursor: default;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; }
.user-role { font-size: 11px; font-weight: 600; color: var(--text); line-height: 1.3; }
.user-org { font-size: 10px; color: var(--text-muted); }

/* ─── PAGE ────────────────────────────────────── */
.page {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px 32px;
}

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.ph-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.active-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.update-time { font-size: 11px; color: var(--text-muted); }

.ph-right { display: flex; gap: 8px; align-items: center; }

.outline-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}

.outline-btn:hover { background: #f8fafc; }

.primary-btn {
  padding: 7px 15px;
  border-radius: 7px;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}

.primary-btn:hover { background: var(--primary-dark); }

/* ─── KPI ROW ─────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.kpi-heading {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kpi-val {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 10px;
}

.kpi-bar {
  height: 6px;
  background: var(--primary-light);
  border-radius: 999px;
  margin-bottom: 8px;
  overflow: hidden;
}

.kpi-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.5s ease;
}

.kpi-note { font-size: 11px; color: var(--text-muted); }
.kpi-note.trend-up { color: #16a34a; font-weight: 600; }

.deadline-card { background: #fffbeb; border-color: #fde68a; }
.deadline-text { font-size: 12px; color: #92400e; margin-bottom: 12px; line-height: 1.5; }

.days-left-wrap { display: flex; align-items: baseline; gap: 5px; }
.days-num { font-size: 30px; font-weight: 700; color: #92400e; }
.days-label { font-size: 11px; font-weight: 700; color: #b45309; text-transform: uppercase; }

/* ─── STATUS BADGES (global) ──────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-badge.ok { background: var(--ok-bg); color: var(--ok-text); }
.status-badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.status-badge.danger { background: var(--danger-bg); color: var(--danger-text); }
.status-badge.neutral { background: var(--neutral-bg); color: var(--neutral-text); }

/* ─── COMBO LIST ──────────────────────────────── */
.combo-grid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.combo-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}

.combo-list-item:last-child { border-bottom: none; }
.combo-list-item:hover { background: #f8faf9; }

.combo-folder-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.combo-folder-icon.ok { background: var(--ok-bg); color: #4d6b10; }
.combo-folder-icon.warn { background: var(--warn-bg); color: #d97706; }
.combo-folder-icon.danger { background: var(--danger-bg); color: #dc2626; }
.combo-folder-icon.neutral { background: var(--neutral-bg); color: #94a3b8; }

.combo-list-info { flex: 1; min-width: 0; }

.combo-list-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.combo-list-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.combo-list-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.combo-list-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.combo-list-bar {
  width: 72px;
  height: 4px;
  background: var(--primary-light);
  border-radius: 999px;
  overflow: hidden;
}

.combo-list-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.fill-ok { background: #95C11F; }
.fill-warn { background: #f59e0b; }
.fill-danger { background: #ef4444; }
.fill-neutral { background: #c8d4b8; }

.combo-list-pct { font-size: 11px; font-weight: 700; color: var(--text-muted); width: 30px; text-align: right; }

.combo-list-chevron { color: var(--text-light); }

.combo-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: none;
  background: none;
  color: #cbd5e1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, color .15s, background .15s;
  flex-shrink: 0;
}
.combo-list-item:hover .combo-delete-btn { opacity: 1; }
.combo-delete-btn:hover { background: #fef2f2; color: #ef4444; }

.load-more-wrap { text-align: center; margin-top: 14px; }

.load-more-btn {
  padding: 9px 28px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}

.load-more-btn:hover { background: #f8fafc; }

/* ─── DOCUMENTS PAGE ──────────────────────────── */
.docs-page-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.docs-page-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.docs-page-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.docs-page-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.docs-page-table tr:last-child td { border-bottom: none; }
.docs-page-table tr:hover td { background: #f8faf9; }

.docs-page-table a { color: var(--primary); text-decoration: none; font-weight: 500; }
.docs-page-table a:hover { text-decoration: underline; }

/* ─── DETAIL VIEW ─────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.breadcrumb button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.breadcrumb button:hover { color: var(--primary); text-decoration: underline; }
.breadcrumb .sep { color: #cbd5e1; }
.breadcrumb .crumb-current { color: var(--text); font-weight: 600; }

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 14px;
  flex-wrap: wrap;
}

.detail-badges { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }

.id-pill {
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
}

.detail-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.detail-subtitle { font-size: 12px; color: var(--text-muted); }

.detail-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.ghost-btn {
  padding: 7px 13px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}

.ghost-btn:hover { background: #f8fafc; }

.audit-btn {
  padding: 7px 15px;
  border-radius: 7px;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.audit-btn:hover { background: var(--primary-dark); }

/* Two-column detail layout */
.detail-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  align-items: start;
}

.detail-sidebar-col { display: flex; flex-direction: column; gap: 12px; }

.img-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 12px;
  padding: 16px;
}

.material-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.material-card h4 { font-size: 13px; font-weight: 700; margin-bottom: 12px; }

.mat-row { margin-bottom: 10px; }

.mat-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.mat-label span:last-child { font-weight: 700; color: var(--primary-dark); }

.mat-bar { height: 5px; background: var(--primary-light); border-radius: 999px; overflow: hidden; }
.mat-fill { height: 100%; background: var(--primary); border-radius: 999px; }

/* Main panel: role tabs + docs */
.detail-main-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Role selector bar */
.role-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
  flex-wrap: wrap;
}

.role-bar-label { font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

.role-dropdown { position: relative; }

.role-toggle-btn {
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: white;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}

.role-menu-popup {
  position: absolute;
  left: 0;
  top: 38px;
  z-index: 50;
  min-width: 240px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  box-shadow: var(--shadow-md);
}

.role-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.role-check-label:hover { background: #f8fafc; }
.role-check-label input { accent-color: var(--primary); }

.role-menu-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.role-menu-actions button {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: white;
  font-family: inherit;
}

.role-menu-save {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}

/* Role tabs */
.role-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  overflow-x: auto;
  gap: 0;
}

.role-tab {
  padding: 11px 13px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  font-family: inherit;
  transition: color 0.12s;
}

.role-tab:hover { color: var(--text); }

.role-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

/* Docs section */
.docs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.docs-header h3 { font-size: 13px; font-weight: 700; }

.add-doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: white;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

/* Document items */
.doc-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.doc-item:last-child { border-bottom: none; }

.doc-icon-wrap {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.doc-icon-wrap.ic-ok { background: var(--primary-light); color: var(--primary-dark); }
.doc-icon-wrap.ic-warn { background: var(--warn-bg); color: var(--warn-text); }
.doc-icon-wrap.ic-danger { background: var(--danger-bg); color: var(--danger-text); }
.doc-icon-wrap.ic-neutral { background: var(--neutral-bg); color: var(--neutral-text); }

.doc-info { flex: 1; min-width: 0; }

.doc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.doc-meta { font-size: 11px; color: var(--text-muted); }
.doc-meta a { color: var(--primary); text-decoration: none; }
.doc-meta a:hover { text-decoration: underline; }

.doc-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.doc-menu-btn {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-light);
  font-size: 15px;
  font-family: inherit;
}

.doc-menu-btn:hover { background: #f8fafc; border-color: var(--border); }

/* Three-dot dropdown popup */
.doc-menu-popup {
  position: fixed;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  z-index: 9999;
  min-width: 168px;
  padding: 4px;
}
.dmp-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  text-align: left;
  font-size: 13px;
  font-family: inherit;
  color: #374151;
  cursor: pointer;
  border-radius: 5px;
}
.dmp-item:hover { background: #f8fafc; }
.dmp-delete { color: #ef4444; }
.dmp-delete:hover { background: #fef2f2; color: #dc2626; }

/* Inline note editor */
.note-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--primary-light);
  border-top: 1px solid #dde8c4;
  border-bottom: 1px solid #dde8c4;
}
.note-edit-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  background: #fff;
}
.note-edit-input:focus { border-color: var(--primary); }
.note-edit-save {
  padding: 6px 13px;
  background: var(--primary);
  color: #2D3132;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
.note-edit-cancel {
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

/* Login overlay */
.login-overlay {
  position: fixed; inset: 0; background: #f0f2ee;
  display: flex; align-items: center; justify-content: center;
  z-index: 99999;
}
.login-box {
  background: #fff; border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,.10);
  padding: 40px; width: 100%; max-width: 380px;
}
.login-brand {
  display: flex; align-items: center; gap: 12px; margin-bottom: 28px;
}
.login-title {
  font-size: 20px; font-weight: 700; color: #2D3132; margin: 0 0 20px;
}
.login-label {
  display: block; font-size: 11px; font-weight: 700;
  color: #64748b; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px;
}
.login-input {
  width: 100%; padding: 10px 13px; border: 1px solid #e2e8f0;
  border-radius: 8px; font-size: 13px; font-family: inherit;
  outline: none; box-sizing: border-box; margin-bottom: 0;
}
.login-input:focus { border-color: var(--primary); }
.login-error {
  color: #dc2626; font-size: 12px; min-height: 20px;
  margin: 8px 0 4px;
}
.login-btn {
  width: 100%; margin-top: 16px; padding: 11px;
  background: var(--primary); color: #2D3132;
  border: none; border-radius: 8px; font-size: 14px;
  font-weight: 700; font-family: inherit; cursor: pointer;
  transition: opacity .15s;
}
.login-btn:hover { opacity: .88; }
.login-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Upload row per document */
.upload-row {
  padding: 8px 16px 10px 58px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.upload-form-inner {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.upload-form-inner input[type="file"] {
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 7px;
  background: white;
  cursor: pointer;
  font-family: inherit;
}

.upload-form-inner input[type="text"] {
  flex: 1;
  min-width: 120px;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 9px;
  background: white;
  outline: none;
  font-family: inherit;
}

.upload-submit-btn {
  padding: 5px 12px;
  border-radius: 5px;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* Extra docs section */
.extra-section {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.extra-section h4 { font-size: 13px; font-weight: 700; margin-bottom: 10px; }

.extra-upload-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.extra-upload-row input[type="file"] {
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 8px;
  background: white;
  cursor: pointer;
  font-family: inherit;
}

.extra-upload-row input[type="text"] {
  flex: 1;
  min-width: 120px;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 9px;
  background: white;
  outline: none;
  font-family: inherit;
}

/* ─── MODAL ───────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  width: 700px;
  max-width: 95vw;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.modal h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.modal-body { max-height: 360px; overflow: auto; }

.manage-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.manage-table th, .manage-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.manage-table th { font-weight: 600; color: var(--text-muted); }
.manage-table a { color: var(--primary); text-decoration: none; }

.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

.modal-actions button {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: white;
  font-family: inherit;
}

.modal-delete-btn { background: var(--danger-bg) !important; color: var(--danger-text) !important; border-color: #fca5a5 !important; }

/* ─── SNACKBAR ────────────────────────────────── */
#snackbar {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #2D3132;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 200;
}

#snackbar.show { transform: translateY(0); opacity: 1; }

#snackbar button {
  margin-left: 12px;
  background: transparent;
  border: none;
  color: #95C11F;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* ─── ADMIN BACKUP SECTION ───────────────────────── */
.admin-backup-section {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* ─── DOC SUBGROUP HEADERS ───────────────────────── */
.doc-subgroup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 18px 7px 14px;
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 2px;
}
.doc-subgroup-count {
  font-weight: 600;
  font-size: 10px;
  opacity: .75;
}

.td-compile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #f0f9ff;
  border-top: 1px solid #bae6fd;
  border-bottom: 1px solid #bae6fd;
  font-size: 12px;
  color: #0369a1;
}

.td-compile-btn {
  background: #0369a1;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 13px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.td-compile-btn:hover { background: #0284c7; }
.td-compile-btn:disabled { opacity: .6; cursor: default; }

/* ─── DOC GENERATOR ──────────────────────────────── */
.doc-form-wrap {
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 60px;
}

.doc-form-error {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
}

.doc-form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.doc-section-title {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  padding: 10px 18px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-light);
  font-size: 11px;
}

.doc-form-section .doc-field,
.doc-form-section .doc-form-cols {
  padding: 14px 18px 0;
}

.doc-form-section .doc-form-cols:last-child,
.doc-form-section .doc-field:last-child {
  padding-bottom: 16px;
}

.doc-form-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.doc-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 5px;
}

.doc-field--required label::after {
  content: ' *';
  color: #dc2626;
}

.doc-field input,
.doc-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .15s;
  resize: vertical;
}

.doc-field input:focus,
.doc-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(149,193,31,.12);
}

.doc-field input::placeholder,
.doc-field textarea::placeholder {
  color: var(--text-light);
}

/* ─── PPWR INFO PAGE ─────────────────────────────── */
.info-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.info-tab {
  padding: 9px 18px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
  transition: color .15s, border-color .15s;
}
.info-tab:hover { color: var(--text); background: #f1f4ee; }
.info-tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

.info-section { display: flex; flex-direction: column; gap: 16px; padding-bottom: 60px; }

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.info-card-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.info-text { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 8px; }
.info-text:last-child { margin-bottom: 0; }
.info-list { padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.info-list li { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }

.info-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.info-cat-card { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.info-cat-tag { display: inline-block; border-radius: 4px; padding: 2px 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.info-cat-name { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.info-cat-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }

.info-timeline { display: flex; flex-direction: column; gap: 10px; }
.info-tl-item { display: flex; align-items: flex-start; gap: 12px; }
.info-tl-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.info-tl-date { font-size: 12px; font-weight: 700; min-width: 120px; flex-shrink: 0; }
.info-tl-label { font-size: 12.5px; color: var(--text-muted); }

.info-combo-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.info-combo-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
  transition: background .12s, border-color .12s;
}
.info-combo-pill:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }

/* ─── TD BUILDER ──────────────────────────────────── */
.tdb-start {
  max-width: 560px;
  margin: 40px auto;
  text-align: center;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.tdb-start-icon { margin-bottom: 16px; }
.tdb-start-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.tdb-start-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.6; }
.tdb-start-field { text-align: left; margin-bottom: 20px; }
.tdb-start-btn {
  background: var(--primary);
  color: var(--text);
  border: none;
  border-radius: var(--radius);
  padding: 11px 28px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.tdb-start-btn:hover { background: #aad428; }

.tdb-progress-bar { height: 4px; background: var(--border); border-radius: 2px; margin-bottom: 20px; }
.tdb-progress-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width .3s; }

.tdb-step-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.tdb-step-counter { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.tdb-step-ref { font-size: 11px; color: var(--text-light); }

.tdb-step-body { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; margin-bottom: 24px; }
.tdb-step-left { }
.tdb-step-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.tdb-step-hint { font-size: 13px; color: var(--text-muted); line-height: 1.65; }
.tdb-doc-tip { margin-top: 12px; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 6px; padding: 10px 12px; font-size: 12px; color: #0369a1; }

.tdb-step-right { display: flex; flex-direction: column; gap: 12px; }
.tdb-mode-choice { display: flex; flex-direction: column; gap: 6px; }
.tdb-mode-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: border-color .12s, background .12s;
}
.tdb-mode-option input { display: none; }
.tdb-mode-option:hover { border-color: var(--primary); background: var(--primary-light); }
.tdb-mode-option.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); font-weight: 700; }
.tdb-mode-icon { font-size: 14px; width: 20px; text-align: center; }

.tdb-mode-content { }
.tdb-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: border-color .12s, background .12s;
}
.tdb-upload-zone:hover, .tdb-upload-zone.drag-over { border-color: var(--primary); background: var(--primary-light); }

.tdb-textarea {
  width: 100%;
  min-height: 140px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12.5px;
  font-family: inherit;
  color: var(--text);
  resize: vertical;
  outline: none;
  line-height: 1.5;
}
.tdb-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(149,193,31,.12); }

.tdb-skip-msg { font-size: 13px; color: var(--text-light); font-style: italic; padding: 16px; background: #f9fafb; border-radius: var(--radius); }
.tdb-note-row { }
.tdb-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.tdb-input { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; font-family: inherit; outline: none; }
.tdb-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(149,193,31,.12); }

.tdb-nav { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--border); }
.tdb-back-btn { padding: 8px 18px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); font-family: inherit; font-size: 13px; cursor: pointer; }
.tdb-back-btn:disabled { opacity: .4; cursor: default; }
.tdb-next-btn { padding: 8px 20px; background: var(--primary); border: none; border-radius: var(--radius); font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.tdb-next-btn:hover { background: #aad428; }

.tdb-step-dots { display: flex; gap: 5px; }
.tdb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.tdb-dot.active { background: var(--primary); }
.tdb-dot.done { background: var(--primary-dark); }

.tdb-summary { max-width: 720px; }
.tdb-summary-header { margin-bottom: 20px; }
.tdb-summary-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 24px; }
.tdb-summary-row {
  display: grid;
  grid-template-columns: 24px 1fr 1fr 80px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 12.5px;
}
.tdb-summary-row.done { background: #f0fdf4; }
.tdb-summary-row.skipped { background: #f9fafb; color: var(--text-light); }
.tdb-summary-status { font-weight: 700; font-size: 14px; color: var(--primary-dark); }
.tdb-summary-row.skipped .tdb-summary-status { color: var(--text-light); }
.tdb-summary-name { font-weight: 600; }
.tdb-summary-mode { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdb-summary-edit { padding: 3px 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 5px; font-family: inherit; font-size: 11px; cursor: pointer; }
.tdb-summary-actions { display: flex; gap: 12px; justify-content: flex-end; }
.tdb-download-btn {
  padding: 10px 24px;
  background: #15803d;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.tdb-download-btn:hover { background: #16a34a; }
.tdb-download-btn:disabled { opacity: .5; cursor: default; }
.tdb-zip-error { margin-top: 10px; padding: 10px 14px; background: var(--danger-bg); color: var(--danger-text); border-radius: var(--radius); font-size: 12.5px; }

/* ─── RESPONSIVE ──────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: 56px; }
  .brand-text, .nav-item span, .user-info { display: none; }
  .sidebar-brand { padding: 14px 10px; }
  .nav-item { justify-content: center; }
  .detail-body { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr; }
}
