:root {
  --black: #050505;
  --black-soft: #0e0e0e;
  --black-card: #121212;
  --white: #fafaf8;
  --muted: rgba(250, 250, 248, 0.62);
  --gold: #c9a962;
  --gold-light: #e8d5a3;
  --gold-dark: #8a7340;
  --border: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(201, 169, 98, 0.35);
  --ok: #3d9a6a;
  --bad: #a35a5a;
  --radius: 12px;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--gold-light); }

.hidden { display: none !important; }

.screen {
  min-height: 100vh;
}

/* Login */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201, 169, 98, 0.12), transparent 55%),
    var(--black);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--black-card);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand img {
  height: 56px;
  width: auto;
  margin-bottom: 12px;
}

.login-brand h1 {
  font-size: 1.35rem;
  font-weight: 800;
}

.login-brand p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--black-soft);
  color: var(--white);
  font: inherit;
  margin-bottom: 14px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.25);
}

textarea { min-height: 90px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  border: 2px solid var(--gold);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
  color: var(--black);
  width: 100%;
}

.btn-primary:hover { filter: brightness(1.06); }

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: var(--border);
}

.btn-ghost:hover { border-color: var(--gold); color: var(--gold-light); }

.btn-danger {
  background: transparent;
  color: #f0b4b4;
  border-color: rgba(163, 90, 90, 0.7);
}

.btn-sm { padding: 8px 12px; font-size: 0.85rem; width: auto; }

.error-msg {
  color: #f0b4b4;
  font-size: 0.875rem;
  margin: 8px 0 12px;
  min-height: 1.2em;
}

/* App shell */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(18, 18, 18, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.app-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-row img { height: 40px; width: auto; }

.brand-row strong { font-size: 1rem; }

.user-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.role-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(201, 169, 98, 0.15);
  color: var(--gold-light);
  border: 1px solid var(--border-gold);
}

.tabs {
  display: flex;
  gap: 8px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px 0;
}

.tab-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
}

.tab-btn.is-active {
  color: var(--gold-light);
  border-color: var(--border-gold);
  background: rgba(201, 169, 98, 0.1);
}

main.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

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

.panel-head h2 { font-size: 1.35rem; font-weight: 800; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 720px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

.card {
  background: var(--black-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #1a1a1a;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.ok { background: rgba(61, 154, 106, 0.95); }
.badge.bad { background: rgba(163, 90, 90, 0.95); }

.card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.card-body .type {
  font-size: 0.72rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.form-card {
  background: var(--black-card);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 14px;
}

@media (min-width: 640px) {
  .form-row.two { grid-template-columns: 1fr 1fr; }
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.check-row input { width: auto; margin: 0; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th, .table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
}

.table th { color: var(--gold-light); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }

.empty {
  color: var(--muted);
  padding: 28px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--black-card);
  border: 1px solid var(--border-gold);
  color: var(--white);
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,.4);
  z-index: 50;
  max-width: 320px;
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 4px 0 12px;
  line-height: 1.45;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--gold);
  color: #111;
  font-size: 0.7rem;
  font-weight: 700;
}

.card-price {
  color: var(--gold-light);
  font-weight: 700;
  font-size: 0.95rem;
}

.card-until {
  font-size: 0.8rem;
  color: var(--muted);
}

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

.inquiry-card {
  background: var(--black-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.inquiry-card.is-done { opacity: 0.72; border-color: var(--border); }
.inquiry-card.is-rejected { opacity: 0.65; border-color: rgba(163, 90, 90, 0.5); }
.inquiry-card.is-reserved { border-color: rgba(201, 169, 98, 0.55); }

.inquiry-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 10px;
}

.inquiry-top h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.inquiry-meta {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.inquiry-meta a { color: var(--gold-light); }

.inquiry-msg {
  margin: 10px 0 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  font-size: 0.9rem;
  white-space: pre-wrap;
  line-height: 1.45;
}

.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.status-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color .15s, background .15s, color .15s;
}

.status-btn svg { width: 20px; height: 20px; }

.status-btn:hover { border-color: var(--border-gold); color: var(--gold-light); }

.status-btn.is-active[data-status="done"] {
  background: rgba(61, 154, 106, 0.25);
  border-color: #3d9a6a;
  color: #6dcea0;
}
.status-btn.is-active[data-status="processing"] {
  background: rgba(201, 169, 98, 0.2);
  border-color: var(--gold);
  color: var(--gold-light);
}
.status-btn.is-active[data-status="reserved"] {
  background: rgba(90, 140, 200, 0.25);
  border-color: #5a8cc8;
  color: #8eb6e8;
}
.status-btn.is-active[data-status="rejected"] {
  background: rgba(163, 90, 90, 0.3);
  border-color: #a35a5a;
  color: #e09090;
}

.status-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-left: 4px;
}

.inquiry-actions {
  margin-left: auto;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.modal-card {
  position: relative;
  width: min(420px, 100%);
  background: var(--black-card);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.modal-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

input[type="date"],
input[type="time"] {
  color-scheme: dark;
}
