:root {
    color-scheme: light;
    --schedule-ink: #173042;
    --schedule-muted: #647789;
    --schedule-line: #dbe5eb;
    --schedule-soft: #f5f8fa;
    --schedule-teal: #0c9486;
    --schedule-teal-dark: #08766d;
    --schedule-green: #16834b;
    --schedule-green-bg: #e7f8ee;
    --schedule-blue: #2e6db3;
    --schedule-blue-bg: #e9f2fc;
    --schedule-red: #c5424e;
    --schedule-red-bg: #fdecee;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--schedule-ink);
    background: #edf3f5;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
    outline: 3px solid rgba(12, 148, 134, .24);
    outline-offset: 2px;
}

.schedule-app { min-height: 100vh; }
.schedule-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 60px;
    padding: 9px clamp(14px, 2.5vw, 30px);
    padding-top: calc(9px + env(safe-area-inset-top));
    border-bottom: 1px solid rgba(219, 229, 235, .9);
    background: rgba(247, 251, 252, .94);
    backdrop-filter: blur(14px);
}

.schedule-brand { display: flex; align-items: center; gap: 11px; min-width: 0; color: inherit; text-decoration: none; }
.schedule-brand-mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--schedule-teal);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: -.04em;
}
.schedule-brand-copy { min-width: 0; }
.schedule-brand-copy strong { display: block; color: var(--schedule-ink); font-size: 12px; line-height: 1.1; letter-spacing: -.01em; text-decoration: none; }
.schedule-brand-copy span { display: block; margin-top: 2px; color: var(--schedule-muted); font-size: 9px; font-weight: 700; text-decoration: none; }
.schedule-top-actions { display: flex; align-items: center; gap: 7px; flex-wrap: nowrap; justify-content: flex-end; }
.schedule-icon-button, .schedule-secondary-button, .schedule-primary-button {
    min-height: 34px;
    border: 1px solid var(--schedule-line);
    border-radius: 9px;
    background: #fff;
    color: var(--schedule-ink);
    padding: 7px 10px;
    font-size: 10px;
    font-weight: 850;
    transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.schedule-icon-button { width: 34px; padding: 7px; display: grid; place-items: center; }
.schedule-icon-button svg, .schedule-secondary-button svg, .schedule-primary-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.schedule-icon-button:hover, .schedule-secondary-button:hover { border-color: #9bcac4; background: #f4fbfa; color: var(--schedule-teal-dark); }
.schedule-primary-button { display: inline-flex; align-items: center; gap: 7px; border-color: var(--schedule-teal); background: var(--schedule-teal); color: #fff; }
.schedule-primary-button:hover { border-color: var(--schedule-teal-dark); background: var(--schedule-teal-dark); transform: translateY(-1px); }
.schedule-icon-button.is-active { border-color: #95d6cd; background: #e9f8f5; color: var(--schedule-teal-dark); }
.schedule-icon-button.is-active svg { fill: currentColor; }

.schedule-main { width: min(1500px, 100%); margin: 0 auto; padding: clamp(16px, 2.5vw, 26px) clamp(12px, 2.5vw, 30px) 32px; }
.schedule-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.schedule-heading h1 { margin: 0; color: #122d3d; font-size: clamp(22px, 3vw, 32px); line-height: 1; letter-spacing: -.055em; }
.schedule-heading p { max-width: 650px; margin: 7px 0 0; color: var(--schedule-muted); font-size: 11px; line-height: 1.45; font-weight: 650; }
.schedule-context { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; color: var(--schedule-muted); font-size: 10px; font-weight: 800; }
.schedule-context-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; border: 1px solid var(--schedule-line); border-radius: 8px; background: #fff; padding: 6px 9px; }
.schedule-context-chip.is-share { border-color: #cbdcf1; background: #f5f9fe; color: var(--schedule-blue); }
.schedule-context-chip.is-read-only { border-color: #d7e5eb; background: #f6fafb; color: #607786; }
.schedule-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--schedule-teal); }
.schedule-profile-card { display: flex; align-items: center; gap: 10px; border: 1px solid #cfe1e7; border-radius: 12px; background: #fff; padding: 8px 10px; box-shadow: 0 12px 26px -24px rgba(23, 48, 66, .55); }
.schedule-profile-avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; background: var(--schedule-teal); color: #fff; font-size: 13px; font-weight: 950; letter-spacing: -.04em; }
.schedule-profile-copy { display: grid; gap: 2px; min-width: 135px; text-align: left; }
.schedule-profile-copy strong { color: var(--schedule-ink); font-size: 16px; line-height: 1; letter-spacing: -.035em; }
.schedule-profile-copy small { color: var(--schedule-muted); font-size: 9px; font-weight: 800; }

.schedule-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.schedule-summary-card { min-width: 0; border: 1px solid var(--schedule-line); border-radius: 10px; background: #fff; padding: 10px 12px; }
.schedule-summary-card.is-primary { border-color: #b8e1da; background: #f2fbf9; }
.schedule-summary-card span, .schedule-summary-card small { display: block; color: var(--schedule-muted); font-size: 9px; font-weight: 800; }
.schedule-summary-card strong { display: block; margin: 2px 0 1px; color: #173042; font-size: 22px; line-height: 1; letter-spacing: -.04em; }
.schedule-summary-card small { color: #8a9aa4; font-size: 8px; font-weight: 700; }

.schedule-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.schedule-toolbar-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.schedule-month-controls { display: flex; align-items: center; gap: 6px; }
.schedule-month-label { min-width: 142px; color: #1a384a; font-size: 15px; font-weight: 900; text-align: center; text-transform: capitalize; }
.schedule-compact-button { min-height: 34px; border: 1px solid var(--schedule-line); border-radius: 8px; background: #fff; color: var(--schedule-muted); padding: 7px 9px; font-size: 10px; font-weight: 850; }
.schedule-compact-button:hover { border-color: #9bcac4; color: var(--schedule-teal-dark); background: #f4fbfa; }
.schedule-select { min-height: 36px; min-width: 150px; border: 1px solid var(--schedule-line); border-radius: 8px; background: #fff; color: var(--schedule-ink); padding: 7px 9px; font-size: 10px; font-weight: 800; }
.schedule-view-switch { display: inline-flex; border: 1px solid var(--schedule-line); border-radius: 8px; overflow: hidden; background: #fff; }
.schedule-view-switch button { min-height: 34px; border: 0; border-right: 1px solid var(--schedule-line); background: transparent; color: var(--schedule-muted); padding: 7px 10px; font-size: 10px; font-weight: 900; }
.schedule-view-switch button:last-child { border-right: 0; }
.schedule-view-switch button.is-active { background: #eaf8f5; color: var(--schedule-teal-dark); }

.schedule-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; color: var(--schedule-muted); font-size: 10px; font-weight: 750; }
.schedule-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.schedule-legend-swatch { width: 9px; height: 9px; border-radius: 3px; }
.schedule-legend-swatch.green { background: var(--schedule-green); }
.schedule-legend-swatch.blue { background: var(--schedule-blue); }
.schedule-legend-swatch.red { background: var(--schedule-red); }
.schedule-legend-note { margin-left: auto; color: #8a9aa4; }

.schedule-panel { overflow: hidden; border: 1px solid var(--schedule-line); border-radius: 13px; background: #fff; box-shadow: 0 20px 40px -38px rgba(23, 48, 66, .7); }
.schedule-weekdays, .schedule-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.schedule-weekdays { border-bottom: 1px solid var(--schedule-line); background: #f8fbfc; }
.schedule-weekday { padding: 9px 10px; color: #8093a0; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.schedule-calendar-grid { border-left: 1px solid var(--schedule-line); }
.schedule-day { position: relative; min-height: 132px; padding: 8px; border-right: 1px solid var(--schedule-line); border-bottom: 1px solid var(--schedule-line); background: #fff; }
.schedule-day.is-outside { background: #f9fbfc; }
.schedule-day.is-today { background: #fbfefd; box-shadow: inset 0 3px 0 var(--schedule-teal); }
.schedule-day.is-clickable { cursor: pointer; }
.schedule-day.is-clickable:hover { background: #f3fbf9; }
.schedule-day.is-drag-target { background: #effaf7; box-shadow: inset 0 0 0 2px var(--schedule-teal); }
.schedule-day-number { display: flex; align-items: center; justify-content: space-between; min-height: 23px; margin-bottom: 5px; }
.schedule-day-number strong { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; color: #526b7b; font-size: 11px; }
.schedule-day.is-today .schedule-day-number strong { background: var(--schedule-teal); color: #fff; }
.schedule-day-count { color: #91a1ab; font-size: 9px; font-weight: 800; }
.schedule-day-events { display: grid; gap: 4px; }
.schedule-event { position: relative; width: 100%; min-width: 0; display: block; border: 1px solid transparent; border-radius: 7px; padding: 6px 7px; text-align: left; }
.schedule-event[draggable="true"] { cursor: grab; }
.schedule-event[draggable="true"]:active { cursor: grabbing; }
.schedule-event.is-dragging { opacity: .42; }
.schedule-event:hover { filter: brightness(.98); border-color: currentColor; }
.schedule-hover-tooltip { position: fixed; left: 10px; top: 10px; z-index: 60; width: min(300px, calc(100vw - 20px)); border: 1px solid #cbdce2; border-radius: 8px; background: #173042; color: #fff; padding: 9px 10px; font-size: 10px; line-height: 1.45; font-weight: 700; white-space: pre-line; overflow-wrap: anywhere; box-shadow: 0 16px 30px -18px rgba(23, 48, 66, .85); pointer-events: none; }
.schedule-hover-tooltip[hidden] { display: none; }
.schedule-event.green { background: var(--schedule-green-bg); color: var(--schedule-green); }
.schedule-event.blue { background: var(--schedule-blue-bg); color: var(--schedule-blue); }
.schedule-event.red { background: var(--schedule-red-bg); color: var(--schedule-red); }
.schedule-event-head { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-width: 0; }
.schedule-event-head strong { display: flex !important; align-items: center; gap: 4px; flex: 1 1 auto; }
.schedule-event-client-dot { display: inline-block; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--event-client-color); box-shadow: 0 0 0 2px rgba(255, 255, 255, .72); }
.schedule-event-status { display: inline-flex !important; align-items: center; gap: 3px; flex: 0 0 auto; width: fit-content; border: 1px solid currentColor; border-radius: 999px; padding: 2px 5px; font-size: 7px !important; line-height: 1; font-weight: 950 !important; opacity: 1 !important; }
.schedule-event-status i { width: 4px; height: 4px; flex: 0 0 4px; border-radius: 50%; background: currentColor; }
.schedule-event-status.green { color: var(--schedule-green); background: #fff; }
.schedule-event-status.blue { color: var(--schedule-blue); background: #fff; }
.schedule-event-status.red { color: var(--schedule-red); background: #fff; }
.schedule-event strong, .schedule-event span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-event strong { font-size: 9px; font-weight: 900; }
.schedule-event span { margin-top: 2px; color: currentColor; font-size: 8px; font-weight: 750; opacity: .85; }
.schedule-event-pic { display: flex !important; align-items: center; gap: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-event-pic i, .schedule-list-photographer i { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: currentColor; }
.schedule-event-pic b, .schedule-list-photographer b { font-weight: 950; }
.schedule-day-empty { margin-top: 13px; color: #b5c1c7; font-size: 9px; font-weight: 700; }

.schedule-list { display: grid; gap: 7px; padding: 12px; }
.schedule-list[hidden] { display: none !important; }
.schedule-list-row { display: grid; grid-template-columns: 110px minmax(150px, 1fr) minmax(130px, .8fr) minmax(140px, 1fr) minmax(150px, .9fr) auto; align-items: center; gap: 12px; min-height: 58px; border: 1px solid #e4edf0; border-radius: 9px; background: #fff; padding: 8px 10px; }
.schedule-list-row:hover { border-color: #b7d9d4; background: #fcfefe; }
.schedule-list-date strong, .schedule-list-client strong { display: block; font-size: 11px; font-weight: 900; }
.schedule-list-date span, .schedule-list-client span, .schedule-list-location { display: block; margin-top: 3px; color: var(--schedule-muted); font-size: 9px; font-weight: 700; }
.schedule-list-client span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-list-status { display: inline-flex; align-items: center; width: fit-content; gap: 6px; border-radius: 6px; padding: 5px 7px; font-size: 9px; font-weight: 900; }
.schedule-list-status.green { color: var(--schedule-green); background: var(--schedule-green-bg); }
.schedule-list-status.blue { color: var(--schedule-blue); background: var(--schedule-blue-bg); }
.schedule-list-status.red { color: var(--schedule-red); background: var(--schedule-red-bg); }
.schedule-list-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.schedule-list-photographer { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--schedule-muted); font-size: 9px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-list-photographer b { color: var(--schedule-ink); }
.schedule-list-actions { display: flex; align-items: center; gap: 5px; justify-content: flex-end; }
.schedule-row-button { min-height: 30px; border: 1px solid var(--schedule-line); border-radius: 7px; background: #fff; color: var(--schedule-muted); padding: 5px 8px; font-size: 9px; font-weight: 850; }
.schedule-row-button:hover { border-color: #9bcac4; color: var(--schedule-teal-dark); background: #f4fbfa; }
.schedule-row-button.danger:hover { border-color: #e8acb2; color: var(--schedule-red); background: var(--schedule-red-bg); }

.schedule-empty { padding: 28px 18px; text-align: center; }
.schedule-empty svg { width: 30px; height: 30px; margin: 0 auto 8px; fill: none; stroke: #9aadb6; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.schedule-empty h2 { margin: 0; color: #426071; font-size: 13px; font-weight: 900; }
.schedule-empty p { max-width: 420px; margin: 5px auto 0; color: var(--schedule-muted); font-size: 10px; line-height: 1.45; font-weight: 650; }
.schedule-empty .schedule-primary-button { margin-top: 11px; }
.schedule-loading { padding: 38px 18px; text-align: center; color: var(--schedule-muted); font-size: 10px; font-weight: 800; }

.schedule-client-view .schedule-back-link,
.schedule-client-view #schedule-admin-button,
.schedule-client-view #schedule-share-button,
.schedule-client-view #schedule-logout-button { display: none !important; }
.schedule-client-view .schedule-brand { pointer-events: none; }
.schedule-client-view .schedule-topbar { justify-content: center; }
.schedule-client-view .schedule-top-actions { margin-left: 0; }
.schedule-client-view .schedule-heading { align-items: flex-start; margin-bottom: 12px; }
.schedule-client-view .schedule-heading h1 { font-size: clamp(24px, 3vw, 30px); }
.schedule-client-view .schedule-heading p { max-width: 560px; }
.schedule-client-view .schedule-legend { margin-bottom: 10px; }

.schedule-back-link { display: inline-flex; align-items: center; gap: 5px; color: var(--schedule-muted); text-decoration: none; font-size: 10px; font-weight: 850; }
.schedule-back-link:hover { color: var(--schedule-teal-dark); }
.schedule-back-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.schedule-toast { position: fixed; right: 16px; bottom: 16px; z-index: 80; max-width: min(360px, calc(100vw - 32px)); border: 1px solid #b9ded8; border-radius: 10px; background: #fff; color: #244656; box-shadow: 0 18px 35px -24px rgba(15, 50, 66, .7); padding: 11px 13px; font-size: 11px; font-weight: 800; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.schedule-toast.is-visible { opacity: 1; transform: translateY(0); }
.schedule-toast.is-error { border-color: #eab2b8; color: var(--schedule-red); }

.schedule-modal-backdrop { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(19, 39, 53, .58); }
.schedule-modal-backdrop[hidden] { display: none; }
.schedule-modal { width: min(520px, 100%); max-height: min(92vh, 720px); overflow: auto; border: 1px solid #d9e6ea; border-radius: 13px; background: #fff; box-shadow: 0 28px 70px -32px rgba(10, 42, 57, .72); }
.schedule-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px 17px; border-bottom: 1px solid #e3edf0; }
.schedule-modal-head h2 { margin: 0; font-size: 16px; font-weight: 900; letter-spacing: -.02em; }
.schedule-modal-head p { margin: 5px 0 0; color: var(--schedule-muted); font-size: 10px; line-height: 1.45; font-weight: 650; }
.schedule-modal-close { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--schedule-line); border-radius: 7px; background: #fff; color: var(--schedule-muted); font-size: 17px; line-height: 1; }
.schedule-modal-body { display: grid; gap: 12px; padding: 16px 17px; }
.schedule-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.schedule-field { display: grid; gap: 5px; }
.schedule-field.full { grid-column: 1 / -1; }
.schedule-field label { color: #526b7b; font-size: 10px; font-weight: 900; }
.schedule-field input, .schedule-field select, .schedule-field textarea { width: 100%; min-height: 37px; border: 1px solid var(--schedule-line); border-radius: 8px; background: #fbfdfe; color: var(--schedule-ink); padding: 8px 9px; font-size: 11px; font-weight: 700; }
.schedule-field textarea { min-height: 76px; resize: vertical; line-height: 1.45; }
.schedule-field small { color: #8b9ca5; font-size: 9px; font-weight: 650; line-height: 1.4; }
.schedule-modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 12px 17px; border-top: 1px solid #e3edf0; background: #f8fbfc; }
.schedule-modal-actions-spacer { flex: 1; }
.schedule-secondary-button.danger { color: var(--schedule-red); border-color: #efc4c8; }
.schedule-secondary-button.danger:hover { border-color: #df929a; background: var(--schedule-red-bg); color: #a82e3a; }
.schedule-share-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.schedule-share-link input { min-width: 0; border: 1px solid var(--schedule-line); border-radius: 8px; background: #f7fafb; color: #536f7e; padding: 9px; font-size: 10px; font-weight: 700; }
.schedule-admin-note { border: 1px solid #f1dfb6; border-radius: 8px; background: #fffaf0; color: #956d20; padding: 9px 10px; font-size: 10px; line-height: 1.45; font-weight: 700; }

@media (max-width: 760px) {
    .schedule-topbar { align-items: flex-start; padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top)); }
    .schedule-top-actions { gap: 5px; flex-wrap: wrap; }
    .schedule-top-actions .schedule-secondary-button { padding-inline: 8px; }
    .schedule-main { padding: 14px 9px 24px; }
    .schedule-heading { display: block; }
    .schedule-context { justify-content: flex-start; margin-top: 9px; }
    .schedule-profile-card { width: 100%; justify-content: flex-start; }
    .schedule-profile-copy { min-width: 0; flex: 1; }
    .schedule-summary { gap: 6px; }
    .schedule-summary-card { padding: 8px 9px; }
    .schedule-summary-card span { font-size: 8px; }
    .schedule-summary-card strong { font-size: 18px; }
    .schedule-toolbar { display: grid; grid-template-columns: 1fr; }
    .schedule-toolbar-group { width: 100%; }
    .schedule-month-controls { justify-content: space-between; width: 100%; }
    .schedule-month-label { flex: 1; }
    .schedule-toolbar-group:last-child { justify-content: space-between; }
    .schedule-select { flex: 1; min-width: 0; }
    .schedule-legend-note { width: 100%; margin-left: 0; }
    .schedule-day { min-height: 92px; padding: 5px; }
    .schedule-weekday { padding: 7px 4px; font-size: 8px; text-align: center; }
    .schedule-day-number { margin-bottom: 3px; }
    .schedule-day-number strong { width: 21px; height: 21px; font-size: 10px; }
    .schedule-day-count { display: none; }
    #schedule-calendar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .schedule-weekdays, .schedule-calendar-grid { min-width: 700px; }
    .schedule-event { padding: 4px; border-radius: 5px; }
    .schedule-event strong { font-size: 8px; }
    .schedule-event span { display: none; }
    .schedule-event .schedule-event-status { display: inline-flex !important; font-size: 6px !important; padding: 2px 4px; }
    .schedule-event .schedule-event-pic { display: flex !important; font-size: 7px; }
    .schedule-list-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; padding: 10px; }
    .schedule-list-date { grid-column: 1; }
    .schedule-list-status { grid-column: 2; grid-row: 1 / span 2; }
    .schedule-list-client, .schedule-list-location { grid-column: 1; }
    .schedule-list-photographer { grid-column: 1; }
    .schedule-list-actions { grid-column: 2; grid-row: 3; }
    .schedule-list-location { display: none; }
    .schedule-form-grid { grid-template-columns: 1fr; }
    .schedule-field.full { grid-column: auto; }
    .schedule-modal-backdrop { padding: 8px; }
    .schedule-modal { max-height: calc(100vh - 16px); border-radius: 11px; }
    .schedule-empty { padding: 24px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; }
}
