/* ═══════════════════════════════════════════════
   VacaMuu — Design System
   Palette: Deep Green + Amber/Gold + Dark BG
═══════════════════════════════════════════════ */

/* ── Variables ───────────────────────────────── */
:root {
  --bg-base: #0a0e14;
  --bg-surface: #12171f;
  --bg-elevated: #1a2029;
  --bg-card: #222a36;
  --bg-glass: rgba(18, 23, 31, 0.8);

  --green-dark: #0f2d1f;
  --green-mid: #1d723a;
  --green-light: #2ebc5e;
  --green-accent: #52e084;
  --green-glow: rgba(46, 188, 94, 0.12);

  --amber: #c69411;
  --amber-light: #e6b12a;
  --amber-glow: rgba(198, 148, 17, 0.12);

  --text-primary: #f0f6fc;
  --text-secondary: #9198a1;
  --text-muted: #57606a;

  --border: rgba(145, 152, 161, 0.1);
  --border-hover: rgba(145, 152, 161, 0.2);

  --danger: #cf222e;
  --danger-light: #f85149;
  --danger-glow: rgba(207, 34, 46, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 30px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);

  --sidebar-w: 260px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Material Icons Utility ─────────────────── */
.material-icons {
  font-family: 'Material Icons';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'liga';
}

.icon-sm { font-size: 1.2rem; }
.icon-md { font-size: 1.8rem; }
.icon-lg { font-size: 2.5rem; }


/* ── Reset ───────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Utility ─────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════════
   LOGIN SCREEN
═══════════════════════════════════════════════ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(35, 134, 54, 0.25) 0%, transparent 70%),
    var(--bg-base);
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(35, 134, 54, 0.1);
  animation: fadeInUp 0.4s ease;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
}

.login-logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--green-light);
  letter-spacing: -0.5px;
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Auth tabs (Login / Register toggle) */
.auth-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  transition: all var(--transition);
}

.auth-tab.active {
  background: var(--green-mid);
  color: #fff;
}

.auth-tab:not(.active):hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Verification code digit inputs */
.verify-code-wrap {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.code-digit {
  width: 48px;
  height: 56px;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  caret-color: var(--green-light);
}

.code-digit:focus {
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px var(--green-glow);
}

/* Inline link button */
.link-btn {
  background: none;
  border: none;
  color: var(--green-light);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
}

.link-btn:hover {
  color: var(--green-mid);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ═══════════════════════════════════════════════
   FORM ELEMENTS
═══════════════════════════════════════════════ */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field-group input,
.field-group select,
.field-group textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.625rem 0.875rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--green-mid);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.field-group select {
  cursor: pointer;
}

.field-group textarea {
  resize: vertical;
  min-height: 80px;
}

.field-group input::placeholder {
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--green-mid);
  color: #fff;
  box-shadow: 0 2px 8px rgba(35, 134, 54, 0.4);
}

.btn-primary:hover:not(:disabled) {
  background: var(--green-light);
  box-shadow: 0 4px 16px rgba(63, 185, 80, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--border-hover);
  background: var(--bg-card);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #f85149;
  box-shadow: 0 4px 16px var(--danger-glow);
  transform: translateY(-1px);
}

.btn-amber {
  background: var(--amber);
  color: #000;
}

.btn-amber:hover:not(:disabled) {
  background: var(--amber-light);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-full {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
}

/* ═══════════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════════ */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.alert-error {
  background: var(--danger-glow);
  border: 1px solid var(--danger);
  color: var(--danger-light);
}

.alert-success {
  background: var(--green-glow);
  border: 1px solid var(--green-mid);
  color: var(--green-light);
}

/* ═══════════════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════════════ */
.app {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-header .logo-icon {
  font-size: 1.6rem;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green-light);
  letter-spacing: -0.3px;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0.75rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.65rem 0.9rem;
  text-align: left;
  transition: all var(--transition);
  width: 100%;
}

.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--green-glow);
  color: var(--green-light);
  border: 1px solid rgba(63, 185, 80, 0.2);
}

.nav-icon, .nav-icon-emoji {
  font-size: 1.2rem;
  width: 1.8rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}


.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
}

.user-avatar {
  width: 2rem;
  height: 2rem;
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.btn-logout {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem 0.5rem;
  transition: all var(--transition);
}

.btn-logout:hover {
  border-color: var(--danger);
  color: var(--danger-light);
}

/* ── Main Content ────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2rem;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════
   MODULE HEADER
═══════════════════════════════════════════════ */
.module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.module-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}

.module-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* ═══════════════════════════════════════════════
   TABS
═══════════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.6rem 1rem;
  margin-bottom: -1px;
  transition: all var(--transition);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  border-bottom-color: var(--green-light);
  color: var(--green-light);
}

/* ═══════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════
   TABLE
═══════════════════════════════════════════════ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead tr {
  background: var(--bg-elevated);
}

thead th {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--bg-elevated);
}

tbody td {
  color: var(--text-primary);
  padding: 1rem 1.25rem;
  vertical-align: middle;
}

.td-icon {
  width: 60px;
  text-align: center;
  color: var(--green-light);
}

.td-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

.btn-icon-action {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon-action:hover {
  background: var(--bg-card);
  color: var(--green-light);
  border-color: var(--green-mid);
  transform: translateY(-2px);
}

.btn-icon-action.delete:hover {
  color: var(--danger-light);
  border-color: var(--danger);
}


.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-green {
  background: var(--green-glow);
  color: var(--green-light);
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.badge-amber {
  background: var(--amber-glow);
  color: var(--amber-light);
  border: 1px solid rgba(212, 160, 23, 0.3);
}

.badge-red {
  background: var(--danger-glow);
  color: var(--danger-light);
  border: 1px solid rgba(218, 54, 51, 0.3);
}

/* ═══════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  gap: 0.75rem;
  text-align: center;
}

.empty-state-icon {
  font-size: 3rem;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════
   MODAL
═══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(35, 134, 54, 0.08);
  max-width: 540px;
  width: 100%;
  animation: slideUp 0.25s ease;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

/* Modal form layout */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ═══════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green-mid);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.875rem;
  min-width: 280px;
  max-width: 380px;
  padding: 0.75rem 1rem;
  animation: slideInRight 0.3s ease;
}

.toast.toast-error {
  border-left-color: var(--danger);
}

.toast.toast-warning {
  border-left-color: var(--amber);
}

.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.toast-msg {
  flex: 1;
  color: var(--text-primary);
}

/* ── Search bar ──────────────────────────────── */
.search-bar {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.875rem;
  outline: none;
  transition: border-color var(--transition);
  width: 220px;
}

.search-bar:focus {
  border-color: var(--green-mid);
}

/* ── Info detail ─────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.detail-item label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.2rem;
}

.detail-item span {
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(30px);
  }
}

/* ── Dropdown Actions ────────────────────────── */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  display: none;
  flex-direction: column;
  padding: 0.5rem;
  z-index: 1000;
  margin-top: 0.25rem;
  animation: slideUp 0.15s ease;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.dropdown-item:hover {
  background: var(--bg-card);
  color: var(--green-light);
}

.hidden {
  display: none !important;
}

.muu-hidden {
  display: none !important;
}

.dropdown-item.text-danger:hover {
  color: var(--danger-light);
  background: var(--danger-glow);
}

.btn-dots {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1.2rem;
  line-height: 1;
}

.btn-dots:hover {
  border-color: var(--green-mid);
  color: var(--green-light);
  background: var(--green-glow);
}