/* =============================================
   AltRoom — Meeting Room Management
   Brand: Navy #193f76 / Orange #ec6311
   Fonts: Montserrat (headings) + Inter (body)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@500;600;700;800&display=swap');

:root {
  --primary: #193f76;
  --primary-light: #234b75;
  --primary-dark: #0f2a52;
  --primary-faint: rgba(25, 63, 118, 0.06);
  --primary-muted: rgba(25, 63, 118, 0.12);
  --accent: #ec6311;
  --accent-hover: #d4570e;
  --accent-light: #f4853e;
  --accent-faint: rgba(236, 99, 17, 0.08);
  --success: #16a34a;
  --success-faint: rgba(22, 163, 74, 0.08);
  --danger: #dc2626;
  --danger-faint: rgba(220, 38, 38, 0.08);
  --warning: #ca8a04;
  --warning-faint: rgba(202, 138, 4, 0.08);

  --bg: linear-gradient(160deg, #f8fafc 0%, #e8eef6 50%, #fdf4ed 100%);
  --bg-flat: #f8fafc;
  --bg-raised: #ffffff;
  --bg-sunken: #eef1f6;
  --border: #dde2ea;
  --border-light: #e8ecf2;

  --text-primary: #2c3e5a;
  --text-secondary: #5f6b7d;
  --text-tertiary: #8a94a4;

  --sidebar-w: 248px;
  --header-h: 56px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(25, 63, 118, 0.06), 0 1px 2px rgba(25, 63, 118, 0.04);
  --shadow-md: 0 4px 12px rgba(25, 63, 118, 0.08), 0 2px 6px rgba(25, 63, 118, 0.04);
  --shadow-lg: 0 20px 40px -12px rgba(25, 63, 118, 0.15);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.sidebar-brand, .modal-title {
  font-family: 'Montserrat', 'Inter', sans-serif;
}

/* =============================================
   HEADER
   ============================================= */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-h);
  padding: 0 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-left .logo {
  height: 28px;
  width: auto;
}

.header-left h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.header-left h1 span {
  color: #fff !important;
}

.header-left h1 span:last-child {
  color: var(--accent) !important;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

#user-name {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  font-weight: 400;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  transition: all var(--transition);
  white-space: nowrap;
  gap: 6px;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(236, 99, 17, 0.25);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(236, 99, 17, 0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--bg-raised);
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: var(--bg-sunken);
  border-color: var(--border);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-full {
  width: 100%;
}

.btn-small {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 5px;
}

/* =============================================
   LAYOUT
   ============================================= */
#app {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-raised);
  border-right: 1px solid var(--border-light);
  padding-top: 0;
  display: flex;
  flex-direction: column;
}

.sidebar ul {
  list-style: none;
  padding: 4px 8px;
}

.sidebar li {
  padding: 8px 14px;
  margin: 1px 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 450;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.sidebar li:hover {
  background: var(--bg-sunken);
  color: var(--text-primary);
}

.sidebar li svg {
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity var(--transition);
}
.sidebar li:hover svg {
  opacity: 0.75;
}
.sidebar li.active {
  color: var(--primary);
  background: var(--primary-faint);
  font-weight: 550;
}
.sidebar li.active svg {
  opacity: 1;
  color: var(--accent);
}
.sidebar-divider {
  height: 1px;
  background: var(--border-light, #e2e6ea);
  margin: 10px 14px !important;
  padding: 0 !important;
  cursor: default !important;
  list-style: none;
}
.sidebar-divider:hover {
  background: var(--border-light, #e2e6ea) !important;
}
.sidebar-section-label {
  font-size: 10px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary) !important;
  padding: 6px 14px 2px !important;
  cursor: default !important;
}
.sidebar-section-label:hover {
  background: transparent !important;
  color: var(--text-secondary) !important;
}

.sidebar-brand {
  padding: 16px 18px 14px;
  font-size: 16px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand small {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 1px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 28px 36px;
  overflow-y: auto;
}

/* =============================================
   LOGIN
   ============================================= */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: calc(100vh - var(--header-h));
  background: linear-gradient(160deg, var(--bg) 0%, #eef1f6 100%);
}

.login-card {
  background: var(--bg-raised);
  padding: 44px 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  width: 100%;
  max-width: 400px;
}

.login-card h2 {
  margin-bottom: 2px;
  color: var(--primary);
}

.brand-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.login-card > p {
  margin-bottom: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-raised);
  transition: all var(--transition);
}

.form-group input::placeholder {
  color: var(--text-tertiary);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(236, 99, 17, 0.12);
}

.form-group input[type="color"] {
  padding: 4px;
  height: 40px;
  cursor: pointer;
}

.error-message {
  background: var(--danger-faint);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid rgba(220, 38, 38, 0.12);
}

.success-message {
  background: var(--success-faint);
  color: var(--success);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid rgba(22, 163, 74, 0.12);
}

/* Activation link box */
.activation-link-box {
  display: flex;
  gap: 8px;
  align-items: center;
}
.activation-link-box input {
  flex: 1;
  font-size: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--text);
  cursor: pointer;
}
.activation-link-box input:focus {
  outline: none;
  border-color: var(--accent);
}

/* =============================================
   SECTION HEADER
   ============================================= */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

/* =============================================
   STATS GRID
   ============================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 4px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-raised);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: box-shadow var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
}

.stat-card h3 {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
  letter-spacing: -0.03em;
  min-height: 36px;
  display: flex;
  align-items: center;
}

.stat-card p {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* =============================================
   BADGES
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-sunken);
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.badge-success {
  background: var(--success-faint);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-faint);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-faint);
  color: var(--danger);
}

.badge-primary {
  background: var(--primary-faint);
  color: var(--primary);
}

/* =============================================
   DATA TABLE
   ============================================= */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-raised);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.data-table th {
  background: var(--bg-sunken);
  padding: 10px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  vertical-align: middle;
  color: var(--text-primary);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: var(--primary-faint);
}

.row-past {
  opacity: 0.45;
}

/* =============================================
   TABS
   ============================================= */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 18px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}

.tab:hover {
  color: var(--text-primary);
}

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

/* =============================================
   TENANT CARDS
   ============================================= */
.tenant-card {
  background: var(--bg-raised);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 8px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.tenant-card:hover {
  border-color: var(--primary-muted);
  box-shadow: var(--shadow-md);
}

.tenant-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.tenant-card-header strong {
  font-weight: 600;
  font-size: 14px;
}

.tenant-card-stats {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.tenant-card-url {
  font-size: 12px;
  color: var(--accent);
  margin-top: 6px;
  font-weight: 500;
}

/* =============================================
   BUILDINGS / FLOORS / ROOMS
   ============================================= */
.building-card {
  background: var(--bg-raised);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.building-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border-light);
}

.building-header strong {
  font-weight: 600;
  font-size: 14px;
}

.floor-section {
  border-bottom: 1px solid var(--border-light);
}

.floor-section:last-child {
  border-bottom: none;
}

.floor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.015);
}

.rooms-list {
  padding: 2px 20px;
}

.room-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}

.room-row:last-child {
  border-bottom: none;
}

.room-row-thumb {
  width: 52px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-light, #e2e6ea);
}
.room-row-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-sunken, #f0f2f5);
  color: var(--text-secondary, #8a94a0);
}

.room-row-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  flex: 1;
  min-width: 0;
}

.room-row-info strong {
  font-weight: 550;
}

.room-row-actions {
  display: flex;
  gap: 6px;
}

/* =============================================
   INLINE FORM
   ============================================= */
.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 20px;
  background: var(--accent-faint);
  border-bottom: 1px solid var(--border-light);
}

.inline-form input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  background: var(--bg-raised);
}

.inline-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-faint);
}

/* =============================================
   FORM CARD
   ============================================= */
.form-card {
  background: var(--bg-raised);
  padding: 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  max-width: 520px;
}

.booking-layout .form-card {
  max-width: none;
}

.form-card small {
  display: block;
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: 12px;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 150ms ease;
}

.modal {
  background: var(--bg-raised);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 90%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  animation: slideUp 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.modal h3 {
  font-size: 17px;
  font-weight: 650;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.checkbox-group {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
  accent-color: var(--accent);
}

/* =============================================
   ROOMS GRID (User area)
   ============================================= */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.room-card {
  background: var(--bg-raised);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  border-left: 3px solid var(--success);
}

.room-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

.room-card-disabled {
  opacity: 0.55;
  border-color: var(--danger);
  cursor: not-allowed;
  background: var(--danger-faint);
}

.room-card-disabled:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--danger);
}

.room-capacity-empty {
  color: var(--danger);
  font-weight: 600;
}

.room-card.room-occupied {
  border-left-color: var(--danger);
}

.room-status-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--success-faint);
  color: var(--success);
}

.room-occupied .room-status-badge {
  background: var(--danger-faint);
  color: var(--danger);
}

.room-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.room-location {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.room-capacity {
  font-size: 12px;
  color: var(--text-tertiary);
}

.room-equipment {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* =============================================
   BOOKING LAYOUT
   ============================================= */
.booking-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .booking-layout {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Room schedule / timeline */
.room-schedule {
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  align-self: start;
}

.room-schedule h3, .room-schedule h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Calendar navigation */
.room-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.room-calendar-nav span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Week calendar grid */
.room-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid transparent;
  background: var(--bg-primary);
}
.cal-day:hover {
  background: var(--bg-hover);
}
.cal-day-name {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}
.cal-day-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 2px 0;
}
.cal-day-dots {
  font-size: 10px;
  font-weight: 600;
  color: #ec6311;
  background: rgba(232, 115, 42, 0.1);
  border-radius: 8px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}
.cal-day-dots.cal-day-free {
  color: var(--text-secondary);
  background: none;
}
.cal-day-today {
  background: rgba(232, 115, 42, 0.06);
}
.cal-day-today .cal-day-num {
  color: #ec6311;
}
.cal-day-selected {
  border-color: #193f76;
  background: rgba(27, 58, 92, 0.06);
}
.cal-day-selected .cal-day-num {
  color: #193f76;
}
.cal-day-past {
  opacity: 0.5;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-item.timeline-mine {
  background: var(--primary-faint);
  margin: 0 -20px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
}

.timeline-time {
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  min-width: 100px;
  font-size: 12px;
}

.timeline-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-info strong {
  font-size: 13px;
}

/* =============================================
   INVITE PICKER — Dual-panel people selector
   ============================================= */
.invite-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
  min-height: 240px;
}

.invite-picker-available {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg-raised);
}

.invite-picker-selected {
  display: flex;
  flex-direction: column;
  background: #f5f7fa;
}

/* Search input */
.invite-search {
  display: block;
  width: 100%;
  padding: 11px 14px 11px 36px;
  border: none;
  border-bottom: 1px solid var(--border-light);
  font-family: inherit;
  font-size: 13px;
  background: var(--bg-raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cline x1='9.5' y1='9.5' x2='13' y2='13'/%3E%3C/svg%3E") 12px center no-repeat;
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  flex-shrink: 0;
}

.invite-search::placeholder {
  color: var(--text-tertiary);
}

.invite-search:focus {
  background-color: #fff;
  border-bottom-color: var(--accent);
}

/* Header for selected panel */
.invite-selected-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-light);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  background: rgba(27, 58, 92, 0.03);
}

.invite-selected-header .badge {
  font-size: 10px;
  min-width: 18px;
  text-align: center;
  padding: 2px 6px;
  background: var(--accent);
  color: #fff;
  border-radius: 100px;
  font-weight: 700;
}

/* Scrollable list */
.invite-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Empty state */
.invite-empty {
  padding: 24px 14px;
  font-size: 12px;
  text-align: center;
  color: var(--text-tertiary);
  margin: 0;
}

/* Individual invite row */
.invite-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 120ms ease;
  border-bottom: 1px solid var(--border-light);
}

.invite-item:last-child {
  border-bottom: none;
}

.invite-item:hover {
  background: rgba(27, 58, 92, 0.05);
}

.invite-item-selected:hover {
  background: rgba(220, 38, 38, 0.04);
}

/* Avatar circle */
.invite-item-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(27,58,92,0.12), rgba(27,58,92,0.06));
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.invite-item-selected .invite-item-avatar {
  background: linear-gradient(135deg, rgba(232,115,42,0.15), rgba(232,115,42,0.06));
  color: var(--accent);
}

/* Name + email */
.invite-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.invite-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.invite-item-email {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Add button */
.invite-item-add {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  background: var(--success-faint);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  flex-shrink: 0;
  transition: all 120ms ease;
}

.invite-item:hover .invite-item-add {
  background: var(--success);
  color: #fff;
}

/* Remove button */
.invite-item-remove {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  background: var(--danger-faint);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 120ms ease;
}

.invite-item-selected:hover .invite-item-remove {
  background: var(--danger);
  color: #fff;
}

/* Responsive */
@media (max-width: 600px) {
  .invite-picker {
    grid-template-columns: 1fr;
  }
  .invite-picker-available {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .invite-list {
    max-height: 180px;
  }
}

/* =============================================
   BOOKING CARDS (My bookings)
   ============================================= */
.booking-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.booking-card:hover {
  border-color: var(--border);
}

.booking-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.booking-card-header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.booking-card-details {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.booking-date {
  text-transform: capitalize;
}

.booking-time {
  font-weight: 500;
  color: var(--primary);
}

.booking-invitees {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* =============================================
   PROFILE
   ============================================= */
.profile-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}

/* =============================================
   LOADING
   ============================================= */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: calc(100vh - var(--header-h));
  gap: 12px;
}

.loading p {
  color: var(--text-tertiary);
  font-size: 13px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-small {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* =============================================
   UTILITY
   ============================================= */
.text-light {
  color: var(--text-tertiary);
  font-size: 12px;
}

.loading-text {
  color: var(--text-tertiary);
  font-size: 13px;
}

code {
  background: var(--bg-sunken);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--primary);
}

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

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .content {
    padding: 20px 16px;
  }

  .rooms-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    margin: 16px;
    padding: 28px 24px;
  }

  .section-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card h3 {
    font-size: 22px;
  }

  .room-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .inline-form {
    flex-wrap: wrap;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 12px;
  }

  .header {
    padding: 0 14px;
  }

  .header-left h1 {
    font-size: 15px;
  }
}

/* =============================================
   CUSTOM MODALS
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 58, 92, 0.35);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalOverlayIn 0.2s ease;
}
@keyframes modalOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-box {
  background: var(--bg-raised, #fff);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(27, 58, 92, 0.25), 0 0 0 1px rgba(27, 58, 92, 0.08);
  padding: 32px;
  max-width: 420px;
  width: 90%;
  animation: modalBoxIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
}
@keyframes modalBoxIn {
  from { opacity: 0; transform: scale(0.9) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
}
.modal-icon-confirm {
  background: rgba(232, 115, 42, 0.1);
  color: #ec6311;
}
.modal-icon-error {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}
.modal-icon-success {
  background: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary, #193f76);
  margin-bottom: 8px;
}
.modal-message {
  font-size: 14px;
  color: var(--text-secondary, #5a6b7d);
  line-height: 1.5;
  margin-bottom: 24px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.modal-actions .btn {
  min-width: 110px;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-btn-cancel {
  background: var(--bg-primary, #f0f2f5);
  border: 1px solid var(--border-light, #e2e6ea);
  color: var(--text-secondary, #5a6b7d);
}
.modal-btn-cancel:hover {
  background: var(--bg-hover, #e6e9ed);
}
.modal-btn-confirm {
  background: #193f76;
  border: 1px solid #193f76;
  color: #fff;
}
.modal-btn-confirm:hover {
  background: #24486f;
}
.modal-btn-danger {
  background: #dc3545;
  border: 1px solid #dc3545;
  color: #fff;
}
.modal-btn-danger:hover {
  background: #c82333;
}
.modal-btn-ok {
  background: #193f76;
  border: 1px solid #193f76;
  color: #fff;
}
.modal-btn-ok:hover {
  background: #24486f;
}

/* Password toggle */
.input-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-password-wrap input {
  width: 100%;
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary, #5a6b7d);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.password-toggle:hover {
  color: #193f76;
  background: rgba(27, 58, 92, 0.06);
}

/* =============================================
   ROOM PHOTOS
   ============================================= */

/* Admin: file input */
.input-file {
  font-size: 13px;
  padding: 8px;
  border: 1px dashed var(--border, #d0d5dd);
  border-radius: var(--radius-md, 8px);
  width: 100%;
  cursor: pointer;
  background: var(--bg-primary, #f9fafb);
}

/* Admin: photo preview thumbnails */
.photos-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.photo-thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border-light, #e2e6ea);
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Admin: photo management grid */
.photos-manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.photo-manage-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4/3;
  border: 2px solid var(--border-light, #e2e6ea);
}
.photo-manage-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(220, 53, 69, 0.9);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.photo-manage-item:hover .photo-remove-btn {
  opacity: 1;
}

/* User: room gallery */
.room-gallery {
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-light, #e2e6ea);
  background: #000;
}
.room-gallery-main {
  width: 100%;
  max-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}
.room-gallery-main img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  transition: transform 0.3s;
}
.room-gallery-main img:hover {
  transform: scale(1.03);
}
.room-gallery-thumbs {
  display: flex;
  gap: 4px;
  padding: 8px;
  background: var(--bg-raised, #fff);
  overflow-x: auto;
}
.gallery-thumb {
  width: 60px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.15s;
  flex-shrink: 0;
}
.gallery-thumb:hover {
  opacity: 0.9;
}
.gallery-thumb-active {
  border-color: #ec6311;
  opacity: 1;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalOverlayIn 0.2s ease;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
  z-index: 2;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 40px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 2;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover, .lightbox-next:hover {
  background: rgba(255, 255, 255, 0.25);
}
.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 14px;
  border-radius: 20px;
}

/* =============================================
   ACCOUNT AZIENDA
   ============================================= */
.account-section {
  margin-bottom: 24px;
}
.account-logo-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.account-logo-preview {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: contain;
  border: 2px solid var(--border-light, #e2e6ea);
  background: var(--bg-primary, #f9fafb);
  flex-shrink: 0;
}
.account-logo-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  border: 2px dashed var(--border-light, #e2e6ea);
  background: var(--bg-sunken, #f0f2f5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary, #8a94a0);
  flex-shrink: 0;
}
.account-domain-field {
  display: flex;
  align-items: center;
  background: var(--bg-sunken, #f0f2f5);
  border: 1px solid var(--border-light, #e2e6ea);
  border-radius: var(--radius-md, 8px);
  padding: 10px 14px;
  font-size: 14px;
}
.account-domain-value {
  font-weight: 700;
  color: #193f76;
}
.account-domain-suffix {
  color: var(--text-secondary, #5a6b7d);
}
.account-url-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-sunken, #f0f2f5);
  border: 1px solid var(--border-light, #e2e6ea);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.account-url-box code {
  font-size: 14px;
  font-weight: 600;
  color: #193f76;
  flex: 1;
  word-break: break-all;
}
.account-qr {
  display: flex;
  justify-content: center;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border-light, #e2e6ea);
}
.qr-code-img {
  width: 200px;
  height: 200px;
}

/* =============================================
   DAY GRID — Rooms × Hours availability view
   ============================================= */
.dg-container {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-raised);
}

.dg-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-sunken);
}

.dg-header .dg-room-label {
  border-bottom: none;
}

.dg-hours {
  flex: 1;
  display: flex;
  position: relative;
}

.dg-hour-label {
  flex: 1;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 6px 0 6px 4px;
  white-space: nowrap;
}

.dg-row {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 120ms ease;
}

.dg-row:last-child {
  border-bottom: none;
}

.dg-row:hover {
  background: var(--primary-faint);
}

.dg-room-label {
  width: 160px;
  min-width: 160px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border-light);
}

.dg-room-label strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.dg-room-label small {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.2;
}

.dg-slots {
  flex: 1;
  position: relative;
  min-height: 44px;
}

.dg-hour-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-light);
  pointer-events: none;
  z-index: 0;
}

.dg-booking {
  position: absolute;
  top: 4px;
  bottom: 4px;
  background: var(--primary-muted);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.dg-booking-mine {
  background: var(--accent-faint);
  border-left-color: var(--accent);
}

.dg-booking-title {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dg-booking-mine .dg-booking-title {
  color: var(--accent);
  font-weight: 600;
}

.dg-now-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--danger);
  z-index: 2;
  pointer-events: none;
}

.dg-now-marker::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

/* Building selector cards */
.building-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Week strip for building view */
.building-week-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.building-week-strip .cal-day {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  cursor: pointer;
  text-align: center;
  transition: all 120ms ease;
  min-width: 56px;
}

.building-week-strip .cal-day:hover {
  border-color: var(--primary);
  background: var(--primary-faint);
}

.building-week-strip .cal-day-selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.building-week-strip .cal-day-name {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
}

.building-week-strip .cal-day-num {
  font-size: 16px;
  font-weight: 700;
  display: block;
  margin-top: 2px;
}

.building-week-strip .cal-day-selected .cal-day-name,
.building-week-strip .cal-day-selected .cal-day-num {
  color: #fff;
}

/* Responsive day grid */
@media (max-width: 768px) {
  .dg-room-label {
    width: 100px;
    min-width: 100px;
    padding: 6px 8px;
  }
  .dg-room-label strong {
    font-size: 11px;
  }
  .dg-room-label small {
    font-size: 9px;
  }
  .dg-hour-label {
    font-size: 9px;
  }
  .building-week-strip {
    overflow-x: auto;
  }
}

/* Bookings filters */
.bookings-filters {
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.bookings-filters .form-group {
  min-width: 0;
  flex: 1;
}
.bookings-filters .form-group label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.bookings-filters select,
.bookings-filters input[type="date"] {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-raised);
  width: 100%;
}
