/* ==========================================================================
   HOSTEL PAPAI — admin.css
   ========================================================================== */

:root {
  --teal:       #187387;
  --teal-dark:  #125f71;
  --teal-light: #e8f4f7;
  --gold:       #F0BB67;
  --gold-dark:  #c99433;
  --navy:       #0F3C63;
  --white:      #ffffff;
  --off-white:  #f4f6f9;
  --border:     #e2e8f0;
  --text:       #1a2535;
  --text-muted: #6b7a8d;
  --danger:     #e53e3e;
  --success:    #38a169;
  --sidebar-w:  260px;
  --topbar-h:   64px;
  --shadow-sm:  0 1px 4px rgba(0,0,0,.08);
  --shadow-md:  0 4px 20px rgba(0,0,0,.1);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.14);
  --radius:     12px;
  --tr:         .25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Montserrat', sans-serif;
  color: var(--text);
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ---- LOGIN ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
  padding: 24px;
}
.login-card {
  background: white;
  border-radius: 20px;
  padding: 48px 40px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
  text-align: center;
}
.login-logo { margin-bottom: 24px; }
.login-logo img { margin: 0 auto; height: 52px; object-fit: contain; }
.login-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}
.login-sub { font-size: .85rem; color: var(--text-muted); margin-bottom: 32px; }

.field-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; text-align: left; }
.field-group label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--navy);
}
.field-input {
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: .9rem;
  color: var(--text);
  background: var(--off-white);
  outline: none;
  transition: border-color var(--tr);
  width: 100%;
}
.field-input:focus { border-color: var(--teal); background: white; }
.field-hint { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

.pw-wrapper { position: relative; }
.pw-wrapper .field-input { padding-right: 48px; }
.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: .6;
  transition: opacity var(--tr);
}
.pw-toggle:hover { opacity: 1; }

.login-error {
  color: var(--danger);
  font-size: .85rem;
  font-weight: 600;
  min-height: 20px;
  margin-bottom: 12px;
  text-align: left;
}
.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--teal);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  transition: background var(--tr), transform var(--tr);
}
.btn-login:hover { background: var(--teal-dark); transform: translateY(-1px); }
.login-back {
  display: block;
  margin-top: 20px;
  font-size: .85rem;
  color: var(--text-muted);
  transition: color var(--tr);
}
.login-back:hover { color: var(--teal); }

/* ---- DASHBOARD LAYOUT ---- */
.dashboard {
  display: flex;
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--teal);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--tr);
  overflow-y: auto;
}
.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.15);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.sidebar-logo img { filter: brightness(0) invert(1); height: 38px; object-fit: contain; }
.sidebar-tagline { font-size: .7rem; color: rgba(255,255,255,.6); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 12px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: rgba(255,255,255,.75);
  font-size: .875rem;
  font-weight: 600;
  transition: background var(--tr), color var(--tr);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.12); color: white; }
.nav-item.active { background: rgba(255,255,255,.2); color: white; }

.sidebar-footer {
  padding: 16px 12px 24px;
  border-top: 1px solid rgba(255,255,255,.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  color: rgba(255,255,255,.85);
  font-size: .875rem;
  font-weight: 600;
  transition: background var(--tr);
}
.btn-logout svg { width: 16px; height: 16px; }
.btn-logout:hover { background: rgba(255,255,255,.2); color: white; }
.sidebar-site-link {
  text-align: center;
  font-size: .78rem;
  color: rgba(255,255,255,.5);
  transition: color var(--tr);
}
.sidebar-site-link:hover { color: rgba(255,255,255,.85); }

/* ---- MAIN CONTENT ---- */
.main-content {
  min-width: 0;
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: var(--topbar-h);
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.hamburger-admin {
  background: none;
  border: none;
  padding: 6px;
  display: none;
}
.hamburger-admin svg { width: 22px; height: 22px; color: var(--navy); }
.topbar-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.topbar-info span { font-size: .875rem; font-weight: 700; color: var(--navy); }
.topbar-time { font-size: .75rem !important; font-weight: 500 !important; color: var(--text-muted) !important; }

.section-content { padding: 32px; flex: 1; }
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-header h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}
.section-header p { font-size: .875rem; color: var(--text-muted); }

/* ---- STATS CARDS ---- */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat-card-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 8px; }
.stat-card-value {
  font-family: 'Poppins', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--teal);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card-sub { font-size: .8rem; color: var(--text-muted); }

/* ---- PANEL GRID ---- */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}
.panel-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.panel-card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

/* ---- SEASON DISPLAY ---- */
.season-display-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--teal-light);
  border-radius: 10px;
}
.season-display-emoji { font-size: 2.5rem; }
.season-display-name {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
}
.season-display-period { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }

.prices-list { display: flex; flex-direction: column; gap: 12px; }
.price-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--off-white);
  border-radius: 8px;
  font-size: .9rem;
}
.price-list-item .p-label { color: var(--text-muted); }
.price-list-item .p-value { font-weight: 800; color: var(--teal); font-family: 'Poppins', sans-serif; }

/* ---- TABLE ---- */
.table-wrapper {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: auto;
  box-shadow: var(--shadow-sm);
}
.seasons-table { width: 100%; border-collapse: collapse; }
.seasons-table th {
  padding: 14px 16px;
  background: var(--off-white);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: normal;
}
.seasons-table td {
  padding: 14px 16px;
  font-size: .875rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.seasons-table tbody tr:last-child td { border-bottom: none; }
.seasons-table tbody tr:hover { background: #fafbfc; }
.season-emoji-cell { font-size: 1.4rem; }
.price-cell { font-weight: 700; color: var(--teal); font-family: 'Poppins', sans-serif; }
.badge-min-nights {
  display: inline-block;
  background: rgba(240,187,103,.2);
  color: var(--gold-dark);
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 700;
}
.active-season-row { background: rgba(24,115,135,.04) !important; }
.active-season-row td:first-child { border-left: 3px solid var(--teal); }

/* ---- BUTTONS ---- */
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 700;
  font-size: .875rem;
  border: none;
  transition: all var(--tr);
  white-space: nowrap;
}
.btn-teal { background: var(--teal); color: white; }
.btn-teal:hover { background: var(--teal-dark); transform: translateY(-1px); }
.btn-outline-navy {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-outline-navy:hover { background: var(--navy); color: white; }
.btn-ghost-adm {
  background: var(--off-white);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost-adm:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c53030; }
.btn-edit { background: var(--teal-light); color: var(--teal); border: 1px solid rgba(24,115,135,.2); padding: 6px 14px; }
.btn-edit:hover { background: var(--teal); color: white; }
.btn-del { background: #fff5f5; color: var(--danger); border: 1px solid rgba(229,62,62,.2); padding: 6px 14px; }
.btn-del:hover { background: var(--danger); color: white; }

/* ---- CONFIG GRID ---- */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
}
.config-msg { font-size: .85rem; font-weight: 600; min-height: 20px; margin-top: 8px; }
.config-msg.success { color: var(--success); }
.config-msg.error   { color: var(--danger); }

/* ---- MODAL ---- */
.modal-overlay-adm {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease;
}
.modal-overlay-adm.open { opacity: 1; pointer-events: auto; visibility: visible; }
.modal-box-adm {
  background: white;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(0,0,0,.2);
  transform: translateY(24px);
  transition: transform .3s ease;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-overlay-adm.open .modal-box-adm { transform: translateY(0); }
.modal-head-adm {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--off-white);
}
.modal-head-adm h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy);
}
.modal-close-adm {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  line-height: 1;
  transition: color var(--tr);
}
.modal-close-adm:hover { color: var(--text); }
#season-form { padding: 24px 28px; }
.modal-grid-adm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.field-span2 { grid-column: span 2; }
.season-form-error { color: var(--danger); font-size: .85rem; font-weight: 600; min-height: 18px; margin-bottom: 12px; }
.modal-foot-adm {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--navy);
  color: white;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: .875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 99999;
  transform: translateY(80px);
  opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
  pointer-events: none;
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }

/* ---- RESPONSIVE ---- */
:where(a, button, input, select, textarea):focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
:where(a, button) { touch-action: manipulation; }
.field-group, .panel-card, .config-grid > *, .stats-cards > *, .section-header > * { min-width: 0; }
.btn-action { min-height: 44px; max-width: 100%; white-space: normal; justify-content: center; text-align: center; }
.btn-action svg { flex-shrink: 0; }
.field-input { min-width: 0; }
.pw-toggle { width: 44px; height: 44px; right: 4px; }
.hamburger-admin, .modal-close-adm { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; flex-shrink: 0; }
.login-back, .sidebar-site-link { min-height: 44px; display: flex; align-items: center; justify-content: center; }
.topbar { flex-shrink: 0; }
.section-header p, .field-hint, .config-msg, .price-list-item, .stat-card { overflow-wrap: anywhere; }
.price-list-item { gap: 12px; flex-wrap: wrap; }
.table-wrapper { width: 100%; max-width: 100%; }
.seasons-table { min-width: 680px; }
.modal-head-adm { gap: 16px; }
.toast { max-width: min(320px, calc(100vw - 32px)); overflow-wrap: anywhere; }
.login-page, .dashboard, .main-content { min-height: 100svh; }
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
    visibility: hidden;
    width: min(var(--sidebar-w), calc(100% - 64px));
  }
  .sidebar.open {
    transform: translateX(0);
    visibility: visible;
    box-shadow: var(--shadow-lg);
  }
  .main-content { margin-left: 0; }
  .hamburger-admin { display: flex; }
  .modal-grid-adm { grid-template-columns: 1fr; }
  .field-span2 { grid-column: span 1; }
  .panel-grid { grid-template-columns: 1fr; }
  .topbar { z-index: 110; }
  .sidebar { top: var(--topbar-h); }
  .field-input { font-size: 1rem; min-height: 48px; }
}
@media (max-width: 480px) {
  .section-content { padding: 20px 16px; }
  .login-card { padding: 36px 24px 28px; }
  .topbar { padding: 0 16px; }
  .login-page { padding: 16px; }
  .panel-card, .stat-card { padding: 20px; }
  .modal-overlay-adm { padding: 12px; }
  .modal-box-adm { max-height: calc(100dvh - 24px); }
  .modal-head-adm, #season-form { padding: 20px; }
  .modal-foot-adm { flex-wrap: wrap; }
  .modal-foot-adm .btn-action { flex: 1; }
  .season-display-card { flex-wrap: wrap; }
  .section-header > .btn-action { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
