/* ==========================================================================
   Shared site shell: design tokens, wallpaper, top navigation, buttons.
   Loaded on every page; page-specific sheets load after and may override.
   ========================================================================== */

:root {
    /* Pulled from the shop logo: olive script green, mid pistachio, and the
       brown of the MOCHI wordmark. */
    --primary-color: #6f7d43;
    --secondary-color: #8b9a58;
    --brand-brown: #836c4d;
    --brand-cream: #fdf9ee;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --border-radius: 8px;
    --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
}

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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    color: var(--gray-900);
    background-color: var(--brand-cream);
    background-image: url('../img/dog-wallpaper.svg');
    background-repeat: repeat;
    background-size: 220px 220px;
    background-attachment: fixed;
    min-height: 100vh;
}

/* Top navigation */
.site-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 50;
    flex-wrap: wrap;
}

.site-brand {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--gray-900);
    text-decoration: none;
    white-space: nowrap;
}

.site-links {
    display: flex;
    gap: 6px;
    flex: 1;
    /* Without an explicit min-width, a flex item does not shrink below
       its own content's width no matter what overflow says - that's what
       let this row's real (wide) content silently push past its allotted
       box and butt straight up against the bell/name/buttons with no gap,
       even though overflow-x:auto below looks like it should have
       clipped it. min-width:0 is what actually lets the box stop at the
       space .site-nav gave it. */
    min-width: 0;
    /* flex-shrink:0 on the links themselves (below) stops their own text
       from clipping, but that only pushes the overflow problem up a
       level - without this, once there are enough tabs the whole row no
       longer fits and .site-nav's own flex-wrap wraps this entire block
       onto a second line, landing under the notification bell instead of
       above it. Scrolling this row horizontally keeps every tab at full
       size without needing the rest of the header to reflow. */
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    /* A hint that there's more to scroll to, since the hidden scrollbar
       otherwise gives no visual cue at all. */
    mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
}

.site-links::-webkit-scrollbar {
    display: none;
}

.site-links a {
    padding: 7px 14px;
    border-radius: 6px;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
    transition: var(--transition);
    /* Without this, the flex row shrinks its items (including the
       "Consult the Stylist" pill) below their own content's width once
       there are enough tabs to run out of room - overflow:hidden on the
       pill then clips its own label's right side instead of the row
       simply wrapping or scrolling. */
    flex-shrink: 0;
}

.site-links a:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.site-links a.active {
    /* A light tint, not a solid fill of --primary-color (#6f7d43) - that's
       the exact same color the "Consult the Stylist" gradient button
       starts from, so a normal tab and that one looked equally "selected"
       side by side. */
    background: color-mix(in srgb, var(--primary-color) 20%, white);
    color: var(--primary-color);
}

.site-note {
    font-size: 0.8em;
    color: var(--gray-500);
    padding: 4px 10px;
    border: 1px dashed var(--gray-300);
    border-radius: 999px;
    white-space: nowrap;
}

/* Page shell */
.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

.page-header {
    margin-bottom: 22px;
}

.page-header h1 {
    font-size: 1.9em;
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.page-header p {
    color: var(--gray-700);
}

.panel {
    background: white;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(17, 24, 39, 0.1),
                0 10px 20px -5px rgba(17, 24, 39, 0.12);
}
/* Any two stacked panels need a visible gap - previously the only
   separation came from .page-header's own margin-bottom, so a panel
   sitting right after another panel (not a header) had none at all. */
.panel + .panel {
    margin-top: 20px;
}

.intro-panel {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--gray-50);
    box-shadow: none;
    border: 1px solid var(--gray-200);
}
.intro-panel .details-icon {
    flex-shrink: 0;
    font-size: 1.3em;
    line-height: 1;
    margin-top: 1px;
}
.intro-panel p {
    margin: 0;
    color: var(--gray-700);
    line-height: 1.5;
}

/* account_details.html's read-only summary - a name heading plus a
   plain list of "here's what's on file" rows, each hidden individually
   (not the whole list) when that one field has nothing to show. */
.details-name {
    margin: 0 0 12px;
    font-size: 1.4em;
    color: var(--gray-900);
}

.details-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.details-summary li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--gray-700);
}

.details-summary li.hidden {
    display: none;
}

.details-icon {
    flex-shrink: 0;
    width: 1.4em;
    text-align: center;
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

/* A <label class="btn"> (an upload button wrapping a hidden file input)
   or an <a class="btn"> (a link styled as a button, e.g. "My profile")
   is an inline element by default - its vertical padding paints outside
   its own line box and visually overlaps whatever text sits right above
   or below it, rather than reserving real space the way a <button>'s
   own inline-block default already does. */
label.btn,
a.btn {
    display: inline-block;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--secondary-color);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-300);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-ghost {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    padding: 8px 14px;
}

.btn-ghost:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Toast (shared with the frame tool) */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 420px;
    padding: 14px 20px;
    border-radius: var(--border-radius);
    background: var(--gray-900);
    color: white;
    box-shadow: var(--box-shadow-lg);
    z-index: 2000;
    font-weight: 500;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.hidden {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
}

.toast.success { background: var(--success-color); }
.toast.error   { background: var(--danger-color); }
.toast.warning { background: var(--warning-color); }

@media (max-width: 700px) {
    .site-nav {
        gap: 12px;
        padding: 12px 16px;
    }

    .site-links {
        display: none;
    }

    #nav-account,
    .site-instagram,
    .site-signout {
        display: none;
    }

    .site-note {
        display: none;
    }
}

/* ==========================================================================
   Brand: logo lockup and Instagram link
   ========================================================================== */

.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: block;
    /* The logo art sits on cream, so a matching ring hides the seam against
       the white nav bar. */
    background: var(--brand-cream);
    box-shadow: 0 0 0 1px rgba(111, 125, 67, 0.25);
}

.site-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.site-brand-text strong {
    font-size: 1.02em;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.01em;
}

.site-brand-text em {
    font-style: normal;
    font-size: 0.7em;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand-brown);
}

.site-instagram {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid var(--gray-300);
    border-radius: 999px;
    color: var(--brand-brown);
    text-decoration: none;
    font-size: 0.78em;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition);
}

.site-instagram:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--brand-cream);
}

@media (max-width: 900px) {
    .site-instagram span {
        display: none;
    }
}

/* ==========================================================================
   Nav session chrome
   Lives here, not in login.css: the nav is rendered by base.html on every
   page, so page-scoped styles left it unstyled everywhere except /login
   and /team.
   ========================================================================== */

.site-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86em;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
    text-decoration: none;
}

.site-user:hover {
    color: var(--primary-color);
}

.role-badge {
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--gray-200);
    color: var(--gray-700);
}

.role-badge.admin  { background: var(--primary-color); color: white; }
.role-badge.groomer { background: #ddd6fe; color: #5b21b6; }
.role-badge.parent { background: #d1fae5; color: #047857; }

.site-signout {
    font-size: 0.86em;
    font-weight: 600;
    color: var(--gray-500);
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    white-space: nowrap;
}

.site-signout:hover {
    color: var(--gray-900);
    border-color: var(--gray-500);
}

/* --------------------------------------------------------------------------
   Notification center — a bell in the nav, its panel dropping down from the
   header's bottom-right corner.
   -------------------------------------------------------------------------- */

.notif-center {
    position: relative;
}

.notif-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
}

.notif-bell:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.notif-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #c0392b;
    color: white;
    font-size: 0.66em;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.notif-badge.hidden {
    display: none;
}

.notif-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 300px;
    max-height: 380px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(76, 66, 42, 0.18);
    z-index: 60;
    padding: 10px;
}

.notif-panel.hidden {
    display: none;
}

.notif-panel-title {
    font-size: 0.82em;
    font-weight: 700;
    color: var(--gray-700);
    padding: 4px 6px 8px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 6px;
}

.notif-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notif-empty {
    padding: 16px 6px;
    text-align: center;
    font-size: 0.84em;
    color: var(--gray-400);
}

.notif-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 7px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.notif-item:hover {
    background: var(--gray-100);
}

.notif-item-cover {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--gray-100);
}

.notif-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.notif-item-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notif-item-title {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--gray-900);
}

.notif-item-snippet {
    font-size: 0.78em;
    color: var(--gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .notif-center {
        position: static;
    }

    .notif-panel {
        top: calc(100% + 10px);
        right: 16px;
        width: min(300px, calc(100vw - 32px));
    }
}


/* ==========================================================================
   Modal component

   Lives here, not in booking.css: the same modal markup is now used by the
   calendar, a client's page and the Appointments tab. While these rules were
   page-scoped, `.modal.hidden` had no `display: none` anywhere except the
   calendar — so closing a modal on any other page did nothing at all.
   ========================================================================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 28px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--box-shadow-lg);
    position: relative;
}

.modal-card.narrow {
    max-width: 420px;
}

.modal-card h2 {
    font-size: 1.3em;
    margin-bottom: 6px;
}

/* An unmistakable close control, top-right of every modal: a bordered
   circle rather than a bare glyph, turning red on hover so it reads as
   "dismiss" at a glance. */
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--gray-300);
    border-radius: 50%;
    background: white;
    font-size: 22px;
    line-height: 1;
    color: var(--danger-color);
    cursor: pointer;
    transition: var(--transition);
    z-index: 3;
}

.modal-close:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
    transform: scale(1.06);
}

.modal-close:focus-visible {
    outline: 2px solid var(--danger-color);
    outline-offset: 2px;
}

.modal-meta {
    color: var(--gray-500);
    font-size: 0.9em;
    margin-bottom: 18px;
}

.edit-booking-consultations {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--gray-50, #f8f6f0);
    border: 1px solid var(--gray-200, #e6e2d8);
}

.edit-booking-consultations.hidden {
    display: none;
}

.edit-booking-consultations h3 {
    margin: 0 0 10px;
    font-size: 0.95em;
}

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

.consultation-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.consultation-row img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex: none;
}

.consultation-meta {
    flex: 1;
    min-width: 0;
    font-size: 0.85em;
    color: var(--gray-700);
    text-decoration: none;
}

.consultation-meta:hover {
    text-decoration: underline;
}

.consultation-link-btn {
    flex: none;
    font-size: 0.82em;
    padding: 6px 10px;
}


/* ==========================================================================
   Pet record component

   Shared by the calendar's side panel, a client's page and anywhere else a
   dog's details are shown — so it belongs here rather than in booking.css.
   While these lived in the page-scoped sheet, the client page rendered the
   facts list with browser defaults and looked like a jumble.
   ========================================================================== */

/* Two columns: field name, then value. Rows are separated by a hairline so a
   long value stays readable against its own label. */
.pet-facts {
    display: grid;
    grid-template-columns: minmax(84px, max-content) minmax(0, 1fr);
    align-items: baseline;
    column-gap: 16px;
    font-size: 0.86em;
    margin: 0;
}

.pet-facts dt,
.pet-facts dd {
    padding: 7px 0;
    border-top: 1px solid var(--gray-200);
}

.pet-facts > dt:first-of-type,
.pet-facts > dt:first-of-type + dd {
    border-top: none;
}

.pet-facts dt {
    color: var(--gray-500);
    font-weight: 600;
    white-space: nowrap;
}

.pet-facts dd {
    color: var(--gray-900);
    margin: 0;
    /* Long coat descriptions wrap instead of stretching the column */
    overflow-wrap: anywhere;
}

.pet-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pet-alerts:empty {
    display: none;
}

.pet-alert {
    padding: 3px 10px;
    border-radius: 999px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.76em;
    font-weight: 600;
}

.pet-section {
    margin-top: 16px;
    padding-top: 13px;
    border-top: 1px solid var(--gray-200);
    text-align: left;
}

.pet-section h3,
.pet-section h4 {
    font-size: 0.74em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 7px;
}

.pet-notes {
    font-size: 0.88em;
    line-height: 1.5;
    color: var(--gray-700);
}

.pet-empty {
    font-size: 0.88em;
    color: var(--gray-500);
    font-style: italic;
}

/* A row, not a column: the text takes the space and the controls sit hard
   right, matching where the pen and cross sit on a card. */
.upcoming-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    margin-bottom: 7px;
    background: #eef2ff;
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    font-size: 0.85em;
}

.upcoming-when {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.upcoming-actions {
    display: flex;
    gap: 5px;
    margin-left: auto;
    flex-shrink: 0;
}

.upcoming-row span {
    color: var(--gray-700);
}

/* ==========================================================================
   Card hover icons (edit / remove)

   In site.css because the dog card is a shared partial used by more than one
   page — the same reason the modal and the pet-record styles live here.
   ========================================================================== */

.dog-card {
    position: relative;
}

.card-icons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 2;
}

/* Revealed on hover, and whenever anything inside the card has focus, so the
   icons are reachable by keyboard as well as by mouse. */
.dog-card:hover .card-icons,
.dog-card:focus-visible .card-icons,
.dog-card:focus-within .card-icons {
    opacity: 1;
    transform: translateY(0);
}

.card-icon-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: white;
    color: var(--gray-700);
    cursor: pointer;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card-icon-btn svg {
    width: 15px;
    height: 15px;
    display: block;
}

.card-icon-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: scale(1.08);
}

.card-icon-btn.danger:hover:not(:disabled) {
    border-color: var(--danger-color);
    background: var(--danger-color);
    color: white;
}

.card-icon-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Pets tab grid cells */
.dog-cell.hidden {
    display: none;
}

.dog-owner-link {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 0.84em;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.dog-owner-link:hover {
    text-decoration: underline;
}

/* Small variant, for the icons on an appointment row */
.card-icon-btn.small {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.card-icon-btn.small svg {
    width: 12px;
    height: 12px;
}

/* An upcoming appointment row lifts on hover and reveals its own controls */
.upcoming-row {
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.upcoming-row:hover {
    transform: translateY(-2px);
    background: #e6ebff;
    box-shadow: 0 6px 14px -6px rgba(17, 24, 39, 0.26);
}

.upcoming-actions {
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.upcoming-row:hover .upcoming-actions,
.upcoming-row:focus-within .upcoming-actions {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Pet profile photo
   ========================================================================== */

.dog-photo {
    position: relative;
    flex-shrink: 0;
    line-height: 0;
}

.dog-photo .dog-avatar {
    /* Uploaded photos are square JPEGs; drawn avatars are square SVGs. Both
       are cropped to the circle by the same rule. */
    object-fit: cover;
}

/* A small corner badge, not a full-photo overlay - the photo itself is now
   a click target too (opens the full-size lightbox), so the upload
   affordance can't cover the whole circle any more without swallowing
   every click meant for that instead. Matches .photo-clear's existing
   corner-badge sizing/position, just the opposite corner. */
.photo-upload {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 30%;
    height: 30%;
    min-width: 26px;
    min-height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid white;
    background: rgba(17, 24, 39, 0.75);
    color: white;
    cursor: pointer;
    transition: background 0.16s ease;
}

.photo-upload:hover,
.photo-upload:focus-within {
    background: rgba(17, 24, 39, 0.92);
}

.photo-upload svg {
    width: 55%;
    height: 55%;
}

.photo-upload input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.photo-upload:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Shown only when there is a photo to clear */
.photo-clear {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border: 1px solid var(--gray-300);
    border-radius: 50%;
    background: white;
    color: var(--danger-color);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    opacity: 0;
    transition: var(--transition);
}

.dog-photo.uploadable:hover .photo-clear,
.photo-clear:focus-visible {
    opacity: 1;
}

.photo-clear:hover {
    background: var(--danger-color);
    color: white;
}

.dog-photo.uploading .dog-avatar {
    opacity: 0.55;
}

/* The calendar panel's avatar is larger, so the camera scales with it */
#pet-photo-holder {
    margin: 0 auto 12px;
    width: 128px;
    height: 128px;
}

#pet-photo-holder .pet-avatar {
    margin: 0;
}

.photo-clear.hidden {
    display: none;
}

/* ==========================================================================
   Pet cards lift on hover

   Every pet card, not only the ones that open an editor: the lift says "this
   is one dog's record", and the pointer cursor is what says "clicking does
   something". Keeping the two separate means a read-only card still responds.
   ========================================================================== */

.dog-card,
.pet-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dog-card:hover,
.dog-card:focus-visible,
.pet-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 12px 22px -8px rgba(17, 24, 39, 0.28),
                0 4px 8px -2px rgba(17, 24, 39, 0.12);
}

/* Only a card that actually opens something claims the pointer. */
.dog-card.editable {
    cursor: pointer;
}

.dog-card.editable:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.dog-card.editable:active {
    transform: translateY(-1px);
}

/* The calendar's side-panel card is not a link, so no pointer — but it still
   lifts, and its own camera keeps working. */
.pet-card {
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    padding: 4px;
}

/* Photo section inside the edit modal */
.edit-photo-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    margin-bottom: 20px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
}

.edit-photo-row .dog-photo,
.edit-photo-row .dog-avatar {
    width: 86px;
    height: 86px;
    flex-shrink: 0;
}

.edit-photo-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.btn-small {
    padding: 5px 12px;
    font-size: 0.84em;
    align-self: flex-start;
    margin-top: 4px;
}

.btn-small.hidden {
    display: none;
}

/* --------------------------------------------------------------------------
   "Consult with our stylist" — the one deliberately showy control in the app.
   Lives here, not in a page stylesheet, because it sits in the shared
   appointment modal partial and so appears on every page that lists
   appointments.
   -------------------------------------------------------------------------- */

.btn-stylist {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 4px 0 18px;
    padding: 13px 22px;
    border: 0;
    border-radius: 999px;
    overflow: hidden;              /* keeps the shine inside the pill */
    cursor: pointer;
    text-decoration: none;
    font-size: 1.02em;
    font-weight: 700;
    letter-spacing: 0.015em;
    color: var(--brand-cream, #fdf9ee);
    background: linear-gradient(110deg,
        #6f7d43 0%, #97a85e 25%, #c9b273 50%, #836c4d 75%, #6f7d43 100%);
    background-size: 240% 100%;
    animation: stylist-drift 7s ease-in-out infinite;
    box-shadow: 0 6px 18px rgba(111, 125, 67, 0.32),
                inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-stylist:hover,
.btn-stylist:focus-visible {
    transform: translateY(-2px) scale(1.012);
    box-shadow: 0 10px 26px rgba(111, 125, 67, 0.42),
                inset 0 1px 0 rgba(255, 255, 255, 0.34);
    color: #fff;
}

.btn-stylist:active {
    transform: translateY(0) scale(0.995);
}

.btn-stylist:focus-visible {
    outline: 2px solid var(--brand-cream, #fdf9ee);
    outline-offset: 2px;
}

/* The gradient slides so the pill looks lit from a moving source. */
@keyframes stylist-drift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* A highlight that sweeps across every few seconds, and again on hover. */
.btn-stylist-shine {
    position: absolute;
    top: 0;
    left: -60%;
    width: 45%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(100deg,
        transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
    transform: skewX(-18deg);
    animation: stylist-sweep 4.5s ease-in-out infinite;
}

@keyframes stylist-sweep {
    0%        { left: -60%; }
    55%, 100% { left: 130%; }
}

.btn-stylist:hover .btn-stylist-shine {
    animation-duration: 1.1s;
}

.btn-stylist-label {
    position: relative;            /* above the shine */
    display: inline-flex;
    align-items: center;
    gap: 9px;
    text-shadow: 0 1px 2px rgba(76, 66, 42, 0.35);
}

.btn-stylist-spark {
    width: 19px;
    height: 19px;
    flex: none;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.75));
    animation: stylist-twinkle 2.4s ease-in-out infinite;
}

@keyframes stylist-twinkle {
    0%, 100% { opacity: 0.85; transform: scale(1) rotate(0deg); }
    50%      { opacity: 1;    transform: scale(1.14) rotate(8deg); }
}

.btn-stylist:hover .btn-stylist-spark {
    animation-duration: 1.2s;
}

/* Anyone who has asked the system to calm animations down gets a button that
   still reads as special, without the motion. */
@media (prefers-reduced-motion: reduce) {
    .btn-stylist,
    .btn-stylist-shine,
    .btn-stylist-spark {
        animation: none;
    }

    .btn-stylist {
        background-position: 30% 50%;
    }

    .btn-stylist-shine {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   The stylist nav tab: the same treatment as the button, dialled down to sit
   in a row of plain links without shouting over the brand mark.
   -------------------------------------------------------------------------- */

.site-nav a.nav-stylist {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: none;
    overflow: hidden;
    border-radius: 999px;
    padding: 7px 15px;
    font-weight: 700;
    color: var(--brand-cream, #fdf9ee);
    font-size: 0.95em;
    text-decoration: none;
    background: linear-gradient(110deg,
        #6f7d43 0%, #97a85e 25%, #c9b273 50%, #836c4d 75%, #6f7d43 100%);
    background-size: 240% 100%;
    animation: stylist-drift 7s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(111, 125, 67, 0.28),
                inset 0 1px 0 rgba(255, 255, 255, 0.26);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* Beats `.site-links a:hover` and `.site-links a.active`, both of which would
   otherwise flatten the gradient to a solid colour. */
.site-nav a.nav-stylist:hover,
.site-nav a.nav-stylist:focus-visible,
.site-nav a.nav-stylist.active {
    color: #fff;
    background: linear-gradient(110deg,
        #6f7d43 0%, #97a85e 25%, #c9b273 50%, #836c4d 75%, #6f7d43 100%);
    background-size: 240% 100%;
}

.site-nav a.nav-stylist:hover,
.site-nav a.nav-stylist:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(111, 125, 67, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

/* The current page gets a ring instead of extra motion, so "you are here"
   still reads at a glance. An outline, not another box-shadow ring - the
   pill's own overflow:hidden (needed to clip the shine sweep inside it)
   clips box-shadow too, but not an outline, which is what made the ring
   look thicker on some sides than others. */
.site-nav a.nav-stylist.active {
    box-shadow: 0 2px 10px rgba(111, 125, 67, 0.34),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    outline: 2px solid var(--brand-cream, #fdf9ee);
    outline-offset: 1.5px;
}

.nav-stylist-shine {
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(100deg,
        transparent 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
    transform: skewX(-18deg);
    animation: stylist-sweep 5.5s ease-in-out infinite;
}

.site-links a.nav-stylist:hover .nav-stylist-shine {
    animation-duration: 1.1s;
}

.nav-stylist-label {
    position: relative;            /* above the shine */
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(76, 66, 42, 0.3);
}

.nav-stylist-spark {
    width: 14px;
    height: 14px;
    flex: none;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.7));
    animation: stylist-twinkle 2.8s ease-in-out infinite;
}

.site-links a.nav-stylist:hover .nav-stylist-spark {
    animation-duration: 1.2s;
}

@media (prefers-reduced-motion: reduce) {
    .site-nav a.nav-stylist,
    .nav-stylist-shine,
    .nav-stylist-spark {
        animation: none;
    }

    .site-nav a.nav-stylist {
        background-position: 30% 50%;
    }

    .nav-stylist-shine {
        display: none;
    }
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f7f7f2;
    font-weight: 700;
}

/* ==========================================================================
   Tabs: a reusable bar + panel pair (e.g. Projects' three lists)
   ========================================================================== */

.tab-bar {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex-shrink: 0;
    padding: 10px 16px;
    border: none;
    background: none;
    font-size: 0.95em;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--gray-900);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-panel.hidden {
    display: none;
}

/* ==========================================================================
   Nav "More" dropdown
   ========================================================================== */

.nav-more {
    position: relative;
    flex-shrink: 0;
}

.nav-more-mobile,
.nav-mobile-only {
    display: none;
}

@media (max-width: 700px) {
    .nav-more-mobile,
    .nav-mobile-only {
        display: block;
    }

    #nav-more .nav-more-menu {
        left: 0;
        right: auto;
        box-sizing: border-box;
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 72px);
        overflow-y: auto;
    }

    #nav-more .nav-more-menu a {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    #nav-more .nav-more-menu a.nav-mobile-signout {
        position: sticky;
        bottom: 0;
        margin-top: 4px;
        border-top: 1px solid var(--gray-200);
        border-radius: 0 0 6px 6px;
        background: white;
        z-index: 1;
    }
}

.nav-more-toggle {
    padding: 7px 14px;
    border-radius: 6px;
    border: none;
    background: none;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.95em;
    cursor: pointer;
    white-space: nowrap;
}

.nav-more-toggle:hover,
.nav-more-toggle.active {
    background: color-mix(in srgb, var(--primary-color) 20%, white);
    color: var(--primary-color);
}

.nav-more-caret {
    font-size: 0.8em;
}

.nav-more-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    min-width: 160px;
    z-index: 60;
    padding: 6px;
}

.nav-more-menu.hidden {
    display: none;
}

/* The account dropdown sits at the far right of the nav - opening
   toward the left (the default, matching "More") would push its menu
   off the right edge of the viewport. */
#nav-account .nav-more-menu {
    left: auto;
    right: 0;
}

.site-user-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-more-menu a {
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
    white-space: nowrap;
}

.nav-more-menu a:hover {
    background: var(--gray-100);
}

/* Expandable groups keep the mobile More menu short without hiding actions. */
.nav-more-section {
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 4px;
    margin-bottom: 4px;
}

#nav-more .nav-more-section:last-of-type {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

.nav-more-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    color: var(--gray-600);
    font-size: 0.76em;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    list-style: none;
}

.nav-more-section > summary::-webkit-details-marker {
    display: none;
}

.nav-more-section > summary::after {
    content: "›";
    font-size: 18px;
    transition: transform 0.16s ease;
}

.nav-more-section[open] > summary::after {
    transform: rotate(90deg);
}

.nav-more-section > a {
    margin-left: 4px;
}

.nav-more-divider {
    height: 1px;
    margin: 8px 8px 4px;
    background: var(--gray-200);
}

/* Reached through the grouped list on small screens instead. */
@media (max-width: 700px) {
    .nav-desktop-only {
        display: none;
    }
}

.nav-more-menu a.active {
    background: color-mix(in srgb, var(--primary-color) 20%, white);
    color: var(--primary-color);
}

/* The "Payment: $X due" block inside the shared booking-edit modal - its
   own bordered card so it reads as a distinct action, not a stray line of
   text sitting below the reschedule form. Lives here rather than a
   page-specific stylesheet since the modal itself is included on several
   pages (appointments, booking calendar, pets, client detail). */
.edit-booking-payment,
.edit-booking-mark-paid {
    margin: 16px 0;
    padding: 14px 16px;
    border: 1px solid var(--gray-200, #e5e5df);
    border-radius: var(--border-radius);
    background: var(--gray-100, #f7f7f2);
}

.edit-booking-payment h3,
.edit-booking-mark-paid h3 {
    margin: 0 0 6px;
}

.edit-booking-payment .modal-meta,
.edit-booking-mark-paid .modal-meta {
    margin: 0 0 10px;
    font-weight: 700;
}

.edit-booking-payment.hidden,
.edit-booking-mark-paid.hidden,
.edit-booking-mark-paid-entry.hidden,
.edit-booking-mark-paid #edit-booking-mark-paid-undo-btn.hidden {
    display: none;
}

.edit-booking-payment .pet-facts,
.edit-booking-mark-paid .pet-facts {
    margin: 0 0 12px;
}

.edit-booking-mark-paid .pet-facts dt.hidden,
.edit-booking-mark-paid .pet-facts dd.hidden {
    display: none;
}

.edit-booking-mark-paid-status {
    margin: 0 0 8px;
    font-weight: 700;
}

/* These live outside .edit-booking-form's own .reg-form grid (mark-as-
   paid is a separate action, not part of the reschedule submit), so
   none of that form's label/input styling reaches them without this -
   same look, just declared again for this specific container. */
.edit-booking-mark-paid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--gray-700);
}

.edit-booking-mark-paid input,
.edit-booking-mark-paid select {
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 1em;
    font-family: inherit;
}

.edit-booking-mark-paid .form-actions {
    margin-bottom: 10px;
}

.edit-booking-mark-paid .field-note {
    margin: 0;
}

/* The Billing page's own "Mark as paid" modal - same bare-<label>
   problem as .edit-booking-mark-paid above, just in a different modal
   (billing.html rather than _booking_edit_modal.html), so it gets the
   same fix rather than inheriting anything from .modal-card generally. */
#billing-mark-paid-modal label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--gray-700);
}

#billing-mark-paid-modal input,
#billing-mark-paid-modal select {
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 1em;
    font-family: inherit;
}

#billing-mark-paid-modal .field-note {
    margin: 0 0 12px;
}

/* The reschedule form's own fields (Groomer/Date/Time/Service/Notes/
   Requested price/Received price/Started at/Finished at) - .reg-form's
   shared 2-column grid (register.css) works fine for a plain signup
   form, but pairs badly here once a textarea and date/time pickers are
   mixed in, splitting a label from its own input across rows. Every
   field in this one form stacks full-width instead. */
.edit-booking-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

#edit-booking-pet-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: var(--box-shadow);
}

#edit-booking-pet-photo.hidden {
    display: none;
}

.edit-booking-heading h2 {
    margin: 0;
}

#edit-booking-form label {
    grid-column: 1 / -1;
}

#edit-booking-form input[readonly] {
    background: var(--gray-100, #f3f3ee);
    color: var(--gray-500);
}

/* --------------------------------------------------------------------------
   Image lightbox — shared site-wide (moved here from stylist.css, which
   only ever loaded on stylist pages). Any .lightbox-open image anywhere -
   pet photos, business logos, groomer/parent profile pictures, plus the
   original stylist sheet/proposal/gallery photos - opens into this same
   #image-lightbox overlay (markup lives once in base.html). A "group" is a
   shared data-group value; arrow keys/buttons browse within one group.
   -------------------------------------------------------------------------- */

/* Cursor only - deliberately NOT a box-model reset here. Most triggers are
   plain <img> tags with their own fixed width/height (avatars, logos);
   forcing width:100% on those would fight that sizing. Only an actual
   <button> trigger (the stylist sheet/proposal images, which wrap an img
   inside a button for a11y) needs the button-chrome reset below. */
.lightbox-open {
    cursor: zoom-in;
}

button.lightbox-open {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    font: inherit;
    text-align: inherit;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 17, 15, 0.88);
    padding: 40px;
}

.lightbox.hidden {
    display: none;
}

.lightbox-image {
    max-width: min(90vw, 1100px);
    max-height: 82vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 1.6em;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition, all 0.2s ease);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font-size: 2em;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition, all 0.2s ease);
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.22);
}

.lightbox-nav[hidden] {
    display: none;
}

.lightbox-prev {
    left: 18px;
}

.lightbox-next {
    right: 18px;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: white;
    font-size: 0.82em;
    font-weight: 600;
}

.lightbox-counter[hidden] {
    display: none;
}

/* The page behind an open lightbox should not scroll — on a long results
   page it would drift the modal out from under the cursor. */
body.lightbox-locked {
    overflow: hidden;
}

@media (max-width: 640px) {
    .lightbox {
        padding: 16px;
    }

    .lightbox-nav {
        width: 42px;
        height: 42px;
        font-size: 1.6em;
    }

    .lightbox-prev {
        left: 6px;
    }

    .lightbox-next {
        right: 6px;
    }
}

/* --------------------------------------------------------------------------
   Refocus modal - move an already-uploaded photo's focus point (see
   refocus_photo.js). Reuses .lightbox's own overlay chrome (dark
   backdrop, centered flex layout) but its own stage/circle/save button.
   -------------------------------------------------------------------------- */

.refocus-stage {
    position: relative;
    width: 280px;
    height: 280px;
    overflow: hidden;
    border-radius: 50%;
    cursor: grab;
    touch-action: none;
}

.refocus-image {
    position: absolute;
    top: 50%;
    left: 50%;
    /* width/height/transform set by refocus_photo.js per-frame - this is
       just the anchor point (centered) they both build on. */
    transform-origin: center center;
    margin-top: 0;
    margin-left: 0;
    will-change: transform;
    max-width: none;
}

/* The circle "window" itself is just .refocus-stage's own clip (a round,
   overflow:hidden box) - this ring is purely the visible white outline on
   top of it, matching PhotoCropView/RefocusPhotoView's on-screen look. */
.refocus-circle {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid white;
    pointer-events: none;
}

.refocus-modal {
    flex-direction: column;
    gap: 16px;
}

.refocus-error {
    color: #ff8a8a;
    min-height: 1.2em;
    margin: 0;
}

.refocus-save {
    align-self: center;
}
