body {
  margin: 0;
  background: var(--portal-background);
  color: var(--portal-text);
  font-family: var(--portal-font);
}

body[data-theme-page="photographer-login"] { background: radial-gradient(circle at 78% 16%, rgba(27, 157, 225, .25), transparent 30rem), linear-gradient(135deg, #061322, #102c44 55%, #07111f); color: #f4fbff; font-family: 'DM Sans', Arial, sans-serif; }
body[data-theme-page="photographer-login"] .auth-page { min-height: 100vh; padding: 24px; }
body[data-theme-page="photographer-login"] .auth-form { position: relative; width: min(100%, 430px); gap: 10px; padding: 34px; border: 1px solid rgba(170, 221, 244, .38); border-radius: 16px; background: rgba(8, 27, 44, .86); box-shadow: 0 28px 80px rgba(0, 0, 0, .42), inset 0 1px rgba(255, 255, 255, .08); backdrop-filter: blur(18px); }
body[data-theme-page="photographer-login"] .auth-form::before { content: 'PP'; display: grid; width: 58px; height: 58px; place-items: center; margin-bottom: 7px; border: 2px solid #65d6ed; border-radius: 50%; color: #65d6ed; font-weight: 800; letter-spacing: .08em; }
body[data-theme-page="photographer-login"] .auth-form h1 { margin: 0 0 8px; color: #fff; font-size: 30px; }
body[data-theme-page="photographer-login"] .auth-form h1::after { display: block; margin-top: 8px; color: #9bb7c9; content: 'Manage Your Studio'; font-size: 12px; font-weight: 400; letter-spacing: .04em; }
body[data-theme-page="photographer-login"] .auth-form label { margin-top: 7px; color: #c9dfec; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
body[data-theme-page="photographer-login"] .auth-form input { width: 100%; border: 1px solid rgba(166, 214, 238, .35); border-radius: 8px; background: rgba(3, 15, 27, .74); color: #fff; }
body[data-theme-page="photographer-login"] .auth-form input:focus { outline: 2px solid rgba(98, 216, 232, .35); border-color: #62d8e8; }
body[data-theme-page="photographer-login"] .auth-form button { min-height: 44px; margin-top: 11px; border-radius: 8px; background: linear-gradient(135deg, #0878b8, #159fe4); font-weight: 800; }
body[data-theme-page="photographer-login"] .auth-form a { color: #65d6ed; }
body[data-theme-page="photographer-login"] .form-error { color: #ffb5bd; }

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1.5rem;
}

.auth-form { width: min(100%, 360px); background: var(--portal-surface); border: 1px solid #d5dde3; border-radius: 8px; box-sizing: border-box; padding: 1.5rem; }

.auth-form {
  display: grid;
  gap: 0.6rem;
}

.auth-form h1 {
  margin: 0 0 0.7rem;
  font-size: 1.55rem;
}

.auth-form input,
.auth-form button,
.dashboard-header button {
  box-sizing: border-box;
  font: inherit;
  padding: 0.6rem;
}

.auth-form input {
  border: 1px solid #9caab5;
  border-radius: 4px;
}

.auth-form button,
.dashboard-header button {
  border: 0;
  border-radius: 4px;
  background: var(--portal-accent);
  color: #ffffff;
  cursor: pointer;
}

.form-error {
  color: #a61b1b;
  margin: 0.4rem 0 0;
}

.dashboard-shell {
  width: min(100% - 2rem, 960px);
  margin: 2rem auto;
  padding: 2rem;
  background: var(--portal-surface);
  border: 1px solid #d5dde3;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(20, 48, 64, 0.12);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-header div { display: grid; gap: 0.25rem; }
.eyebrow { color: var(--portal-accent); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.crm-nav { align-items: center; border-bottom: 1px solid #d5dde3; border-top: 1px solid #d5dde3; display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 1.25rem 0; padding: 0.5rem 0; }
.crm-nav-link { background: transparent; border: 1px solid transparent; border-radius: 4px; color: var(--portal-text); cursor: pointer; font: inherit; padding: 0.55rem 0.65rem; text-decoration: none; }
.crm-nav-link:hover, .crm-nav-link.active { background: color-mix(in srgb, var(--portal-accent) 12%, transparent); border-color: var(--portal-accent); color: var(--portal-accent); }
.crm-nav-link[aria-disabled="true"] { color: #64748b; cursor: default; }
.crm-nav-link[aria-disabled="true"]:hover { background: transparent; border-color: transparent; color: #64748b; }
.crm-nav-logout { margin-left: auto; }
.onboarding-banner { margin: 1.5rem 0; padding: 1.75rem; color: #f8fffd; background: linear-gradient(120deg, #0f5565, #158070); border-radius: 8px; }
.onboarding-banner h1 { margin: 0.35rem 0; font-size: 2rem; }
.onboarding-banner p { margin: 0; }

.profile-section {
  margin: 1.5rem 0;
  border-top: 1px solid #d5dde3;
  padding-top: 1rem;
}

.profile-section h2 { margin-top: 0; }

.profile-photo {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
}

.profile-details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1rem;
}

.profile-details dt {
  font-weight: bold;
}

.profile-details dd {
  margin: 0;
}

.crm-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.crm-actions a { padding: 0.7rem 1rem; border: 1px solid var(--portal-accent); border-radius: 4px; color: var(--portal-accent); font-weight: 700; text-decoration: none; }
.crm-actions a:hover { background: var(--portal-accent); color: #fff; }

.calendar-section { border-top: 1px solid #d5dde3; margin-top: 1.5rem; padding-top: 1rem; }
.calendar-header { align-items: center; display: flex; gap: 1rem; justify-content: space-between; }
.calendar-header h2 { margin: 0; }
.calendar-header div { align-items: center; display: flex; gap: 0.6rem; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 0.9rem; margin: 1rem 0; }
.calendar-legend span { font-size: 0.78rem; padding-left: 0.75rem; position: relative; }
.calendar-legend span::before { background: #64748b; content: ''; height: 0.55rem; left: 0; position: absolute; top: 0.2rem; width: 0.55rem; }
.legend-booked::before { background: #c94a4a !important; }.legend-available::before { background: #4a9a67 !important; }.legend-pending::before { background: #d8aa3a !important; }.legend-blocked::before { background: #3f464d !important; }.legend-today::before { background: transparent !important; border: 2px solid #2476c8; box-sizing: border-box; }
.booking-calendar { display: grid; gap: 0.25rem; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekday { color: #64748b; font-size: 0.75rem; font-weight: 700; padding: 0.35rem; text-align: center; }
.calendar-day { border: 1px solid #d5dde3; color: #1e2933; cursor: pointer; min-height: 3.3rem; overflow-wrap: anywhere; padding: 0.4rem; text-align: left; }
.calendar-day.booked { background: #c94a4a; color: #fff; }.calendar-day.pending { background: #d8aa3a; }.calendar-day.available { background: #dcefe1; }.calendar-day.blocked { background: #3f464d; color: #fff; }.calendar-day.today { border: 3px solid #2476c8; }
.calendar-details { border: 1px solid #d5dde3; margin-top: 1rem; padding: 0.75rem; }
.nav-placeholder { margin: 1rem 0 0; }
@media (max-width: 560px) { .calendar-header { align-items: flex-start; flex-direction: column; } .calendar-day { min-height: 2.8rem; padding: 0.25rem; } }
@media (max-width: 760px) {
  .crm-nav { align-items: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crm-nav-link { text-align: left; }
  .crm-nav-logout { margin-left: 0; }
}

/* Phase 2 profile presentation */
body { background: var(--portal-background) center / cover fixed; }
.dashboard-shell { background: rgba(8, 25, 39, 0.48); border: 1px solid rgba(218, 239, 249, 0.42); border-radius: 0; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3); max-width: 1400px; min-height: calc(100vh - 4rem); overflow: hidden; padding: 0; width: min(100% - 1rem, 1400px); }
.topbar { align-items: center; background: rgba(7, 24, 39, 0.72); border-bottom: 1px solid rgba(218, 239, 249, 0.3); color: #f5fbff; display: flex; gap: 1.5rem; min-height: 68px; padding: 0.75rem 1.25rem; }
.brand { align-items: center; color: inherit; display: flex; gap: 0.7rem; min-width: 245px; text-decoration: none; }
.brand-mark { align-items: center; border: 2px solid #f5fbff; border-radius: 50%; display: flex; font-size: 1.4rem; height: 2.2rem; justify-content: center; width: 2.2rem; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.15rem; }
.brand small { color: rgba(245, 251, 255, 0.72); font-size: 0.68rem; margin-top: 0.15rem; }
.topbar-search { background: rgba(245, 251, 255, 0.12); border: 1px solid rgba(245, 251, 255, 0.3); border-radius: 999px; color: rgba(245, 251, 255, 0.72); flex: 1; max-width: 540px; padding: 0.65rem 1rem; }
.topbar-search span { float: right; color: #fff; font-size: 1.2rem; }
.topbar-account { align-items: center; display: flex; gap: 0.7rem; margin-left: auto; }
.topbar-account button { background: transparent; border: 1px solid rgba(245, 251, 255, 0.25); border-radius: 6px; color: #fff; cursor: pointer; font-size: 1.25rem; padding: 0.2rem 0.55rem; }
.notification-mark { font-size: 1.35rem; }
.dashboard-layout { display: grid; grid-template-columns: minmax(200px, 225px) minmax(0, 1fr); min-height: calc(100vh - 68px); }
.crm-sidebar { background: rgba(5, 22, 35, 0.6); border-right: 1px solid rgba(218, 239, 249, 0.25); display: flex; flex-direction: column; padding: 1rem 0.65rem; }
.sidebar-profile { align-items: center; border-bottom: 1px solid rgba(218, 239, 249, 0.22); display: flex; gap: 0.65rem; margin-bottom: 0.7rem; padding: 0.35rem 0.7rem 1rem; }
.sidebar-profile .profile-photo { border: 2px solid rgba(255, 255, 255, 0.8); height: 48px; margin: 0; width: 48px; }
.sidebar-profile strong, .sidebar-profile span { color: #fff; display: block; }
.sidebar-profile span { color: rgba(255, 255, 255, 0.68); font-size: 0.78rem; margin-top: 0.18rem; }
.crm-sidebar .crm-nav { align-items: stretch; border: 0; display: grid; gap: 0.15rem; margin: 0; padding: 0; }
.crm-sidebar .crm-nav-link, .crm-sidebar .crm-nav-logout { align-items: center; border: 0; border-radius: 7px; color: rgba(245, 251, 255, 0.82); display: flex; gap: 0.75rem; padding: 0.72rem 0.75rem; text-align: left; }
.crm-sidebar .crm-nav-link span, .crm-sidebar .crm-nav-logout span { font-size: 1.1rem; min-width: 1.1rem; text-align: center; }
.crm-sidebar .crm-nav-link:hover, .crm-sidebar .crm-nav-link.active { background: #12b7c9; color: #fff; }
.crm-sidebar .crm-nav-link[aria-disabled="true"] { cursor: default; opacity: 0.82; }
.crm-sidebar .crm-nav-link[aria-disabled="true"]:hover { background: transparent; color: rgba(245, 251, 255, 0.82); }
.crm-sidebar .crm-nav-logout { margin: auto 0 0; width: 100%; }
.dashboard-content { background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(7, 24, 39, 0.12)); min-width: 0; padding: 1.25rem; }
.breadcrumb { color: rgba(245, 251, 255, 0.75); display: flex; gap: 0.55rem; justify-content: flex-end; margin-bottom: 0.8rem; }
.page-heading h1 { color: #fff; font-size: clamp(1.7rem, 3vw, 2.2rem); margin: 0; }
.page-heading p { color: rgba(245, 251, 255, 0.78); margin: 0.3rem 0 1rem; }
.profile-form { display: grid; gap: 0.85rem; grid-template-columns: minmax(180px, 0.8fr) minmax(280px, 1.5fr) minmax(210px, 0.9fr); }
.profile-card { background: rgba(9, 29, 44, 0.56); border: 1px solid rgba(218, 239, 249, 0.42); border-radius: 9px; box-shadow: inset 0 1px rgba(255, 255, 255, 0.08); color: #f5fbff; padding: 0.85rem; }
.profile-card h2 { align-items: center; border-bottom: 1px solid rgba(218, 239, 249, 0.25); display: flex; font-size: 1rem; gap: 0.5rem; margin: 0 0 0.7rem; padding-bottom: 0.55rem; }
.card-icon { align-items: center; background: rgba(245, 251, 255, 0.9); border-radius: 5px; color: #15364b; display: inline-flex; height: 1.7rem; justify-content: center; width: 1.7rem; }
.card-icon svg, .photo-edit-button svg, .change-photo-button svg, .gps-action svg, .profile-actions button svg, .background-actions button svg { fill: none; height: 1rem; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; vertical-align: -0.15em; width: 1rem; }
.photo-edit-button svg, .change-photo-button svg, .gps-action svg, .profile-actions button svg, .background-actions button svg { margin-right: 0.35rem; }
.profile-identity-card { align-items: center; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.profile-portrait { align-items: center; background: rgba(245, 251, 255, 0.2); border: 3px solid rgba(245, 251, 255, 0.85); border-radius: 50%; display: flex; height: 120px; justify-content: center; margin-bottom: 0.7rem; overflow: hidden; width: 120px; }
.profile-portrait { overflow: visible; }
.profile-portrait img { border-radius: 50%; height: 100%; object-fit: cover; width: 100%; }
.profile-portrait span { color: rgba(245, 251, 255, 0.8); font-size: 2rem; }
.studio-identity { align-items: center; display: flex; gap: 0.7rem; margin-bottom: 0.8rem; }
.studio-identity img { background: rgba(245, 251, 255, 0.12); border: 1px solid rgba(218, 239, 249, 0.45); border-radius: 6px; height: 72px; object-fit: contain; padding: 4px; width: 72px; }
.studio-identity span { color: rgba(245, 251, 255, 0.62); font-size: 0.8rem; }
.photo-edit-button { background: #12b7c9; border: 2px solid #f5fbff; border-radius: 50%; bottom: -0.15rem; color: #fff; cursor: not-allowed; height: 2rem; min-width: 2rem; padding: 0; position: absolute; right: -0.15rem; width: 2rem; z-index: 2; }
.profile-portrait { position: relative; }
.change-photo-button { background: #12b7c9; border: 0; border-radius: 999px; color: #fff; cursor: not-allowed; font-size: 0.78rem; margin: 0.35rem auto 0; padding: 0.45rem 1rem; }
.profile-identity-card h2 { border: 0; margin: 0; padding: 0; }
.profile-role { background: #14c783; border-radius: 999px; color: #062137; font-size: 0.76rem; font-weight: 700; margin-top: 0.35rem; padding: 0.25rem 0.65rem; }
.profile-quote { border-top: 1px solid rgba(218, 239, 249, 0.25); color: rgba(245, 251, 255, 0.82); font-size: 0.8rem; font-style: italic; line-height: 1.5; margin: 0.85rem 0 0; padding-top: 0.7rem; }
.form-grid { display: grid; gap: 0.6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label { color: rgba(245, 251, 255, 0.86); font-size: 0.74rem; }
.form-grid input, .form-grid textarea { background: rgba(7, 24, 39, 0.62); border-color: rgba(218, 239, 249, 0.3); color: #fff; margin-top: 0.25rem; padding: 0.55rem 0.65rem; }
.form-grid textarea { min-height: 4rem; }
.form-grid input[readonly] { color: rgba(245, 251, 255, 0.7); }
.account-card dl { display: grid; gap: 0.55rem; grid-template-columns: 1fr auto; margin: 0; }
.account-card dt { color: rgba(245, 251, 255, 0.72); }
.account-card dd { margin: 0; text-align: right; }
.account-card dd:last-child { color: #19d48b; font-weight: 700; }
.personal-grid, .account-card { grid-column: span 1; }
.profile-form > .profile-card:nth-child(2) { grid-column: span 1; }
.profile-form > .profile-card:nth-child(4), .profile-form > .profile-card:nth-child(5) { grid-column: span 1; }
.about-card { grid-column: span 1; }
.about-card p { color: rgba(245, 251, 255, 0.76); line-height: 1.5; margin: 0; }
.profile-actions { align-items: center; display: flex; gap: 0.65rem; grid-column: 1 / -1; justify-content: flex-end; }
.profile-actions button { background: #16be82; border: 0; border-radius: 7px; color: #062137; cursor: pointer; font-weight: 700; padding: 0.7rem 1.1rem; }
.profile-actions button[type="button"] { background: rgba(245, 251, 255, 0.26); color: #fff; }
.profile-actions .form-error { margin-right: auto; }
.profile-section, .calendar-section { border-top-color: rgba(218, 239, 249, 0.25); }
.crm-actions { display: none; }
.onboarding-banner { display: none; }
.dashboard-content .calendar-section { margin-top: 2rem; }
.dashboard-content .calendar-section .calendar-header h2, .dashboard-content .calendar-section .calendar-header strong { color: #fff; }
.dashboard-content .calendar-section .calendar-legend span, .dashboard-content .calendar-section .calendar-details { color: rgba(245, 251, 255, 0.82); }
@media (max-width: 1050px) { .profile-form { grid-template-columns: minmax(180px, 0.8fr) minmax(280px, 1.2fr); } .account-card, .about-card { grid-column: span 1; } }
@media (max-width: 760px) { .topbar { align-items: flex-start; flex-wrap: wrap; } .brand { min-width: 0; } .topbar-search { flex-basis: 100%; order: 3; max-width: none; } .dashboard-layout { grid-template-columns: 1fr; } .crm-sidebar { border-bottom: 1px solid rgba(218, 239, 249, 0.25); border-right: 0; } .crm-sidebar .crm-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } .crm-sidebar .crm-nav-logout { margin: 0; width: auto; } }
@media (max-width: 560px) { .dashboard-shell { margin: 0; width: 100%; } .dashboard-content { padding: 0.8rem; } .profile-form { grid-template-columns: 1fr; } .profile-form > .profile-card { grid-column: auto; } .form-grid { grid-template-columns: 1fr; } .three-columns { grid-template-columns: 1fr; } .profile-actions { align-items: stretch; flex-direction: column; } .profile-actions .form-error { margin-right: 0; } .profile-actions button { width: 100%; } }

/* Reference layout constraints */
html, body { min-height: 100%; }
body { background: var(--portal-background) center / cover fixed; overflow-x: hidden; }
.dashboard-shell, .dashboard-layout, .dashboard-content, .profile-form, .profile-card, .form-grid { min-width: 0; }
.dashboard-shell { margin: 0; max-width: none; min-height: 100vh; overflow-x: hidden; width: 100%; }
.menu-toggle { background: transparent; border: 0; color: #f5fbff; cursor: pointer; display: none; font-size: 1.35rem; padding: 0.2rem; }
.dashboard-section[hidden] { display: none; }
.profile-form { align-items: stretch; display: grid; gap: 0.85rem; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.profile-form > .profile-card:nth-child(1) { grid-column: span 3; }
.profile-form > .profile-card:nth-child(2) { grid-column: span 6; }
.profile-form > .profile-card:nth-child(3) { grid-column: span 3; }
.profile-form > .profile-card:nth-child(4) { grid-column: span 4; }
.profile-form > .profile-card:nth-child(5) { grid-column: span 5; }
.profile-form > .profile-card:nth-child(6) { grid-column: span 3; }
.profile-form > .profile-actions, .background-preview { grid-column: 1 / -1; }
.profile-card { overflow: hidden; }
.profile-card *, .profile-card label, .profile-card input, .profile-card textarea { box-sizing: border-box; min-width: 0; max-width: 100%; }
.profile-card label, .profile-card input, .profile-card textarea { width: 100%; }
.profile-card textarea { max-width: 100%; overflow-wrap: anywhere; resize: vertical; }
.profile-details { display: grid; grid-template-columns: minmax(7.4rem, 46%) minmax(0, 1fr); min-width: 0; overflow-wrap: normal; word-break: normal; }
.profile-details dt, .profile-details dd { min-width: 0; overflow-wrap: normal; word-break: normal; }
.profile-details dt { white-space: normal; }
.profile-details dd { overflow-wrap: anywhere; }
.profile-details dd { text-align: right; }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.background-preview-inner { align-items: center; display: grid; gap: 0.85rem; grid-template-columns: 140px minmax(0, 1fr) auto; }
.background-preview-inner p { color: rgba(245, 251, 255, 0.7); margin: 0.25rem 0 0; }
.background-preview-inner button { background: rgba(18, 183, 201, 0.75); border: 0; border-radius: 7px; color: #fff; cursor: not-allowed; padding: 0.7rem 1rem; }
.background-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.background-actions button { align-items: center; display: inline-flex; white-space: nowrap; }
.background-actions button:first-child { background: rgba(202, 64, 83, 0.85); }
.gps-action { background: rgba(18, 183, 201, 0.75); border: 0; border-radius: 7px; color: #fff; cursor: not-allowed; justify-self: start; padding: 0.55rem 0.8rem; }
.background-thumb { background: linear-gradient(135deg, rgba(16, 66, 75, 0.8), rgba(226, 145, 113, 0.55)); border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 6px; height: 58px; }
.profile-actions { flex-wrap: wrap; gap: 0.75rem; }
@media (max-width: 1050px) {
  .dashboard-layout { grid-template-columns: minmax(190px, 215px) minmax(0, 1fr); }
  .profile-form > .profile-card:nth-child(1), .profile-form > .profile-card:nth-child(2), .profile-form > .profile-card:nth-child(3) { grid-column: span 6; }
  .profile-form > .profile-card:nth-child(1) { grid-row: span 2; }
  .profile-form > .profile-card:nth-child(4), .profile-form > .profile-card:nth-child(5), .profile-form > .profile-card:nth-child(6) { grid-column: span 4; }
}
@media (max-width: 760px) {
  .menu-toggle { display: block; }
  .topbar-account { max-width: 55%; }
  .topbar-account #photographer-welcome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .crm-sidebar { max-height: none; }
  .profile-form > .profile-card, .profile-form > .profile-actions, .background-preview { grid-column: 1 / -1 !important; }
  .profile-form > .profile-card:nth-child(1) { grid-row: auto; }
  .background-preview-inner { grid-template-columns: 96px minmax(0, 1fr); }
  .background-actions { grid-column: 1 / -1; justify-content: stretch; }
  .background-actions button { flex: 1 1 10rem; }
}
@media (max-width: 560px) {
  .dashboard-layout { display: block; }
  .crm-sidebar { border-right: 0; }
  .account-card .profile-details { grid-template-columns: minmax(7rem, 42%) minmax(0, 1fr); }
}
