:root {
  --navy: #1B3A4B;
  --navy-light: #2d5a75;
  --navy-dark: #0f2433;
  --aluminum: #94a3b8;
  --aluminum-light: #cbd5e1;
  --aluminum-dark: #64748b;
  --gold: #C4A35A;
  --gold-light: #d4b57a;
  --gold-dark: #a88940;
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --text-primary: #1A1A1A;
  --text-secondary: #475569;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ==================== AUTH SCREEN ==================== */

#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
}

.auth-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.brand {
  text-align: center;
  color: white;
  margin-bottom: 30px;
}

.brand h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.brand p {
  color: var(--aluminum-light);
  font-size: 0.95rem;
}

.auth-box {
  background: white;
  border-radius: 8px;
  padding: 30px;
  box-shadow: var(--shadow-lg);
}

.auth-box form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-box input {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}

.auth-box input:focus {
  outline: none;
  border-color: var(--navy);
}

.demo-notice {
  margin-top: 20px;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 6px;
  font-size: 0.85rem;
  text-align: center;
  color: var(--text-secondary);
}

.error {
  padding: 12px;
  background: #fee;
  border: 1px solid var(--error);
  border-radius: 6px;
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 10px;
}

/* ==================== NAVBAR ==================== */

.navbar {
  background: var(--navy);
  color: white;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 30px;
  height: 64px;
  box-shadow: var(--shadow);
}

.navbar-brand h1 {
  font-size: 1.25rem;
  color: white;
}

.navbar-nav {
  display: flex;
  gap: 5px;
  flex: 1;
}

.nav-link {
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--aluminum-light);
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-link.active {
  background: var(--gold);
  color: white;
  font-weight: 500;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--aluminum-light);
  font-size: 0.9rem;
}

/* ==================== MAIN CONTENT ==================== */

.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.view-header h2 {
  font-size: 1.75rem;
  color: var(--navy);
}

.controls {
  display: flex;
  gap: 10px;
}

/* ==================== BUTTONS ==================== */

.btn-primary,
.btn-secondary,
.btn-gold,
.btn-success,
.btn-danger {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

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

.btn-secondary {
  background: var(--aluminum);
  color: white;
}

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

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

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

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

.btn-success:hover {
  background: #059669;
}

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

.btn-danger:hover {
  background: #dc2626;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* ==================== LISTS & CARDS ==================== */

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

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
}

.card-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.card-body {
  margin-bottom: 15px;
}

.card-info {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.card-info-row {
  display: flex;
  gap: 10px;
}

.card-info-row strong {
  min-width: 120px;
  color: var(--text-secondary);
  font-weight: 500;
}

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

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

.badge-default {
  background: var(--aluminum-light);
  color: var(--text-secondary);
}

/* ==================== FORMS ==================== */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--navy);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
}

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

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy);
}

.form-group small {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
}

/* ==================== MODAL ==================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.25rem;
  color: var(--navy);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.modal-close:hover {
  background: var(--bg-primary);
}

.modal-body {
  padding: 20px;
}

/* ==================== SETTINGS ==================== */

.settings-form {
  max-width: 600px;
}

/* ==================== TEMPLATE HELP ==================== */

.template-help {
  margin-top: 30px;
  padding: 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.template-help strong {
  display: block;
  margin-bottom: 10px;
  color: var(--navy);
}

.template-help code {
  display: inline-block;
  margin: 4px;
  padding: 4px 8px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--gold-dark);
}

/* ==================== TOAST NOTIFICATIONS ==================== */

#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: white;
  border-radius: 6px;
  padding: 15px 20px;
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  border-left: 4px solid var(--success);
  animation: slideIn 0.3s ease-out;
}

.toast.error {
  border-left-color: var(--error);
}

.toast.warning {
  border-left-color: var(--warning);
}

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

/* ==================== EMPTY STATE ==================== */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
  color: var(--navy);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
  .navbar {
    flex-wrap: wrap;
    height: auto;
    padding: 15px;
  }

  .navbar-nav {
    width: 100%;
    order: 3;
    margin-top: 10px;
  }

  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-actions {
    flex-wrap: wrap;
  }

  .controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .modal-content {
    width: 95%;
    max-height: 95vh;
  }
}
