:root {
  --emerald-950: #042e20;
  --emerald-900: #064832;
  --emerald-800: #085c40;
  --emerald-700: #0b6f4d;
  --emerald-600: #118c62;
  --emerald-100: #e6f5ee;
  --emerald-50: #f3faf6;
  --gold-500: #f2c94c;
  --gold-600: #d9a426;
  --ink-900: #0f241d;
  --ink-700: #355046;
  --ink-500: #637d73;
  --ink-300: #cbdcd5;
  --surface: #ffffff;
  --bg-page: #f1f7f4;
  --danger: #c93535;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-sm: 0 4px 14px rgba(6, 72, 50, 0.06);
  --shadow-md: 0 12px 32px rgba(6, 72, 50, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--ink-900);
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 20%, #0b6647 0%, #042e20 100%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: 20px;
  padding: 38px 34px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.login-brand .brand-svg {
  height: 36px;
  width: auto;
}

.login-badge {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--emerald-100);
  color: var(--emerald-900);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.login-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  color: var(--emerald-900);
}

.login-subtitle {
  margin: 0 0 24px;
  font-size: 13.5px;
  color: var(--ink-500);
}

.login-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #e4efe9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-500);
}

.link-back {
  color: var(--emerald-800);
  font-weight: 700;
  text-decoration: none;
}

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

/* ==========================================================================
   MAIN LAYOUT & SIDEBAR
   ========================================================================== */
.admin-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--emerald-950);
  color: #ffffff;
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 22px;
}

.sidebar-logo-link {
  display: inline-block;
}

.sidebar-logo-link .brand-svg {
  height: 36px;
  width: auto;
}

.sidebar-project-tag {
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold-500);
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-item.is-active {
  background: var(--emerald-700);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.nav-text {
  flex: 1;
}

.nav-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold-500);
  color: var(--emerald-950);
  font-size: 11px;
  font-weight: 800;
}

.nav-badge.badge-soft {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.sidebar-footer {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-outline-light {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  transition: background 0.2s ease;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-ghost-light {
  padding: 9px 14px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost-light:hover {
  background: rgba(201, 53, 53, 0.35);
  color: #ffffff;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.admin-main {
  padding: 28px 34px 48px;
  overflow-x: hidden;
}

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

.topbar-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--emerald-900);
}

.topbar-subtitle {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--ink-500);
}

.admin-user-pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--ink-300);
  font-size: 12.5px;
  color: var(--ink-700);
}

/* ==========================================================================
   KPI CARDS
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border: 1px solid #dcebe4;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-card.kpi-highlight {
  background: linear-gradient(135deg, #064832 0%, #0b6f4d 100%);
  color: #ffffff;
  border-color: transparent;
}

.kpi-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink-500);
}

.kpi-highlight .kpi-label,
.kpi-highlight .kpi-foot {
  color: rgba(255, 255, 255, 0.85);
}

.kpi-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--emerald-900);
}

.kpi-highlight .kpi-value {
  color: var(--gold-500);
}

.kpi-foot {
  font-size: 12px;
  color: var(--ink-500);
}

/* ==========================================================================
   TOOLBAR & TABLE
   ========================================================================== */
.toolbar-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  border: 1px solid #dcebe4;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1;
}

.search-box {
  flex: 1;
  min-width: 240px;
}

.toolbar-filters input,
.toolbar-filters select {
  height: 40px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--ink-300);
  background: #f9fcfa;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink-900);
  width: 100%;
}

.toolbar-filters select {
  width: auto;
  min-width: 190px;
}

.toolbar-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid #dcebe4;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  background: var(--emerald-50);
  color: var(--emerald-900);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #d5e8df;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf5f1;
  vertical-align: top;
}

.admin-table tr:hover td {
  background: #fafdfb;
}

.lead-name {
  font-weight: 700;
  color: var(--ink-900);
  font-size: 14px;
  margin-bottom: 4px;
}

.lead-contact-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.phone-badge {
  font-weight: 700;
  color: var(--emerald-800);
  text-decoration: none;
}

.quick-link {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--emerald-100);
  color: var(--emerald-900);
  text-decoration: none;
}

.quick-link:hover {
  background: var(--emerald-700);
  color: #ffffff;
}

.interest-pill {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 8px;
  background: #eef7f3;
  color: var(--emerald-900);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #cde5da;
}

.status-select {
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--ink-300);
  cursor: pointer;
}

.status-select.status-new {
  background: #fff8e1;
  color: #9c6500;
  border-color: #f5d67b;
}

.status-select.status-contacted {
  background: #e3f2fd;
  color: #0d47a1;
  border-color: #90caf9;
}

.status-select.status-preparing {
  background: #ede7f6;
  color: #4527a0;
  border-color: #b39ddb;
}

.status-select.status-submitted {
  background: #e6f5ee;
  color: #064832;
  border-color: #88cfb0;
}

.status-select.status-archived {
  background: #f1f3f5;
  color: #5c6770;
  border-color: #ced4da;
}

.lead-note-text {
  font-size: 12.5px;
  color: var(--ink-700);
  max-width: 280px;
  white-space: pre-wrap;
}

.lead-note-empty {
  font-size: 12px;
  color: var(--ink-500);
  font-style: italic;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.btn-icon {
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid #d5e5dd;
  background: #ffffff;
  color: var(--ink-700);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-icon:hover {
  background: var(--emerald-50);
  border-color: var(--emerald-700);
  color: var(--emerald-900);
}

.btn-icon.danger:hover {
  background: #fdecec;
  border-color: var(--danger);
  color: var(--danger);
}

/* ==========================================================================
   DOCUMENTS WORKSPACE
   ========================================================================== */
.info-banner {
  background: linear-gradient(90deg, #064832 0%, #0b6f4d 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.info-banner p {
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.docs-workspace-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.25fr;
  gap: 24px;
  align-items: start;
}

.card-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid #dcebe4;
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.panel-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
  color: var(--emerald-900);
}

.panel-desc {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--ink-500);
}

.upload-dropzone {
  position: relative;
  border: 2px dashed #8bc4ab;
  border-radius: 14px;
  background: var(--emerald-50);
  padding: 24px 18px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 18px;
  transition: all 0.2s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  border-color: var(--emerald-800);
  background: #e3f4ec;
}

.upload-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.dropzone-icon {
  font-size: 28px;
}

.dropzone-hint {
  font-size: 12px;
  color: var(--ink-500);
}

.documents-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.doc-item-card {
  border: 1px solid #dcebe4;
  border-radius: 14px;
  padding: 16px 18px;
  background: #fbfdfc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-item-card.is-pinned {
  border-color: var(--gold-600);
  background: #fffdf7;
}

.doc-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.doc-cat-badge {
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--emerald-100);
  color: var(--emerald-900);
  font-size: 11px;
  font-weight: 800;
}

.doc-pin-badge {
  padding: 3px 8px;
  border-radius: 6px;
  background: #fff3cd;
  color: #856404;
  font-size: 11px;
  font-weight: 800;
}

.doc-vis-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.doc-vis-badge.public {
  background: #d1e7dd;
  color: #0f5132;
}

.doc-vis-badge.hidden {
  background: #e2e3e5;
  color: #41464b;
}

.doc-item-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-900);
}

.doc-item-desc {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--ink-700);
}

.doc-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e1ede7;
  font-size: 12px;
  color: var(--ink-500);
}

.doc-item-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* ==========================================================================
   FORMS, BUTTONS & MODALS
   ========================================================================== */
.field-group {
  margin-bottom: 16px;
}

.field-group label {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-900);
  margin-bottom: 6px;
}

.field-group label span {
  color: var(--danger);
}

.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 9px;
  border: 1px solid var(--ink-300);
  background: #f9fcfa;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink-900);
  outline: none;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--emerald-700);
  background: #ffffff;
}

.field-hint {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ink-500);
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 18px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(90deg, #064832 0%, #0d7a56 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary:hover {
  filter: brightness(1.07);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 18px;
  border-radius: 9px;
  border: 1px solid var(--emerald-800);
  background: #ffffff;
  color: var(--emerald-900);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--emerald-50);
}

.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.form-actions-row {
  display: flex;
  gap: 10px;
}

.form-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 14px;
  background: var(--emerald-100);
  color: var(--emerald-900);
}

.form-alert.error {
  background: #fdecec;
  color: var(--danger);
}

.empty-cell {
  text-align: center;
  padding: 32px;
  color: var(--ink-500);
  font-size: 13.5px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 46, 32, 0.58);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-dialog {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border-radius: 18px;
  padding: 26px 28px;
  box-shadow: var(--shadow-md);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--emerald-900);
}

.modal-close {
  border: none;
  background: #edf5f1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 800;
}

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

@media (max-width: 1024px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    height: auto;
    position: relative;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .docs-workspace-grid {
    grid-template-columns: 1fr;
  }
}

:root{--emerald-950:#071a3b;--emerald-900:#102b60;--emerald-800:#173b79;--emerald-700:#204c91;--emerald-600:#3269af;--emerald-100:#e8eff8;--emerald-50:#f3f6fb;--ink-900:#10213f;--ink-700:#354c70;--ink-500:#647896;--bg-page:#f2f5fa}.login-screen{background:radial-gradient(circle at 20% 20%,#284f87,#071a3b)}.sk-admin-brand{font-size:32px;font-weight:800;letter-spacing:.05em}.sk-admin-brand small{display:block;font-size:10px;letter-spacing:.15em}.sidebar-brand .sk-admin-brand{color:white}
