:root {
  --ncpsa-green: #1a5632;
  --ncpsa-green-light: #2a7a4a;
  --ncpsa-green-dark: #0f3a20;
  --ncpsa-gold: #f5a623;
  --ncpsa-gold-light: #ffc966;
  --ncpsa-gray-light: #f4f6f5;
  --ncpsa-gray: #6b7c74;
  --ncpsa-border: #d4ddd8;
  --ncpsa-white: #ffffff;
  --ncpsa-danger: #c0392b;
  --ncpsa-success: #27ae60;
  --pico-primary: #1a5632;
  --pico-primary-hover: #2a7a4a;
}

/* Reset Pico's container width for our layout */
body {
  margin: 0;
  padding: 0;
  background: var(--ncpsa-gray-light);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ===== TOP NAV ===== */
.top-nav {
  background: var(--ncpsa-green);
  color: white;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.top-nav .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: white;
}

.top-nav .logo svg {
  width: 28px;
  height: 28px;
  fill: var(--ncpsa-gold);
}

.top-nav .user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.top-nav .user-info span {
  opacity: 0.9;
}

.top-nav .btn-logout {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.top-nav .btn-logout:hover {
  background: rgba(255,255,255,0.25);
}

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: calc(100vh - 52px);
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 280px;
  background: white;
  border-right: 1px solid var(--ncpsa-border);
  padding: 1.5rem 0;
  flex-shrink: 0;
}

.sidebar .section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ncpsa-gray);
  padding: 0.5rem 1.25rem;
  margin-top: 0.75rem;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1.25rem;
  color: #333;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}

.sidebar a:hover {
  background: var(--ncpsa-gray-light);
}

.sidebar a.active {
  background: rgba(26,86,50,0.06);
  border-left-color: var(--ncpsa-green);
  color: var(--ncpsa-green);
  font-weight: 600;
}

.sidebar .status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
  flex-shrink: 0;
}

.sidebar .status-dot.complete {
  background: var(--ncpsa-success);
}

.sidebar .status-check {
  color: var(--ncpsa-success);
  font-size: 1rem;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 960px;
}

.main-content h1 {
  font-size: 1.5rem;
  color: var(--ncpsa-green-dark);
  margin-bottom: 0.25rem;
}

.main-content .subtitle {
  color: var(--ncpsa-gray);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: 8px;
  border: 1px solid var(--ncpsa-border);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
  color: var(--ncpsa-green-dark);
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--ncpsa-border);
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--ncpsa-green);
  box-shadow: 0 0 0 2px rgba(26,86,50,0.1);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s, opacity 0.2s;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--ncpsa-green);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--ncpsa-green-light);
}

.btn-secondary {
  background: #e9eceb;
  color: #333;
}

.btn-secondary:hover:not(:disabled) {
  background: #dce0de;
}

.btn-gold {
  background: var(--ncpsa-gold);
  color: #333;
  font-weight: 600;
}

.btn-gold:hover:not(:disabled) {
  background: var(--ncpsa-gold-light);
}

.btn-danger {
  background: var(--ncpsa-danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #e74c3c;
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
}

.btn-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* ===== TABLES ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  background: var(--ncpsa-gray-light);
  border-bottom: 2px solid var(--ncpsa-border);
  font-weight: 600;
  color: #333;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--ncpsa-border);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(26,86,50,0.02);
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-progress {
  background: #fff3cd;
  color: #856404;
}

.badge-submitted {
  background: #cce5ff;
  color: #004085;
}

.badge-approved {
  background: #d4edda;
  color: #155724;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--ncpsa-border);
  margin-bottom: 1.25rem;
  gap: 0;
}

.tab {
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ncpsa-gray);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  transition: color 0.15s;
}

.tab:hover {
  color: #333;
}

.tab.active {
  color: var(--ncpsa-green);
  border-bottom-color: var(--ncpsa-green);
  font-weight: 600;
}

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ncpsa-green-dark), var(--ncpsa-green-light));
}

.login-card {
  background: white;
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-card .login-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-card .login-logo h1 {
  font-size: 1.75rem;
  color: var(--ncpsa-green);
  margin: 0;
}

.login-card .login-logo p {
  font-size: 0.85rem;
  color: var(--ncpsa-gray);
  margin: 0.25rem 0 0 0;
}

.login-card .error-msg {
  background: #fce4e4;
  color: var(--ncpsa-danger);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}

/* ===== FILE UPLOAD ZONE ===== */
.upload-zone {
  border: 2px dashed var(--ncpsa-border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 1rem;
}

.upload-zone:hover {
  border-color: var(--ncpsa-green);
  background: rgba(26,86,50,0.03);
}

.upload-zone.dragover {
  border-color: var(--ncpsa-green);
  background: rgba(26,86,50,0.06);
}

.upload-zone p {
  margin: 0;
  color: var(--ncpsa-gray);
  font-size: 0.9rem;
}

.upload-zone .upload-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--ncpsa-border);
  border-radius: 4px;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

/* ===== COMPLETION PROGRESS ===== */
.progress-bar-container {
  background: #e9eceb;
  border-radius: 8px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: var(--ncpsa-green);
  border-radius: 8px;
  transition: width 0.3s;
}

.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.section-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--ncpsa-border);
  border-radius: 6px;
  text-decoration: none;
  color: #333;
  transition: border-color 0.15s;
  font-size: 0.9rem;
}

.section-item:hover {
  border-color: var(--ncpsa-green);
}

.section-item .icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.section-item .icon.complete {
  background: var(--ncpsa-success);
  color: white;
}

.section-item .icon.pending {
  background: #e9eceb;
  color: #999;
}

/* ===== ALERTS ===== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #333;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
}

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

.toast.success {
  background: var(--ncpsa-success);
}

.toast.error {
  background: var(--ncpsa-danger);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

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

.modal {
  background: white;
  border-radius: 10px;
  padding: 1.75rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal h2 {
  margin-top: 0;
  font-size: 1.15rem;
  color: var(--ncpsa-green-dark);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-content {
    padding: 1rem;
  }

  .section-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== MAP STYLES ===== */
.us-map-container {
  max-width: 960px;
  margin: 0 auto;
}

.us-map-container svg {
  width: 100%;
  height: auto;
}

.us-map-container svg path {
  fill: var(--ncpsa-green);
  stroke: white;
  stroke-width: 1;
  cursor: pointer;
  transition: fill 0.15s;
}

.us-map-container svg path:hover {
  fill: var(--ncpsa-gold);
}

/* ===== KNOW YOUR STATE PUBLIC ===== */
.public-header {
  background: var(--ncpsa-green);
  color: white;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.public-header .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
}

.public-header nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.9rem;
}

.public-header nav a:hover {
  color: white;
}

.state-detail-section {
  margin-bottom: 1.5rem;
}

.state-detail-section h2 {
  font-size: 1.1rem;
  color: var(--ncpsa-green);
  border-bottom: 2px solid var(--ncpsa-border);
  padding-bottom: 0.4rem;
  margin-bottom: 0.75rem;
}

/* ===== ADMIN EDITOR (Quill overrides) ===== */
.ql-editor {
  min-height: 120px;
}

.editor-field {
  margin-bottom: 1.5rem;
}

.editor-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: #333;
}

/* ===== SPINNER ===== */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state {
  text-align: center;
  padding: 3rem;
  color: var(--ncpsa-gray);
}
