/* Aspire Hotels Backoffice — Design System */
:root {
  --color-primary:          #91A096;
  --color-primary-hover:    #7A897E;
  --color-primary-soft:     #E8EDEA;
  --color-primary-disabled: #C5CFCA;
  --color-on-primary:       #FFFFFF;

  --color-ink:          #1A1F1C;
  --color-body:         #3A4240;
  --color-muted:        #6B7775;
  --color-muted-soft:   #A0ABAA;

  --color-canvas:         #FFFFFF;
  --color-surface-soft:   #F6F8F6;
  --color-surface-card:   #EEF2EE;
  --color-surface-strong: #E2E8E3;
  --color-hairline:       #D8DED9;
  --color-hairline-soft:  #E8EDE9;

  --color-surface-dark:          #1A1F1C;
  --color-surface-dark-elevated: #2C3530;
  --color-on-dark:               #FFFFFF;
  --color-on-dark-soft:          #B8C4BF;

  --color-accent:      #C4A35A;
  --color-accent-soft: #F5EDD6;

  --color-success:      #16A34A;
  --color-success-soft: #DCFCE7;
  --color-warning:      #D97706;
  --color-warning-soft: #FEF3C7;
  --color-error:        #DC2626;
  --color-error-soft:   #FEE2E2;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-pill: 9999px;

  --sidebar-width:  240px;
  --topbar-height:  56px;

  --ease: cubic-bezier(0.2, 0.0, 0.0, 1.0);
  --dur-fast: 120ms;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--color-body);
  background: var(--color-canvas);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font: inherit; }

/* ── App layout ── */
.app-layout { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface-dark);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 16px 12px;
}
.sidebar-brand {
  padding: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 16px;
}
.sidebar-brand-name {
  color: var(--color-on-dark);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.sidebar-brand-sub {
  color: var(--color-on-dark-soft);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}
.sidebar-label {
  color: var(--color-on-dark-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 12px;
  margin-bottom: 4px;
  margin-top: 16px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--color-on-dark-soft);
  font-size: 13px;
  font-weight: 500;
  height: 40px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.nav-item:hover { background: var(--color-surface-dark-elevated); color: var(--color-on-dark); }
.nav-item.active { background: rgba(145,160,150,.18); color: var(--color-on-dark); }
.nav-item svg { flex-shrink: 0; opacity: .65; }
.nav-item:hover svg, .nav-item.active svg { opacity: 1; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px; }
.sidebar-avatar {
  width: 32px; height: 32px;
  background: var(--color-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.sidebar-user-name {
  color: var(--color-on-dark);
  font-size: 13px; font-weight: 500;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-user-role { color: var(--color-on-dark-soft); font-size: 11px; }

/* ── Main area ── */
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }

.topbar {
  height: var(--topbar-height);
  background: var(--color-canvas);
  border-bottom: 1px solid var(--color-hairline);
  display: flex; align-items: center;
  padding: 0 32px; flex-shrink: 0; gap: 16px;
}
.topbar-title {
  font-size: 18px; font-weight: 600;
  color: var(--color-ink); letter-spacing: -0.01em; flex: 1;
}

.content {
  flex: 1; overflow-y: auto;
  padding: 32px;
  background: var(--color-surface-soft);
}

/* ── Cards ── */
.card {
  background: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(54,60,56,.08);
}
.card + .card { margin-top: 16px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--color-ink); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}
.stat-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-muted); margin-bottom: 6px;
}
.stat-value {
  font-size: 28px; font-weight: 600;
  color: var(--color-ink); letter-spacing: -0.015em; line-height: 1.1;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; height: 40px;
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500; line-height: 1;
  cursor: pointer; border: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-secondary {
  background: var(--color-canvas); color: var(--color-ink);
  border: 1px solid var(--color-hairline);
}
.btn-secondary:hover { background: var(--color-surface-card); border-color: var(--color-surface-strong); }
.btn-sm { height: 32px; padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--color-surface-soft); }
th {
  padding: 10px 16px; text-align: left;
  font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-muted);
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-hairline-soft);
  color: var(--color-body); font-size: 14px;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--color-surface-soft); }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}
.badge-success { background: var(--color-success-soft); color: var(--color-success); }
.badge-warning { background: var(--color-warning-soft); color: var(--color-warning); }
.badge-neutral { background: var(--color-surface-strong); color: var(--color-muted); }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.span2 { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 500; color: var(--color-ink); }
.hint { font-size: 12px; color: var(--color-muted); }

input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], select, textarea {
  width: 100%; height: 40px; padding: 10px 12px;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-sm);
  background: var(--color-canvas); color: var(--color-ink); font-size: 14px;
  transition: border-color var(--dur-fast) var(--ease);
}
textarea { height: auto; min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(145,160,150,.3);
  outline-offset: 0; border-color: var(--color-primary);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7775' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 36px;
}
.form-divider {
  margin-top: 24px; padding-top: 24px;
  border-top: 1px solid var(--color-hairline);
}
.section-title { font-size: 13px; font-weight: 600; color: var(--color-muted); margin-bottom: 16px; text-transform: uppercase; letter-spacing: .06em; }
.form-actions {
  display: flex; gap: 12px;
  margin-top: 24px; padding-top: 24px;
  border-top: 1px solid var(--color-hairline);
}

/* ── Alerts ── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 14px; margin-bottom: 20px;
}
.alert-error {
  background: var(--color-error-soft); color: var(--color-error);
  border: 1px solid rgba(220,38,38,.2);
}
.alert-warning {
  background: var(--color-warning-soft); color: var(--color-warning);
  border: 1px solid rgba(217,119,6,.2);
}

/* ── Empty state ── */
.empty { text-align: center; padding: 64px 32px; }
.empty h3 { font-size: 16px; font-weight: 600; color: var(--color-ink); margin-bottom: 8px; }
.empty p { font-size: 14px; color: var(--color-muted); margin-bottom: 24px; }

/* ── Detail view ── */
.detail-grid { display: flex; flex-direction: column; }
.detail-field {
  display: flex; flex-direction: row; align-items: flex-start;
  padding: 10px 0; gap: 24px;
  border-bottom: 1px solid var(--color-hairline-soft);
}
.detail-field:last-child { border-bottom: none; }
.detail-label {
  font-size: 12px; font-weight: 500; color: var(--color-muted);
  width: 200px; flex-shrink: 0; padding-top: 1px;
  font-family: var(--font-sans);
}
.detail-value {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--color-ink); flex: 1; line-height: 1.6;
}

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  background: var(--color-surface-soft);
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
}
.auth-card {
  background: var(--color-canvas);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%; max-width: 400px;
  box-shadow: 0 4px 24px rgba(54,60,56,.08);
}
.auth-card.wide { max-width: 480px; }
.auth-logo {
  display: flex; flex-direction: column;
  align-items: center; margin-bottom: 32px;
}
.auth-logo-mark {
  width: 48px; height: 48px;
  background: var(--color-primary);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.auth-logo-name { font-size: 18px; font-weight: 600; color: var(--color-ink); }
.auth-logo-sub { font-size: 13px; color: var(--color-muted); margin-top: 2px; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; margin-bottom: 6px; }
