:root {
  --primary: #1e3a8a;
  --primary-hover: #1e40af;
  --secondary: #475569;
  --accent: #0ea5e9;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  
  --status-draft: #94a3b8;
  --status-confirmed: #0284c7;
  --status-pending: #eab308;
  --status-paid: #10b981;
  --status-checkedin: #059669;
  --status-checkedout: #64748b;
  --status-cancelled: #ef4444;
  --status-noshow: #831843;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background-color: #0f172a;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid #1e293b;
}

.sidebar-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #38bdf8;
}

.sidebar-header .hotel-name {
  font-size: 0.8rem;
  color: #94a3b8;
}

.nav-links {
  list-style: none;
  padding: 12px 8px;
  flex-grow: 1;
}

.nav-links li {
  margin-bottom: 4px;
}

.nav-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 14px 12px 6px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 8px;
}
.nav-section-title:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 4px;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.nav-links a:hover, .nav-links a.active {
  background-color: #1e293b;
  color: #38bdf8;
  font-weight: 600;
}

/* Main Content */
.main-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.topbar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-left {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.88rem;
  color: var(--text-main);
  white-space: nowrap;
  flex-shrink: 0;
}

.user-profile-badge .badge-role {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: #fecaca;
  color: #991b1b;
  transform: translateY(-1px);
}


.content-container {
  padding: 24px;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
}

/* Common Components */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.booking-header-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  margin-left: auto;
}

.booking-actions-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.booking-header-actions .btn,
.booking-actions-row .btn {
  height: 36px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-body {
  padding: 20px;
}

/* Grid & Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.booking-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

@media (max-width: 1100px) {
  .booking-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  }
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  border-left: 4px solid var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 4px;
}

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

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

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

th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-muted);
}

tr:hover td {
  background-color: #f1f5f9;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
}

.badge-draft { background: #f1f5f9; color: #475569; }
.badge-confirmed { background: #e0f2fe; color: #0369a1; }
.badge-pending { background: #fef9c3; color: #a16207; }
.badge-paid { background: #dcfce7; color: #15803d; }
.badge-checkedin { background: #d1fae5; color: #065f46; }
.badge-checkedout { background: #f1f5f9; color: #64748b; }
.badge-cancelled { background: #fee2e2; color: #b91c1c; }
.badge-noshow { background: #fce7f3; color: #9d174d; }

.badge-available { background: #d1fae5; color: #065f46; }
.badge-occupied { background: #fee2e2; color: #991b1b; }
.badge-cleaning { background: #fef3c7; color: #92400e; }
.badge-out_of_service { background: #e2e8f0; color: #334155; }
.badge-hold, .badge-reserved { background: #fef3c7; color: #b45309; }
.badge-house_use { background: #e0e7ff; color: #3730a3; }
.badge-stop_sale { background: #f1f5f9; color: #475569; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: white; border-color: var(--border); color: var(--text-main); }
.btn-secondary:hover { background: #f8fafc; }

.btn-success { background: #10b981; color: white; }
.btn-success:hover { background: #059669; }

.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-warning { background: #f59e0b; color: white; }
.btn-warning:hover { background: #d97706; }

.btn-sm { padding: 4px 8px; font-size: 0.8rem; }

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  background: white;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 550px;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #f8fafc;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  background: white;
}

.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}

.tab-btn.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Всплывающие уведомления в правом нижнем углу (как в v1) */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 440px;
}

.toast-item {
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  pointer-events: auto;
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
  line-height: 1.35;
  white-space: pre-line;
}

.toast-item.toast-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-item.toast-success {
  background-color: #059669;
  border-color: #10b981;
}

.toast-item.toast-error {
  background-color: #e11d48;
  border-color: #f43f5e;
}

.toast-item.toast-warning {
  background-color: #d97706;
  border-color: #f59e0b;
}

.toast-item.toast-info {
  background-color: #1e40af;
  border-color: #3b82f6;
}

.toast-item i {
  font-size: 1.15rem;
  flex-shrink: 0;
}

