/* ============================================================
   Admin Dashboard — weblift structure × Claude Workshop brand
   ============================================================ */

.page-admin {
  background: var(--surface);
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   LOGIN OVERLAY
   ============================================================ */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.login-card {
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 24px 60px -28px rgba(0, 0, 0, 0.18);
}
.login-brand {
  line-height: 1.1;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.login-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.login-name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.login-card h2 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
  line-height: 1.1;
}
.login-card > p {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 14.5px;
  line-height: 1.5;
}
.login-field {
  margin-bottom: 14px;
}
.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}
.login-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--hairline-2);
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 15px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.login-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(10, 82, 224, 0.12);
}
.login-error {
  color: #c0392b;
  font-size: 13.5px;
  margin-bottom: 12px;
  min-height: 0;
  line-height: 1.4;
}
.login-error:empty {
  display: none;
}
.login-success {
  background: var(--accent-soft);
  border: 1px solid rgba(10, 82, 224, 0.2);
  color: var(--accent-text);
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.login-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.login-btn:hover {
  background: var(--accent-hover);
}
.login-btn:active {
  transform: scale(0.98);
}
.login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.login-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  background: none;
  border: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: color 200ms var(--ease-out);
}
.login-link:hover {
  color: var(--accent);
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
#app {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  min-height: 100vh;
  background: var(--ink);
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  padding: 28px 0 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-logo {
  padding: 0 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.2;
}
.sidebar-logo-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  font-weight: 500;
}
.sidebar-logo-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: white;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 12px;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 200ms var(--ease-out), color 200ms var(--ease-out);
  background: transparent;
  border: 0;
  font-family: var(--sans);
  text-align: left;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.8;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
}
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}
.nav-item.active svg {
  opacity: 1;
}
.sidebar-footer {
  padding: 18px 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 12px;
}
.sidebar-email {
  font-family: var(--mono);
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-logout {
  background: none;
  border: 0;
  font-family: var(--sans);
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  font-weight: 500;
  transition: color 200ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.sidebar-logout:hover {
  color: white;
}
.sidebar-logout svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 768px) {
  #app {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    min-height: 0;
    flex-direction: row;
    padding: 12px 16px;
    align-items: center;
    position: sticky;
    top: 0;
  }
  .sidebar-logo {
    padding: 0;
    flex: 0 0 auto;
    margin-right: auto;
  }
  .sidebar-logo-label {
    display: none;
  }
  .sidebar-nav {
    flex-direction: row;
    padding: 0;
    gap: 4px;
    flex: 0 0 auto;
  }
  .nav-item {
    padding: 8px 12px;
  }
  .nav-item span {
    display: none;
  }
  .nav-item svg {
    width: 18px;
    height: 18px;
  }
  .sidebar-footer {
    display: none;
  }
}

/* ============================================================
   MAIN
   ============================================================ */
.main {
  flex: 1;
  padding: 40px 48px;
  overflow-y: auto;
  min-width: 0;
}
@media (max-width: 900px) {
  .main {
    padding: 24px 20px;
  }
}

.page-header {
  margin-bottom: 32px;
}
.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.028em;
  margin: 0 0 4px;
  line-height: 1.15;
  color: var(--ink);
}
.page-subtitle {
  font-size: 14.5px;
  color: var(--muted);
  margin: 0;
}
.page-action {
  background: var(--card);
  border: 1px solid var(--hairline-2);
  border-radius: 999px;
  padding: 9px 16px 9px 14px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  transition: background 200ms var(--ease-out), border-color 200ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.page-action:hover {
  background: var(--ink);
  color: var(--card);
  border-color: var(--ink);
}
.page-action svg {
  width: 14px;
  height: 14px;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 540px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
.stat-card {
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 1px 2px rgba(0, 0, 0, 0.03);
}
.stat-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 12px;
}
.stat-value {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.032em;
  line-height: 1;
  margin-bottom: 8px;
  color: var(--ink);
  font-feature-settings: "tnum";
}
.stat-value small {
  font-size: 0.5em;
  font-weight: 500;
  color: var(--muted);
}
.stat-caption {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 400;
}

/* ============================================================
   CONTENT GRID
   ============================================================ */
.content-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
}
@media (max-width: 1100px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
}
.content-card {
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  padding: 24px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 1px 2px rgba(0, 0, 0, 0.03);
}
.content-card-title {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 18px;
}
.empty-state {
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.empty-state--error {
  color: #c0392b;
}

/* ============================================================
   TABLE (small, in dashboard cards)
   ============================================================ */
.table-wrap {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
}
.table td {
  padding: 13px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-2);
  line-height: 1.4;
}
.table tr:last-child td {
  border-bottom: none;
}
.table tr[data-open]:hover td {
  background: rgba(10, 82, 224, 0.025);
}
.table td.muted {
  color: var(--muted);
}

/* ============================================================
   BAR CHART
   ============================================================ */
.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 36px;
  gap: 14px;
  align-items: center;
  padding: 9px 0;
}
.bar-label {
  font-size: 13.5px;
  color: var(--ink-2);
  text-align: right;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-track {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--accent);
}
.bar-fill--pending {
  background: #f5a623;
}
.bar-fill--confirmed {
  background: var(--accent);
}
.bar-fill--invoiced {
  background: #6e5cc4;
}
.bar-fill--paid {
  background: #1f9d55;
}
.bar-fill--cancelled {
  background: var(--muted-2);
}
.bar-value {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  text-align: right;
  font-feature-settings: "tnum";
}

/* ============================================================
   FILTERS + BOOKINGS TABLE
   ============================================================ */
.filters-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2fr;
  gap: 16px;
  align-items: end;
  margin-bottom: 20px;
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 1px 2px rgba(0, 0, 0, 0.03);
}
@media (max-width: 900px) {
  .filters-row {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 540px) {
  .filters-row {
    grid-template-columns: 1fr;
  }
}
.filter-field {
  min-width: 0;
}
.filter-field label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.filter-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--hairline-2);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 14px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.filter-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 82, 224, 0.12);
}
.filter-input::placeholder {
  color: var(--muted-2);
}
select.filter-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* Bookings table (full page) */
.bookings-table-card {
  padding: 0;
}
.bookings-table {
  width: 100%;
  border-collapse: collapse;
}
.bookings-table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
  white-space: nowrap;
}
.bookings-table th:first-child,
.bookings-table td:first-child {
  padding-left: 24px;
}
.bookings-table th:last-child,
.bookings-table td:last-child {
  padding-right: 24px;
}
.bookings-table td {
  padding: 14px 18px;
  font-size: 14px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  color: var(--ink-2);
  line-height: 1.4;
}
.bookings-table tr:last-child td {
  border-bottom: none;
}
.bookings-table tr:hover td {
  background: rgba(10, 82, 224, 0.025);
}
.bookings-table td a {
  color: var(--accent);
  text-decoration: none;
}
.bookings-table td a:hover {
  text-decoration: underline;
}
.bookings-table .muted {
  color: var(--muted);
  font-size: 12.5px;
}

.details-btn {
  padding: 6px 14px;
  border: 1px solid var(--hairline-2);
  border-radius: 999px;
  background: var(--card);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink);
  transition: background 200ms var(--ease-out), color 200ms var(--ease-out), border-color 200ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.details-btn:hover {
  background: var(--ink);
  color: var(--card);
  border-color: var(--ink);
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-pending {
  background: #fff4e0;
  color: #8a5a00;
}
.status-confirmed {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.status-invoiced {
  background: #ede8fa;
  color: #4a3a8a;
}
.status-paid {
  background: #d9f0de;
  color: #1f6b34;
}
.status-cancelled {
  background: var(--surface-2);
  color: var(--muted);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(29, 29, 31, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: flex-start;
  justify-content: center;
  z-index: 2000;
  padding: 40px 16px;
  overflow-y: auto;
}
.modal-overlay.open {
  display: flex;
  animation: fadeIn 240ms var(--ease-out);
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
.modal-card {
  background: var(--card);
  border-radius: 20px;
  width: 100%;
  max-width: 640px;
  padding: 32px;
  position: relative;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.3);
  margin: auto 0;
  animation: slideUp 320ms var(--ease-out);
}
@keyframes slideUp {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  border-radius: 999px;
  transition: background 200ms var(--ease-out), color 200ms var(--ease-out);
}
.modal-close:hover {
  background: var(--surface);
  color: var(--ink);
}
.modal-header {
  margin-bottom: 24px;
  padding-right: 32px;
}
.modal-header h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 6px;
  color: var(--ink);
}
.modal-header p {
  color: var(--ink-2);
  font-size: 14.5px;
  margin: 0 0 2px;
}
.modal-header p.muted {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.modal-section {
  margin-bottom: 22px;
}
.modal-section--row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 540px) {
  .modal-section--row {
    grid-template-columns: 1fr;
  }
}
.modal-section h3 {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 12px;
}
.modal-section label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 8px;
}
.modal-section select,
.modal-section textarea,
.modal-section input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--hairline-2);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 14.5px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.modal-section select:focus,
.modal-section textarea:focus,
.modal-section input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 82, 224, 0.12);
}
.modal-section textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}
.modal-section select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.modal-dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
  font-size: 14px;
  margin: 0;
}
.modal-dl dt {
  color: var(--muted);
  font-weight: 400;
}
.modal-dl dd {
  margin: 0;
  color: var(--ink);
  word-break: break-word;
}
.modal-dl--small {
  font-size: 12.5px;
}
.modal-dl .mono {
  font-family: var(--mono);
  font-size: 12px;
}
.quote-box {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  font-size: 14px;
  font-style: italic;
  color: var(--ink-2);
  line-height: 1.5;
}
.modal-section--meta {
  opacity: 0.7;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}
.modal-btn {
  padding: 11px 18px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 200ms var(--ease-out), color 200ms var(--ease-out), border-color 200ms var(--ease-out);
}
.modal-btn--ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--hairline-2);
}
.modal-btn--ghost:hover {
  background: var(--surface);
}
.modal-btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.modal-btn--primary:hover {
  background: var(--accent-hover);
}
.modal-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* ============================================================
   PAGE SWITCHING
   ============================================================ */
.page {
  display: none;
  animation: pageIn 320ms var(--ease-out);
}
.page.active {
  display: block;
}
@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
