/* ==========================================================================
   STAYBHARAT ADMIN PANEL — standalone stylesheet
   This subdomain does NOT load the main site's CSS. Everything the panel
   needs (design tokens, reset, status chips, toast, panel UI) lives here.
   ========================================================================== */

:root {
  /* Brand Colors */
  --primary-gold: #F5A623;
  --primary-gold-hover: #E09612;
  --primary-amber: #F39C12;
  
  --dark-navy: #0B192C;
  --dark-navy-deep: #081220;
  --dark-navy-card: #10223B;
  
  --text-main: #1E293B;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --text-white: #FFFFFF;
  
  --bg-page: #FFFFFF;
  --bg-subtle: #F8FAFC;
  --bg-card: #FFFFFF;
  
  --border-light: #E2E8F0;
  --border-subtle: #F1F5F9;
  
  --rating-green: #10B981;
  
  /* Typography */
  --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

input, select {
  font-family: inherit;
  outline: none;
}


/* ---------- Status chips (icon + label always accompany the colour) ---------- */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 20px;
  padding: 4px 11px;
  white-space: nowrap;
}

.status-confirmed { background: #ECFDF5; color: #047857; }
.status-pending   { background: #FEF3C7; color: #B45309; }
.status-cancelled { background: #FEE2E2; color: #B91C1C; }

.filter-option {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  color: #334155;
  padding: 4px 0;
  cursor: pointer;
}

.filter-option input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary-gold);
  cursor: pointer;
  flex-shrink: 0;
}

.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0F172A;
  color: #FFFFFF;
  border-left: 4px solid #F5A623;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

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


/* ==========================================================================
   STAYBHARAT - Partner & Admin Panel
   Loads after css/style.css and reuses its design tokens.
   ========================================================================== */

.panel-body {
  background: #F4F6F9;
  min-height: 100vh;
}

/* ---------- Login gate ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #0B192C 0%, #10223B 55%, #16304F 100%);
}

.login-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 32px 30px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.login-brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--dark-navy);
}

.login-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.demo-note {
  background: #FFFBF2;
  border: 1px solid #FDE7BF;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.76rem;
  color: #92400E;
  line-height: 1.5;
  margin-top: 14px;
}

/* ---------- Shell ---------- */
.panel-shell {
  display: grid;
  grid-template-columns: 246px 1fr;
  min-height: 100vh;
}

.panel-sidebar {
  background: var(--dark-navy);
  color: #CBD5E1;
  padding: 16px 0 24px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
}

.sidebar-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand .sb-name {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 900;
  color: #FFFFFF;
  line-height: 1.1;
}

.sidebar-brand .sb-name span {
  color: var(--primary-gold);
}

.sidebar-brand .sb-role {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #64748B;
}

.sidebar-section {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #64748B;
  padding: 12px 18px 6px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 18px;
  font-size: 0.87rem;
  font-weight: 600;
  color: #CBD5E1;
  border-left: 3px solid transparent;
  transition: background var(--transition-fast), color var(--transition-fast);
  width: 100%;
  text-align: left;
}

.side-link i {
  width: 17px;
  text-align: center;
  font-size: 0.92rem;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
}

.side-link.active {
  background: rgba(245, 166, 35, 0.13);
  border-left-color: var(--primary-gold);
  color: var(--primary-gold);
}

.side-link .side-count {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 8px;
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.74rem;
  color: #64748B;
}

/* ---------- Main area ---------- */
.panel-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.panel-topbar {
  background: #FFFFFF;
  border-bottom: 1px solid #E5E9F0;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.panel-topbar h1 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--dark-navy);
}

.panel-topbar .top-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #E5E9F0;
  border-radius: 30px;
  padding: 5px 12px 5px 5px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--dark-navy);
  color: var(--primary-gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 800;
}

.user-pill .u-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dark-navy);
  line-height: 1.15;
}

.user-pill .u-role {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.panel-content {
  padding: 22px 24px 44px;
}

.panel-section {
  display: none;
}

.panel-section.active {
  display: block;
}

.mobile-panel-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  font-size: 1.25rem;
  color: var(--dark-navy);
}

/* ---------- Cards ---------- */
.panel-card {
  background: #FFFFFF;
  border: 1px solid #E5E9F0;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.panel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel-card-head h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--dark-navy);
}

.panel-card-head .card-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- KPI tiles ---------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-tile {
  background: #FFFFFF;
  border: 1px solid #E5E9F0;
  border-radius: 12px;
  padding: 16px 18px;
}

.kpi-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: #6B7280;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}

.kpi-label i {
  color: var(--primary-amber);
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0B0B0B;
  line-height: 1.05;
  letter-spacing: -0.5px;
}

.kpi-foot {
  font-size: 0.74rem;
  color: #6B7280;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.delta-up { color: #006300; font-weight: 700; }
.delta-down { color: #D03B3B; font-weight: 700; }

/* ---------- Charts (single series, direct-labelled) ---------- */
.chart-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 190px;
  padding-top: 22px;
  border-bottom: 1px solid #C3C2B7;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
}

.bar-mark {
  width: 100%;
  max-width: 46px;
  background: #D97706;
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  transition: opacity var(--transition-fast);
}

.bar-col:hover .bar-mark {
  opacity: 0.82;
}

.bar-value {
  position: absolute;
  top: -20px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #52514E;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bar-axis {
  display: flex;
  gap: 14px;
  margin-top: 7px;
}

.bar-axis span {
  flex: 1;
  text-align: center;
  font-size: 0.74rem;
  color: #898781;
}

.chart-caption {
  font-size: 0.74rem;
  color: #898781;
  margin-top: 10px;
}

/* status breakdown — colour never alone: icon + label + count always shown */
.status-bar-row {
  display: grid;
  grid-template-columns: 128px 1fr 52px;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
}

.status-bar-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #0B0B0B;
}

.status-bar-track {
  display: block;
  width: 100%;
  background: #EEF1F6;
  border-radius: 4px;
  height: 12px;
  overflow: hidden;
}

.status-bar-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  min-width: 3px;
}

.fill-good     { background: #0CA30C; }
.fill-warning  { background: #FAB219; }
.fill-critical { background: #D03B3B; }

.ink-good     { color: #0CA30C; }
.ink-warning  { color: #B45309; }
.ink-critical { color: #D03B3B; }

.status-bar-count {
  text-align: right;
  font-size: 0.84rem;
  font-weight: 700;
  color: #0B0B0B;
  font-variant-numeric: tabular-nums;
}

/* ---------- Tables ---------- */
.table-scroll {
  overflow-x: auto;
}

.panel-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.panel-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6B7280;
  padding: 9px 12px;
  border-bottom: 1px solid #E5E9F0;
  white-space: nowrap;
}

.panel-table td {
  padding: 11px 12px;
  font-size: 0.84rem;
  color: #1E293B;
  border-bottom: 1px solid #F1F4F9;
  vertical-align: middle;
}

.panel-table tr:last-child td {
  border-bottom: 0;
}

.panel-table tbody tr:hover {
  background: #FAFBFD;
}

.panel-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-strong {
  font-weight: 700;
  color: var(--dark-navy);
}

.cell-muted {
  font-size: 0.76rem;
  color: #6B7280;
}

.code-cell {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary-amber);
  letter-spacing: 0.4px;
  white-space: nowrap;
}

/* ---------- Toolbar / filters ---------- */
.panel-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel-toolbar input[type="search"],
.panel-toolbar input[type="text"],
.panel-toolbar select {
  border: 1px solid #E5E9F0;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 0.84rem;
  background: #FFFFFF;
  color: #1E293B;
  font-family: inherit;
}

.panel-toolbar input[type="search"] {
  min-width: 240px;
}

.filter-tab {
  border: 1px solid #E5E9F0;
  background: #FFFFFF;
  border-radius: 30px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}

.filter-tab.active {
  background: var(--dark-navy);
  border-color: var(--dark-navy);
  color: #FFFFFF;
}

/* ---------- Buttons ---------- */
.btn-panel {
  background: var(--primary-gold);
  color: var(--dark-navy);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 15px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

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

.btn-panel-dark {
  background: var(--dark-navy);
  color: #FFFFFF;
}

.btn-panel-dark:hover { background: #1E3A8A; }

.btn-panel-ghost {
  background: #FFFFFF;
  border: 1px solid #E5E9F0;
  color: var(--dark-navy);
}

.btn-panel-ghost:hover { border-color: #CBD5E1; }

.btn-mini {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #E5E9F0;
  background: #FFFFFF;
  color: #334155;
  white-space: nowrap;
}

.btn-mini:hover { border-color: #CBD5E1; }
.btn-mini.approve { color: #047857; border-color: #A7F3D0; background: #ECFDF5; }
.btn-mini.reject  { color: #B91C1C; border-color: #FECACA; background: #FEF2F2; }

/* ---------- Forms ---------- */
.panel-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.panel-field label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 5px;
}

.panel-field input,
.panel-field select,
.panel-field textarea {
  width: 100%;
  border: 1px solid #E5E9F0;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 0.86rem;
  color: #1E293B;
  background: #FFFFFF;
  font-family: inherit;
}

.panel-field input:focus,
.panel-field select:focus,
.panel-field textarea:focus {
  border-color: var(--primary-gold);
}

.panel-field.full { grid-column: 1 / -1; }

.panel-field .field-hint {
  font-size: 0.72rem;
  color: #6B7280;
  margin-top: 4px;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}

.photo-thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #E5E9F0;
  aspect-ratio: 4 / 3;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb .photo-del {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(11, 25, 44, 0.82);
  color: #FFFFFF;
  border-radius: 6px;
  width: 22px;
  height: 22px;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.photo-add {
  border: 1.5px dashed #CBD5E1;
  border-radius: 8px;
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #6B7280;
  font-size: 0.76rem;
  font-weight: 600;
  background: #FAFBFD;
}

.photo-add:hover { border-color: var(--primary-gold); color: var(--primary-amber); }

/* ---------- Inventory editor ---------- */
.inv-input {
  width: 78px;
  border: 1px solid #E5E9F0;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.82rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  color: #1E293B;
}

.inv-input:focus { border-color: var(--primary-gold); }

.inv-input.changed {
  border-color: var(--primary-gold);
  background: #FFFBF2;
}

.save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #FFFBF2;
  border: 1px solid #FDE7BF;
  border-radius: 10px;
  padding: 11px 14px;
  margin-top: 14px;
}

.save-bar p {
  font-size: 0.8rem;
  color: #92400E;
}

/* ---------- Empty state ---------- */
.panel-empty {
  text-align: center;
  padding: 40px 20px;
  color: #6B7280;
  font-size: 0.86rem;
}

.panel-empty i {
  display: block;
  font-size: 1.8rem;
  color: #CBD5E1;
  margin-bottom: 10px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1080px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .panel-shell { grid-template-columns: 1fr; }
  .panel-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 246px;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    height: 100vh;
  }
  .panel-sidebar.open { transform: translateX(0); }
  .mobile-panel-toggle { display: inline-flex; }
  .panel-content { padding: 18px 16px 40px; }
  .panel-topbar { padding: 11px 16px; }
  .panel-form-grid { grid-template-columns: 1fr; }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 25, 44, 0.5);
    z-index: 55;
    display: none;
  }
  .sidebar-backdrop.show { display: block; }
}

@media (max-width: 640px) {
  /* keep the topbar on one line: avatar only, no "View Site" button */
  .user-pill { padding: 4px; }
  .user-pill > span:not(.user-avatar) { display: none; }
  .topbar-actions .btn-panel-ghost { display: none; }
  .panel-topbar h1 { font-size: 1.05rem; }
  .panel-topbar .top-sub { display: none; }
}

@media (max-width: 560px) {
  .kpi-row { grid-template-columns: 1fr; }
  .bar-chart { height: 150px; gap: 8px; }
  .bar-axis { gap: 8px; }
  .status-bar-row { grid-template-columns: 108px 1fr 42px; }
}

/* Print — reports */
@media print {
  .panel-sidebar, .panel-topbar, .panel-toolbar, .save-bar { display: none !important; }
  .panel-shell { grid-template-columns: 1fr; }
  .panel-card { break-inside: avoid; }
}

/* ---------- Sign-in extras (Google button, divider, notes) ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
  color: #94A3B8;
  font-size: 0.74rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E5E9F0;
}

.auth-note {
  font-size: 0.78rem;
  line-height: 1.55;
  margin-top: 12px;
  text-align: center;
  color: #64748B;
}

.auth-note.error   { color: #B91C1C; }
.auth-note.success { color: #047857; }

.demo-note code {
  background: rgba(146, 64, 14, 0.1);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.72rem;
}
