/* =========================================
   SoniicAppCore – Clean Flat UI (Option A)
   File: public/assets/css/style.css
   ========================================= */

/* ---------- Base + Reset ---------- */

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

:root {
  --primary: #ec4899;
  --primary-soft: #f9a8d4;
  --secondary: #111827;
  --secondary-soft: #1f2937;
  --bg: #f3f4f6;
  --bg-card: #ffffff;
  --border-soft: #e5e7eb;
  --text-main: #111827;
  --text-muted: #6b7280;
  --danger: #ef4444;
  --success: #16a34a;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-main);
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Headings */
h1, h2, h3, h4 {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

/* ---------- Layout: Sidebar + Main ---------- */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 230px;
  height: 100vh;
  background: var(--secondary);
  color: #f9fafb;
  display: flex;
  flex-direction: column;
  padding: 12px 14px 16px;
  box-shadow: 4px 0 18px rgba(0,0,0,0.55);
  z-index: 50;
}

/* Brand: logo stacked above text (Option A) */
.sidebar .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 6px 4px 10px;
  border-bottom: 1px solid rgba(148,163,184,0.4);
  margin-bottom: 8px;
}

.sidebar .brand img {
  display: block;
  max-width: 140px;
  max-height: 60px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.sidebar .brand span {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
}

/* Light / dark logo handling */
.brand .logo-light { display: block; }
.brand .logo-dark  { display: none; }

body.dark-mode .brand .logo-light { display: none; }
body.dark-mode .brand .logo-dark  { display: block; }

.sidebar nav {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
  margin: 8px 4px 2px;
}

.sidebar nav .nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 6px;
  color: #e5e7eb;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.sidebar nav .nav-link .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
}

.sidebar nav .nav-link:hover {
  background: rgba(255,255,255,0.05);
  text-decoration: none;
  transform: translateX(1px);
}

/* Active nav link styling: border-only with no background */
.sidebar nav .nav-link.active {
  /* Active nav item has a pill-like border around it */
  background: transparent;
  border: 2px solid var(--primary);
  border-radius: 9999px;
  box-shadow: none;
}

/* ----- Custom colour picker field ----- */
.color-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.color-field input[type="text"] {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-main);
  background: #fff;
}

/* Hide the default arrow of the colour input on some browsers */
.color-picker-label {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.color-picker-label input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 36px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.color-picker-label input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-picker-label input[type="color"]::-webkit-color-swatch {
  border: none;
}
.color-picker-label .arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.7rem;
  color: #444;
}

.nav-dark-toggle {
  opacity: 0.9;
}

/* Main page container */
.page {
  margin-left: 230px;
  padding: 20px 24px 32px;
  min-height: calc(100vh - 40px);
}

/* Footer */
/* Footer uses the secondary colour defined in settings */
.footer {
  margin-left: 230px;
  height: 40px;
  background: var(--secondary);
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.8rem;
}
.footer-img {
  max-height: 18px;
  width: auto;
}

/* ---------- Global banner ---------- */

.global-banner {
  /* Use the banner color from the current theme.  Admins can set this in
     Branding & Messages.  Falls back to #f97316 if not defined. */
  background: var(--banner-color);
  color: #111827;
  padding: 6px 16px;
  font-size: 0.9rem;
  text-align: center;
  border-radius: 0 0 8px 8px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  cursor: pointer;
  background: #e5e7eb;
  color: #111827;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.btn-secondary {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #111827;
}
.btn-danger {
  background: var(--danger);
  border-color: #b91c1c;
  color: #ffffff;
}
.btn-success {
  background: var(--success);
  border-color: #15803d;
  color: #ffffff;
}
.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Icon button (Add widget, etc.) */
.btn-icon {
  padding: 4px 10px;
  font-size: 1.1rem;
  line-height: 1;
}
.btn-icon-tooltip {
  position: relative;
  cursor: pointer;
}
.btn-icon-tooltip::after,
.btn-icon-tooltip::before {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.btn-icon-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: -38px;
  right: 0;
  background: var(--secondary);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 0.8rem;
  opacity: 1;
  pointer-events: none;
  transform: translateY(0);
  box-shadow: 0 3px 6px rgba(0,0,0,0.25);
  z-index: 9999;
}
.btn-icon-tooltip:hover::before {
  content: "";
  position: absolute;
  top: -12px;
  right: 8px;
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent var(--secondary) transparent;
  opacity: 1;
}

/* ---------- Forms, Tables, Cards ---------- */

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0,1.2fr) minmax(0,1.4fr);
  gap: 20px;
  align-items: flex-start;
}

.admin-form {
  background: var(--bg-card);
  padding: 16px 18px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.admin-form h3 {
  margin-top: 0;
  margin-bottom: 10px;
}
.admin-form label {
  display: block;
  font-weight: 600;
  margin-top: 8px;
  font-size: 0.9rem;
}
.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  padding: 7px 9px;
  margin-top: 4px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
}
.admin-form small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Checkboxes alignment in admin sections */
input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: middle;
}
.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}
.perm-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  background: var(--bg-card);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
th, td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.9rem;
}
th {
  background: #f9fafb;
  text-align: left;
}
tr:last-child td {
  border-bottom: none;
}

/* Alerts / muted text */
.alert {
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.info  { background: #e0f2fe; color: #075985; }
.alert.success { background: #dcfce7; color: #166534; }
.muted {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Login & Maintenance ---------- */

.login-body {
  background: #020617;
  color: #e5e7eb;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.login-wrap {
  width: 100%;
  max-width: 380px;
  padding: 20px;
}
.login-card {
  background: #020617;
  padding: 24px 22px 20px;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.8);
}
.login-logo {
  text-align: center;
  margin-bottom: 10px;
}
.login-logo img {
  max-width: 100%;
  max-height: 70px;
  height: auto;
  object-fit: contain;
}
.login-card h1 {
  margin-top: 0;
  margin-bottom: 12px;
}
.login-form label {
  display: block;
  margin-top: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}
.login-form input {
  width: 100%;
  padding: 8px 10px;
  margin-top: 4px;
  border-radius: 8px;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.9rem;
}
.login-form button {
  width: 100%;
  margin-top: 14px;
}
.login-message {
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: rgba(255,255,255,0.9);
}

/* Maintenance */
.maintenance-body {
  background: #020617;
  color: #e5e7eb;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
}
.maintenance-card {
  background: #020617;
  padding: 24px 28px;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.8);
  max-width: 520px;
  width: 100%;
  text-align: center;
}

/* ---------- Dashboard ---------- */

.page-title-with-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 20px;
}
.page-title-with-actions .btn-icon {
  margin-left: auto;
}

/* 12-column grid with responsive collapse */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

/* Default card spans 4 cols (3 cards per row) */
.dashboard-grid > .dash-card {
  grid-column: span 4;
  min-width: 260px;
}

.dash-card {
  position: relative;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 14px 16px 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.06);
  border: 1px solid var(--border-soft);
}

/* Grab cursor on desktop only */
@media (min-width: 900px) {
  .dash-card { cursor: grab; }
  .dash-card:active { cursor: grabbing; }
}

/* Header bar */
.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--secondary);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 10px;
  margin: -6px -8px 10px;
}
.dash-card-title {
  font-size: 0.95rem;
  font-weight: 600;
}
.dash-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.dash-card-actions .dash-card-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.85rem;
  border-radius: 3px;
}
.dash-card-actions .dash-card-btn:hover {
  background: rgba(255,255,255,0.12);
}

/* Content */
.dash-card-content {
  font-size: 0.9rem;
}

/* Collapsed / hidden */
.dash-card.collapsed .dash-card-content {
  display: none;
}
.dash-card-hidden {
  display: none !important;
}

/* Resizer widths (used by JS) */
.dash-card.w-3  { grid-column: span 3; }
.dash-card.w-6  { grid-column: span 6; }
.dash-card.w-12 { grid-column: span 12; }

@media (max-width: 900px) {
  .dashboard-grid > .dash-card,
  .dash-card.w-3,
  .dash-card.w-6,
  .dash-card.w-12 {
    grid-column: span 12;
  }
}

/* Dash list inside cards */
.dash-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.dash-list li {
  padding: 6px 0;
  border-bottom: 1px solid #e5e7eb;
}
.dash-list li:last-child {
  border-bottom: none;
}
.dash-list-title {
  font-size: 0.95rem;
  font-weight: 600;
}
.dash-list-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.dash-list-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.dash-link {
  margin-top: 6px;
  font-size: 0.85rem;
}

/* ---------- Calendar ---------- */

#calendar {
  margin-top: 18px;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 4px 22px rgba(0,0,0,0.06);
}
.filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.filters form {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 18px 20px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.5);
}
.modal h3 {
  margin-top: 0;
  margin-bottom: 10px;
}
.modal .modal-body label {
  display: block;
  margin-top: 8px;
  font-weight: 500;
}
.modal .modal-body input[type="text"],
.modal .modal-body input[type="email"],
.modal .modal-body input[type="password"],
.modal .modal-body input[type="datetime-local"],
.modal .modal-body input[type="date"],
.modal .modal-body input[type="number"],
.modal .modal-body select,
.modal .modal-body textarea {
  width: 100%;
  margin-top: 4px;
}
.modal-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---------- Tabs (Manager / Admin) ---------- */

.tab-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 12px;
}
.tab-nav .tab-button {
  background: transparent;
  border: none;
  padding: 7px 12px;
  border-radius: 4px 4px 0 0;
  cursor: pointer;
  font-size: 0.9rem;
  color: #4b5563;
  border-bottom: 2px solid transparent;
}
.tab-nav .tab-button.active {
  background: #e5e7eb;
  color: #111827;
  border-bottom-color: var(--primary);
}
.tab-pane {
  display: none;
  padding-top: 8px;
}
.tab-pane.active {
  display: block;
}

/* ---------- Permission tree & pills ---------- */

.perm-tree {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  max-height: 260px;
  overflow: auto;
}
.perm-section {
  margin-bottom: 8px;
}
.perm-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: 4px;
}
.perm-item code {
  font-size: 0.7rem;
  background: #f3f4f6;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.8;
}
.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.pill-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f4f7;
  font-size: 0.8rem;
}
.pill-item input {
  margin: 0;
}

/* Checkbox row */
.checkbox-inline span {
  display: inline-block;
}

/* ---------- Studio Load widget ---------- */

.studio-load-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.studio-load-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148,163,184,0.35);
  overflow: hidden;
}
.studio-load-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  transition: width 0.4s ease;
}

/* ---------- Kiosk Preview – Current Studio Availability ---------- */

.kiosk-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kiosk-mini {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  background: #ffffff;
}

.kiosk-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.kiosk-header .studio-title {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Status dot */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}
.status-dot.free { background: var(--success); }
.status-dot.busy { background: var(--danger); }

/* Now / Next layout */
.kiosk-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
}
.kiosk-label-col {
  width: 42px;
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text-muted);
}
.kiosk-content-col {
  flex: 1;
}
.kiosk-line {
  margin-bottom: 2px;
}
.kiosk-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.kiosk-divider {
  border-top: 1px solid #e5e7eb;
  margin: 6px 0;
}

/* ---------- Recurring events badge (calendar) ---------- */

.fc-event.event-recurring::after {
  content: "↻";
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.7rem;
  opacity: 0.85;
}

/* ---------- Dark mode overrides ---------- */

body.dark-mode {
  background: #020617;
  color: #e5e7eb;
}

body.dark-mode .page {
  background: #020617;
}

body.dark-mode .admin-form,
body.dark-mode table,
body.dark-mode .dash-card,
body.dark-mode #calendar {
  background: #020617;
  color: #e5e7eb;
  border-color: #1f2937;
  box-shadow: 0 8px 30px rgba(0,0,0,0.9);
}

body.dark-mode th {
  background: #111827;
}
body.dark-mode td,
body.dark-mode th {
  border-color: #1f2937;
}

body.dark-mode .perm-tree,
body.dark-mode .pill-item {
  background: #020617;
  border-color: #1f2937;
}

body.dark-mode .footer {
  background: var(--secondary);
  color: #9ca3af;
}

body.dark-mode .global-banner {
  color: #111827;
}

body.dark-mode .tab-nav {
  border-bottom-color: #1f2937;
}
body.dark-mode .tab-nav .tab-button {
  color: #9ca3af;
}
body.dark-mode .tab-nav .tab-button.active {
  background: #111827;
  color: #e5e7eb;
  border-bottom-color: #3b82f6;
}

body.dark-mode .kiosk-mini {
  background: #020617;
  border-color: #1f2937;
}

/* ---------- Responsive layout ---------- */

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease-out;
    z-index: 60;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .page {
    margin-left: 0;
    padding: 16px 14px 24px;
  }

  .footer {
    margin-left: 0;
  }

  .dashboard-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  #calendar {
    padding: 8px;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  .filters > * {
    width: 100%;
  }
}

/* ---------- KIOSK VISIBILITY PATCH (your block) ---------- */

/* FIX: Make kiosk widget card background visible */
[data-widget="kiosk_preview"] .dash-card-content {
    background: #ffffff !important;    /* opaque layer for light mode */
}

.dark-mode [data-widget="kiosk_preview"] .dash-card-content {
    background: #1e1e1e !important;    /* opaque layer for dark mode */
}

/* Ensure kiosk-mini cards remain fully visible */
[data-widget="kiosk_preview"] .kiosk-mini {
    background: #ffffff !important;
    border: 2px solid rgba(0,0,0,0.3) !important;
    border-radius: 10px !important;
    padding: 16px 18px !important;
    margin-bottom: 16px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18) !important;
}

.dark-mode [data-widget="kiosk_preview"] .kiosk-mini {
    background: #1e1e1e !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    box-shadow: 0 2px 6px rgba(255,255,255,0.18) !important;
}

/* Page title spacing + Add widget alignment (reinforced) */
.page-title-with-actions {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:0.75rem;
    margin-bottom:20px;
}
#addWidgetBtn {
    margin-left:auto;
}

/* Admin checkbox emphasis (slightly larger) */
.admin-form input[type=checkbox] {
    transform: scale(1.05);
}

/* --- FIX: Light/Dark logo switching --- */
.brand .logo-light { display:inline-block !important; }
.brand .logo-dark { display:none !important; }
body.dark-mode .brand .logo-light { display:none !important; }
body.dark-mode .brand .logo-dark { display:inline-block !important; }
.brand img { max-height:48px; width:auto; object-fit:contain; }

/* Align Add Widget */
.page-title-with-actions{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;}
#addWidgetBtn{margin-left:auto !important;}

/* Dashboard width classes */
.dash-card.w-3{grid-column:span 3;}
.dash-card.w-4{grid-column:span 4;}
.dash-card.w-6{grid-column:span 6;}
.dash-card.w-12{grid-column:span 12;}

/* Widget picker modal overlay */
.widget-picker {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}
.widget-picker.open {
  display: flex;
}
.widget-picker-content {
  background: #ffffff;
  padding: 16px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  max-width: 420px;
  width: 100%;
}
body.dark-mode .widget-picker-content {
  background: #111827;
  color: #f9fafb;
}


/* Booking modal specific overrides */
#bookingModal.modal-overlay {
  z-index: 4000 !important;
}
#bookingModal .modal {
  background: #ffffff !important;
}
body.dark-mode #bookingModal .modal {
  background: #111827 !important;
  color: #f9fafb !important;
}

/* Booking status labels */
.status-label {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-approved {
  background-color: #16a34a;
  color: #ffffff;
}

.status-pending {
  background-color: #eab308;
  color: #111827;
}

.status-rejected {
  background-color: #dc2626;
  color: #ffffff;
}

.status-cancelled {
  background-color: #6b7280;
  color: #f9fafb;
}

.status-unknown {
  background-color: #9ca3af;
  color: #111827;
}

/* Compact pill buttons for inline actions */
.btn-pill {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  line-height: 1.2;
}

/* Table cleanup refinements */
.when-cell{
    white-space:nowrap;
    line-height:1.2rem;
    padding-top:4px;
    padding-bottom:4px;
}

.truncate{
    max-width:200px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.actions-cell{
    white-space:nowrap;
}

/* Vertically align checkbox column */
.table-checkbox {
    vertical-align: middle !important;
    text-align: center;
    width: 40px;
}
.table-checkbox input[type=checkbox] {
    vertical-align: middle;
    margin-top: 0;
}

.table-checkbox {
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    text-align: center;
    vertical-align: middle !important;
    padding: 0;
}

.bulk-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 10px;
}

.table-checkbox {
  width:50px!important;
  min-width:50px!important;
  max-width:50px!important;
  text-align:center;
  vertical-align:middle!important;
  padding:0;
}
.when-cell {
  white-space:nowrap;
  line-height:1.2rem;
}
.approved-cell {
  white-space:nowrap;
  text-align:left;
}

.btn-back{margin-bottom:12px;display:inline-block;}

.btn-back{margin-bottom:12px;display:inline-block;}

.btn-back{margin-bottom:12px;display:inline-block;}

/* Studio Availability Widget – Minimal Border Refresh */
.studio-card {
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

/* Studio Availability Widget – Modern Premium Card Style (A-2) */
.studio-card {
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
    background: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
    transition: box-shadow 0.2s ease;
}
.studio-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.08) !important;
}

/* Studio Availability Widget – Ultra-Modern Soft Border (Option 1) */
.studio-card {
    border: 1px solid rgba(0, 0, 0, 0.03) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

/* Ultra-Modern Soft Border for Current Studio Availability widget */
.studio-availability-item {
    border: 1px solid rgba(0, 0, 0, 0.03) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
    padding: 16px !important;
    margin-bottom: 14px !important;
}

/* Ultra-Subtle Modern Card for Each Studio */
.studio-availability-item {
    border: 1px solid rgba(0, 0, 0, 0.02) !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    padding: 14px !important;
    margin-bottom: 12px !important;
}

/* Global UI Unification – Ultra-Subtle Modern (A) */

/* Widget containers */
.widget-card {
    border: 1px solid rgba(0,0,0,0.03) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
    padding: 16px !important;
}

/* Table rows */
table tr {
    border-bottom: 1px solid rgba(0,0,0,0.05) !important;
}
table th {
    background: #fafafa !important;
}
table td {
    background: #ffffff !important;
}

/* Booking modal */
.modal {
    border-radius: 14px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12) !important;
}

/* Ultra-Subtle Modern Widget Container – v2.2.39 */
.widget-card {
    border: 1px solid rgba(0,0,0,0.02) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
    padding: 16px !important;
}

/* Ultra-subtle modern style for each studio item – v2.2.40 */
.studio-availability-item {
    border: 1px solid rgba(0, 0, 0, 0.02) !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
    padding: 14px !important;
    margin-bottom: 12px !important;
}

/* Ultra-subtle modern style for kiosk mini cards – v2.2.41 */
.kiosk-mini {
    border: 1px solid rgba(0, 0, 0, 0.02) !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
    padding: 10px 12px !important;
}

/* Targeted kiosk preview styling – v2.2.42 */
[data-widget="kiosk_preview"] .kiosk-mini {
    background: #ffffff !important;
    border: 0px solid rgba(0, 0, 0, 0.3) !important;
    border-radius: 10px !important;
    padding: 16px 18px !important;
    margin-bottom: 16px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18) !important;
}


/* Booking description under category */
.booking-description{font-size:0.8em;opacity:0.85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;}

/* FullCalendar day header */
.fc-day-name{font-weight:600;font-size:0.85em;line-height:1.1;}
.fc-day-date{font-size:0.8em;opacity:0.85;line-height:1.1;}

/* Final calendar header tuning */
.fc-day-name {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.1;
}
.fc-day-date {
  font-size: 0.9rem;
  opacity: 0.85;
  line-height: 1.1;
}


/* Dashboard booking description (truncated with tooltip) */
.dash-list-desc{
  font-size:0.9em;
  opacity:0.85;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* PATCH: Booking modal scroll support */
.modal-dialog {
  max-height: 90vh;
}
.modal-content {
  max-height: 90vh;
  overflow-y: auto;
}

/* PATCH: sticky modal footer for booking actions */
.modal-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  z-index: 10;
  border-top: 1px solid #e5e5e5;
}

/* PATCH: collapsible recurring booking section */
.recurring-options {
  margin-top: 10px;
}
.recurring-options.collapsed {
  display: none;
}
.recurring-toggle {
  cursor: pointer;
  font-weight: 600;
}

/* PATCH v2.2.54: ensure recurrence fields editable on existing bookings */
.recurring-options input,
.recurring-options select {
  pointer-events: auto;
  opacity: 1;
}

/* v2.2.56 override: recurrence must be editable on edit */
.recurring-options [disabled] {
  pointer-events: auto !important;
  opacity: 1 !important;
}

/* v2.2.57 recurrence unlock */
.recurring-options,
.recurring-toggle {
  opacity: 1 !important;
  pointer-events: auto !important;
}
.recurring-options input[disabled],
.recurring-options select[disabled] {
  opacity: 1 !important;
}


/* Calendar toolbar */
.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.calendar-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

#newBookingBtn {
  margin-left: auto;
}


/* Calendar controls alignment */
.calendar-controls {
  display: flex;
  align-items: center;
}

.calendar-controls #newBookingBtn {
  margin-left: auto;
}


/* v2.4.6: force calendar toolbar to be one row across */
.calendar-filters,
.calendar-controls {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  white-space: nowrap;
}

.calendar-filters > * {
  flex: 0 0 auto;
}

#newBookingBtn {
  margin-left: auto;
}


/* v2.4.7: ensure calendar grid is always below controls */
.fc,
#calendar,
.calendar-wrapper {
  clear: both;
  display: block;
  width: 100%;
  margin-top: 16px;
}

/* Ensure controls row does not wrap calendar */
.calendar-controls,
.calendar-filters {
  flex-wrap: nowrap;
}


/* v2.4.8 structural calendar layout */
.calendar-controls-row {
  width: 100%;
}

.calendar-grid-row {
  width: 100%;
  margin-top: 16px;
}


/* Login screen full-page background */
.login-page, body.login-page {
  min-height: 100vh;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}


/* Portal Links actions: spacing between pill buttons */
.actions-cell a.btn { margin-right: 6px; }
.actions-cell a.btn:last-child { margin-right: 0; }


/* === Brand Logo System v1.0.38 === */
.logo-frame{display:inline-flex;align-items:center;justify-content:center;background:#f7f8fa;border-radius:12px;overflow:hidden;box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);}
.logo-xs{width:32px;height:32px;padding:4px;}
.logo-sm{width:48px;height:48px;padding:6px;}
.logo-md{width:80px;height:80px;padding:8px;}
.logo-lg{width:120px;height:120px;padding:10px;}
.logo-xl{width:160px;height:160px;padding:12px;}
.logo-frame img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;display:block;}
.logo-frame.tight img{object-fit:cover;}
.table-logo{padding:6px;}



/* === Admin portal link logo preview (live fix) === */
.preview-logo {
  width: 300px;
  height: 300px;
  padding: 16px;
}

.preview-logo img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
}

.preview-block {
  margin-bottom: 12px;
}


/* === Global system colour contract === */
:root {
  --system-bar-bg: #111827;
  --system-bar-text: #ffffff;

  /* Banner background colour injected inline as --banner-bg-color */
  --system-banner-bg: var(--banner-bg-color);
  --system-banner-text: #111827;
}
