:root {
  --cream: #f4efe7;
  --cream-deep: #e7ddcf;
  --paper: #fffdf9;
  --ink: #171512;
  --ink-soft: #6d655c;
  --gold: #a9824c;
  --gold-soft: #d8c3a5;
  --wine: #7d2528;
  --line: rgba(23, 21, 18, 0.13);
  --success: #356c4a;
  --danger: #9b3838;
  --shadow: 0 24px 70px rgba(30, 23, 15, 0.09);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 3%, rgba(169, 130, 76, 0.12), transparent 28rem),
    var(--cream);
  font: 16px/1.55 "DM Sans", sans-serif;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.admin-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 12px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(244, 239, 231, 0.9);
  backdrop-filter: blur(18px);
}
.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.admin-brand > span {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  font: italic 600 1.55rem "Playfair Display", serif;
  color: var(--gold);
}
.admin-brand div { display: grid; line-height: 1.05; }
.admin-brand strong { font: 600 1.4rem "Playfair Display", serif; letter-spacing: 0.03em; }
.admin-brand small { margin-top: 5px; color: var(--ink-soft); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; }
.admin-user { display: flex; align-items: center; gap: 18px; color: var(--ink-soft); font-size: 0.9rem; }
.admin-user form { margin: 0; }
.admin-user button, .month-actions a, .month-actions button, .copy-line button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
  text-decoration: none;
}
.admin-user button:hover, .month-actions a:hover, .month-actions button:hover, .copy-line button:hover { border-color: var(--gold); }

.admin-shell { width: min(1480px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 70px; }
.admin-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 30px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.72);
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs a {
  flex: 1 0 auto;
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--ink-soft);
  text-align: center;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}
.admin-tabs a.active { color: #fff; background: var(--ink); }

.page-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.55fr);
  align-items: end;
  gap: 50px;
  margin: 34px 0 40px;
}
.page-intro.compact { max-width: 1050px; }
.page-intro h1 { margin: 4px 0 0; font: 600 clamp(2.7rem, 5vw, 5.5rem)/0.95 "Playfair Display", serif; letter-spacing: -0.04em; }
.page-intro h1 em { color: var(--gold); font-weight: 600; }
.page-intro > p { margin: 0 0 8px; color: var(--ink-soft); font-size: 1.02rem; }
.eyebrow { margin: 0; color: var(--gold); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; }
.muted { color: var(--ink-soft); }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stats-grid article { position: relative; overflow: hidden; min-height: 125px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 253, 249, 0.85); }
.stats-grid article::after { content: ""; position: absolute; right: -26px; bottom: -45px; width: 100px; height: 100px; border: 1px solid var(--gold-soft); border-radius: 50%; }
.stats-grid span { display: block; max-width: 120px; color: var(--ink-soft); font-size: 0.84rem; }
.stats-grid strong { display: block; margin-top: 10px; font: 600 2.15rem "Playfair Display", serif; }

.panel-card { margin-bottom: 20px; padding: clamp(20px, 3vw, 34px); border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 253, 249, 0.92); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.panel-heading h2 { margin: 3px 0 0; font: 600 clamp(1.55rem, 2.5vw, 2.35rem) "Playfair Display", serif; }
.calendar-heading { margin-bottom: 20px; }
.month-actions { display: flex; align-items: center; gap: 8px; }
.month-actions a, .month-actions button { display: inline-grid; min-width: 42px; min-height: 42px; place-items: center; padding: 8px 13px; }
.calendar-weekdays, .admin-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { border: 1px solid var(--line); border-bottom: 0; border-radius: 14px 14px 0 0; overflow: hidden; background: var(--ink); color: #fff; }
.calendar-weekdays span { padding: 9px; text-align: center; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; }
.admin-calendar { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.calendar-empty, .calendar-cell { min-width: 0; min-height: 126px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.calendar-empty { background: rgba(231, 221, 207, 0.25); }
.calendar-cell { display: flex; flex-direction: column; gap: 5px; padding: 9px; cursor: pointer; transition: background .2s ease, box-shadow .2s ease; }
.calendar-cell:hover, .calendar-cell:focus-visible { outline: 0; background: #fbf6ee; box-shadow: inset 0 0 0 2px var(--gold-soft); }
.calendar-cell > b { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; font-size: 0.8rem; }
.calendar-cell.today > b { color: #fff; background: var(--gold); }
.calendar-event { overflow: hidden; padding: 5px 7px; border-left: 3px solid var(--gold); border-radius: 5px; color: #3f3426; background: #f1e8db; font-size: 0.71rem; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event.christmas { border-left-color: var(--wine); color: #602025; background: #f4e2e2; }
.calendar-event.delivery-event.normal { border-left-color: var(--gold); color: #4f3d24; background: #f1e8db; }
.calendar-event.delivery-event.express { border-left-color: #ce7b23; color: #704310; background: #f9e6cc; }
.calendar-event.delivery-event.delivered { border-left-color: var(--success); color: #28573a; background: #dfeee4; }
.calendar-event.delivery-event.overdue { border-left-color: var(--danger); color: #762d2d; background: #f6dddd; }
.calendar-cell > small { color: var(--ink-soft); font-size: 0.69rem; }

.calendar-legend { display: flex; flex-wrap: wrap; gap: 9px 18px; margin: -7px 0 16px; color: var(--ink-soft); font-size: .76rem; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.calendar-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.calendar-legend .express-dot { background: #ce7b23; }
.calendar-legend .delivered-dot { background: var(--success); }
.calendar-legend .overdue-dot { background: var(--danger); }

.table-wrap { overflow-x: auto; }
.details-scroll { max-height: 390px; overflow: auto; scrollbar-gutter: stable; }
.details-scroll thead { position: sticky; z-index: 2; top: 0; background: var(--paper); }
table { width: 100%; min-width: 1050px; border-collapse: collapse; }
th { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink-soft); text-align: left; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; }
td { padding: 18px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td small { margin-top: 5px; color: var(--ink-soft); font-size: 0.78rem; line-height: 1.45; }
.tag, .status, .count-badge { display: inline-flex; align-items: center; width: fit-content; margin-bottom: 7px; padding: 4px 8px; border-radius: 999px; background: #eee7dc; color: #5e4a2c; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.tag-christmas { color: var(--wine); background: #f3dfdf; }
.status.paid { color: var(--success); background: #deeee3; }
.status.pending { color: #855f22; background: #f4ead5; }
.status.normal { color: #74541f; background: #f4ead5; }
.status.express { color: #8b4f12; background: #fae1c1; }
.status.delivered { color: var(--success); background: #deeee3; }
.status.overdue { color: var(--danger); background: #f5dcdc; }
.text-link { display: inline-block; margin-top: 7px; color: var(--gold); font-size: 0.78rem; font-weight: 600; }
.confirm-form { display: flex; gap: 5px; margin-top: 10px; }
.confirm-form input { width: 92px; padding: 7px; border: 1px solid var(--line); border-radius: 7px; }
.confirm-form button { border: 0; border-radius: 7px; padding: 7px 9px; color: #fff; background: var(--success); cursor: pointer; font-size: 0.74rem; }
.empty-state { padding: 35px; border: 1px dashed var(--line); border-radius: 14px; color: var(--ink-soft); text-align: center; }

.unscheduled-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.unscheduled-grid article { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.unscheduled-grid h3 { margin: 2px 0; font: 600 1.25rem "Playfair Display", serif; }
.unscheduled-grid p, .unscheduled-grid small { color: var(--ink-soft); }
.copy-line { display: flex; gap: 7px; width: 100%; margin-top: 13px; }
.copy-line input { min-width: 0; flex: 1; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: #f8f5f0; font-size: 0.78rem; }
.copy-line button { flex: 0 0 auto; border-radius: 9px; font-size: 0.78rem; }

.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
label { display: grid; gap: 7px; }
label > span { font-size: 0.82rem; font-weight: 600; }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
  color: var(--ink);
  background: #fff;
}
textarea { min-height: 105px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(169, 130, 76, 0.12); }
input[readonly] { color: var(--ink-soft); background: #f1ede7; }
.full-field { grid-column: 1 / -1; }
.price-preview { margin: 22px 0 16px; padding: 14px 16px; border-left: 3px solid var(--gold); border-radius: 0 9px 9px 0; color: var(--ink-soft); background: #f3ece2; }
.primary-button { min-height: 50px; border: 0; border-radius: 999px; padding: 12px 24px; color: #fff; background: var(--ink); cursor: pointer; font-weight: 600; }
.primary-button:hover { background: var(--gold); }
.password-form { display: grid; max-width: 650px; gap: 18px; }
.admin-booking-form label[hidden] { display: none; }

.delivery-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.delivery-rules article { display: grid; gap: 3px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255, 253, 249, .88); }
.delivery-rules article.express { border-color: rgba(206, 123, 35, .35); background: #fbecda; }
.delivery-rules span { color: var(--ink-soft); font-size: .76rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.delivery-rules strong { font: 600 1.65rem "Playfair Display", serif; }
.delivery-rules small { color: var(--ink-soft); }
.delivery-actions, .dialog-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.delivery-actions form, .dialog-actions form { margin: 0; }
.delivery-actions button, .dialog-actions button { border: 0; border-radius: 999px; padding: 8px 11px; color: #fff; cursor: pointer; font-size: .74rem; font-weight: 600; }
.express-button { background: #b76519; }
.delivered-button { background: var(--success); }
.secondary-button { color: var(--ink) !important; border: 1px solid var(--line) !important; background: #fff; }
.dialog-actions { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.dialog-actions button { min-height: 42px; padding: 10px 15px; }
.delivered-note { margin-top: 18px; padding: 13px 15px; border-radius: 10px; color: var(--success); background: #e5f1e8; }

.gallery-status.draft { color: #6c6255; background: #ece8e1; }
.gallery-status.available { color: #6d4d17; background: #f5e7cc; }
.gallery-status.selected { color: var(--success); background: #deeee3; }
.gallery-setup-notice { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 22px; border-color: rgba(159, 46, 46, .26); background: #fff8f6; }
.gallery-setup-notice h2 { margin: 4px 0 10px; }
.gallery-setup-notice p:not(.eyebrow) { max-width: 760px; margin: 0 0 20px; color: var(--ink-soft); line-height: 1.65; }
.gallery-setup-notice code { padding: 3px 7px; border-radius: 6px; background: rgba(40, 34, 29, .08); color: var(--ink); font-size: .9em; }
.gallery-setup-notice .primary-button { display: inline-flex; width: auto; text-decoration: none; }
.gallery-setup-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 50%; background: #9f2e2e; color: #fff; font: 700 1.25rem/1 "DM Sans", sans-serif; }
.gallery-upload-grid { display: grid; grid-template-columns: minmax(280px, 1.1fr) minmax(280px, 1fr) auto; align-items: end; gap: 16px; }
.gallery-file-field input { padding: 8px; }
.gallery-file-field input::file-selector-button { margin-right: 11px; padding: 9px 12px; border: 0; border-radius: 8px; color: #fff; background: var(--ink); cursor: pointer; }
.gallery-file-field small, .upload-note { color: var(--ink-soft); font-size: .76rem; }
.gallery-file-field small.upload-error { color: #9f2e2e; font-weight: 600; }
.upload-note { margin: 16px 0 0; }
.gallery-table-scroll { max-height: 470px; overflow: auto; scrollbar-gutter: stable; }
.gallery-table-scroll thead { position: sticky; z-index: 2; top: 0; background: var(--paper); }
.gallery-table { min-width: 900px; }
.gallery-table tr.current-row td { background: #f8efe3; }
.manage-gallery-link { display: inline-flex; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: #fff; font-size: .78rem; font-weight: 600; text-decoration: none; }
.manage-gallery-link:hover { border-color: var(--gold); }
.gallery-detail-card { scroll-margin-top: 96px; }
.gallery-detail-heading { align-items: flex-start; }
.gallery-detail-heading .muted { margin: 5px 0 0; }
.gallery-admin-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 19px; }
.gallery-admin-summary article { display: grid; gap: 3px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.gallery-admin-summary span, .gallery-admin-summary small { color: var(--ink-soft); font-size: .75rem; }
.gallery-admin-summary strong { font: 600 1.25rem "Playfair Display", serif; }
.gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #f7f2eb; }
.gallery-copy { flex: 1; max-width: 660px; margin: 0; }
.gallery-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.gallery-actions form { margin: 0; }
.gallery-actions button { min-height: 40px; padding: 8px 13px; border: 0; border-radius: 999px; color: #fff; cursor: pointer; font-size: .76rem; font-weight: 600; }
.gallery-actions button:disabled { opacity: .45; cursor: not-allowed; }
.gallery-publish-button { background: var(--ink); }
.gallery-paid-button { background: var(--success); }
.client-gallery-note { margin-bottom: 20px; padding: 15px 17px; border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; background: #f4ecdf; }
.client-gallery-note span { color: var(--ink-soft); font-size: .75rem; font-weight: 600; text-transform: uppercase; }
.client-gallery-note p { margin: 5px 0 0; }
.admin-photo-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.admin-photo-card { position: relative; overflow: hidden; border: 2px solid transparent; border-radius: 11px; background: #e4ddd4; }
.admin-photo-card.chosen { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(169,130,76,.14); }
.admin-photo-card img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.admin-photo-card > div { display: grid; min-width: 0; padding: 8px 9px; background: #fff; }
.admin-photo-card span { color: var(--gold); font-size: .7rem; font-weight: 600; }
.admin-photo-card small { overflow: hidden; color: var(--ink-soft); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-photo-card form { position: absolute; z-index: 3; top: 6px; right: 6px; margin: 0; }
.admin-photo-card form button { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 50%; color: #fff; background: rgba(123,35,35,.86); cursor: pointer; font-size: 1rem; }

.schedule-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 740px; }
.schedule-layout { display: grid; grid-template-columns: minmax(270px, .68fr) minmax(0, 1.32fr); align-items: start; gap: 20px; }
.schedule-layout > .panel-card { margin-bottom: 0; }
.schedule-add-form { display: grid; gap: 22px; }
.schedule-add-form h2, .schedule-setup-notice h2 { margin: 4px 0 8px; font: 600 clamp(1.8rem, 3vw, 2.45rem) "Playfair Display", serif; }
.schedule-add-form p { margin: 0; }
.schedule-time-field input { min-height: 58px; font-size: 1.22rem; font-weight: 600; }
.schedule-catalog-card { min-width: 0; }
.schedule-note { margin: -6px 0 22px; padding: 13px 15px; border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; color: var(--ink-soft); background: #f5eee4; }
.schedule-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.schedule-item { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.schedule-item.is-inactive { background: #f2eee8; }
.schedule-item form { flex: 0 0 auto; margin: 0; }
.schedule-time-copy { display: grid; min-width: 0; gap: 5px; }
.schedule-time-copy > strong { font: 600 1.42rem "Playfair Display", serif; white-space: nowrap; }
.schedule-status { width: fit-content; padding: 3px 8px; border-radius: 999px; font-size: .68rem; font-weight: 600; }
.schedule-status.active { color: var(--success); background: #deeee3; }
.schedule-status.inactive { color: #746b61; background: #e3ddd5; }
.schedule-toggle-button { min-height: 38px; border: 0; border-radius: 999px; padding: 8px 12px; color: #fff; cursor: pointer; font-size: .74rem; font-weight: 600; }
.schedule-toggle-button.disable { background: var(--danger); }
.schedule-toggle-button.enable { background: var(--success); }
.schedule-setup-notice { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 20px; border-color: rgba(155,56,56,.25); background: #fff8f6; }
.schedule-setup-notice p:not(.eyebrow) { margin: 0; color: var(--ink-soft); }
.schedule-setup-notice code { padding: 3px 7px; border-radius: 6px; color: var(--ink); background: rgba(40,34,29,.08); }
.schedule-setup-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 50%; color: #fff; background: var(--danger); font-weight: 700; }

.alert { display: grid; gap: 5px; margin: 0 0 22px; padding: 16px 18px; border: 1px solid; border-radius: 13px; }
.alert-success { border-color: rgba(53, 108, 74, 0.28); color: #244f35; background: #e8f3eb; }
.alert-error { border-color: rgba(155, 56, 56, 0.3); color: #702a2a; background: #f7e7e7; }

.calendar-dialog { width: min(980px, calc(100% - 30px)); max-height: min(760px, calc(100vh - 30px)); padding: 0; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); background: var(--paper); box-shadow: 0 35px 100px rgba(23, 21, 18, .3); }
.calendar-dialog::backdrop { background: rgba(23, 21, 18, .62); backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 28px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { margin: 3px 0 0; font: 600 2rem "Playfair Display", serif; }
.dialog-heading > button { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; cursor: pointer; font-size: 1.5rem; }
.dialog-layout { display: grid; grid-template-columns: 300px 1fr; min-height: 430px; }
.day-session-list { display: grid; align-content: start; gap: 9px; overflow-y: auto; max-height: 570px; padding: 22px; border-right: 1px solid var(--line); background: #f7f2eb; }
.day-session-list > button { display: grid; gap: 3px; width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; cursor: pointer; text-align: left; }
.day-session-list > button.active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(169,130,76,.12); }
.day-session-list small { color: var(--ink-soft); }
.session-detail { overflow-y: auto; max-height: 570px; padding: 26px 30px; }
.session-detail h3 { margin: 4px 0 18px; font: 600 2rem "Playfair Display", serif; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.detail-grid div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.detail-grid small, .detail-grid strong { display: block; }
.detail-grid small { margin-bottom: 4px; color: var(--ink-soft); }
.detail-grid .wide { grid-column: 1/-1; }
.session-detail .text-link { margin-top: 18px; }

.login-page { display: grid; place-items: center; padding: 28px; background: var(--ink); }
.login-shell { display: grid; grid-template-columns: 1.05fr 0.85fr; width: min(1040px, 100%); min-height: 650px; overflow: hidden; border-radius: 28px; background: var(--cream); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.28); }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; padding: clamp(36px, 6vw, 75px); color: #fff; background: linear-gradient(145deg, #201b16, #0d0c0a); }
.login-brand::before, .login-brand::after { content: ""; position: absolute; border: 1px solid rgba(216, 195, 165, 0.35); border-radius: 50%; }
.login-brand::before { width: 430px; height: 430px; right: -180px; top: -140px; }
.login-brand::after { width: 250px; height: 250px; right: -70px; top: -40px; }
.brand-mark { position: absolute; top: 50px; left: 60px; display: grid; width: 58px; height: 58px; place-items: center; border: 1px solid var(--gold-soft); border-radius: 50%; color: var(--gold-soft); font: italic 600 2rem "Playfair Display", serif; }
.login-brand p { margin: 0 0 8px; color: var(--gold-soft); letter-spacing: 0.24em; text-transform: uppercase; }
.login-brand h1 { margin: 0; font: 600 clamp(3rem, 6vw, 5.3rem)/0.95 "Playfair Display", serif; letter-spacing: -0.045em; }
.login-brand h1 em { color: var(--gold-soft); }
.login-brand small { margin-top: 24px; color: rgba(255, 255, 255, 0.65); font-size: 0.94rem; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 6vw, 72px); }
.login-card h2 { margin: 5px 0 0; font: 600 2.8rem "Playfair Display", serif; }
.login-card > .muted { margin: 4px 0 28px; }
.login-card form { display: grid; gap: 17px; }
.login-card .primary-button { margin-top: 5px; }
.back-link { width: fit-content; margin-top: 22px; color: var(--ink-soft); font-size: 0.86rem; text-decoration: none; }

@media (max-width: 1050px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unscheduled-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-empty, .calendar-cell { min-height: 105px; }
  .gallery-upload-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-upload-grid .primary-button { grid-column: 1 / -1; }
  .gallery-admin-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .schedule-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .admin-header { min-height: 68px; padding: 10px 16px; }
  .admin-brand > span { width: 39px; height: 39px; }
  .admin-brand strong { font-size: 1.15rem; }
  .admin-brand small, .admin-user > span { display: none; }
  .admin-shell { width: min(100% - 24px, 1480px); padding-top: 14px; }
  .admin-tabs { border-radius: 15px; }
  .admin-tabs a { padding: 9px 13px; }
  .page-intro { grid-template-columns: 1fr; gap: 18px; margin: 25px 0 28px; }
  .page-intro h1 { font-size: clamp(2.7rem, 14vw, 4rem); }
  .stats-grid, .form-grid, .unscheduled-grid, .delivery-rules, .schedule-stats { grid-template-columns: 1fr; }
  .full-field { grid-column: auto; }
  .calendar-panel { overflow: hidden; padding: 17px 10px 12px; }
  .calendar-heading { align-items: flex-start; min-width: 0; padding: 0 4px; }
  .calendar-heading h2 { font-size: 1.45rem; }
  .month-actions { gap: 4px; }
  .month-actions a, .month-actions button { min-width: 37px; min-height: 37px; padding: 6px 9px; font-size: .78rem; }
  .calendar-weekdays, .admin-calendar { width: 100%; min-width: 0; }
  .calendar-weekdays span { padding: 7px 1px; font-size: .61rem; letter-spacing: .02em; }
  .calendar-empty, .calendar-cell { min-height: 72px; }
  .calendar-cell { gap: 3px; padding: 4px 3px; }
  .calendar-cell > b { width: 23px; height: 23px; font-size: .72rem; }
  .calendar-event { align-self: center; width: min(24px, 75%); min-height: 7px; padding: 0; border: 0; border-radius: 999px; color: transparent !important; font-size: 0; }
  .calendar-cell > small { text-align: center; font-size: .58rem; }
  .calendar-legend { padding: 0 4px; gap: 7px 12px; }
  .login-page { padding: 0; background: var(--cream); }
  .login-shell { grid-template-columns: 1fr; width: 100%; min-height: 100vh; border-radius: 0; }
  .login-brand { min-height: 290px; padding: 40px 28px; }
  .brand-mark { top: 28px; left: 28px; }
  .login-brand h1 { font-size: 3.5rem; }
  .login-card { padding: 42px 26px; }
  .dialog-layout { grid-template-columns: 1fr; }
  .day-session-list { max-height: 210px; border-right: 0; border-bottom: 1px solid var(--line); }
  .session-detail { max-height: 400px; padding: 22px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid .wide { grid-column: auto; }
  .delivery-actions { min-width: 190px; }
  .gallery-upload-grid, .gallery-admin-summary { grid-template-columns: 1fr; }
  .gallery-setup-notice { grid-template-columns: 1fr; gap: 14px; }
  .gallery-upload-grid .primary-button { grid-column: auto; }
  .gallery-toolbar { align-items: stretch; flex-direction: column; }
  .gallery-copy { max-width: none; }
  .gallery-actions { justify-content: flex-start; }
  .admin-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .schedule-list { grid-template-columns: 1fr; }
  .schedule-setup-notice { grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 430px) {
  .admin-shell { width: min(100% - 14px, 1480px); }
  .panel-card { border-radius: 16px; }
  .calendar-heading { flex-direction: column; gap: 10px; }
  .month-actions { width: 100%; justify-content: space-between; }
  .month-actions button:nth-child(2) { flex: 1; }
  .calendar-empty, .calendar-cell { min-height: 64px; }
  .calendar-dialog { width: calc(100% - 12px); max-height: calc(100vh - 12px); border-radius: 15px; }
  .dialog-heading { padding: 18px; }
  .dialog-heading h2 { font-size: 1.5rem; }
  .admin-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .gallery-copy { display: grid; }
  .gallery-copy button { width: 100%; }
  .schedule-item { align-items: stretch; flex-direction: column; }
  .schedule-item form, .schedule-toggle-button { width: 100%; }
}
