/* Scoped editor styles: existing calendar and other company screens are unchanged. */
.order-photo-grid .order-photo-tile { position:relative; width:140px; height:100px; margin:0; flex:0 0 140px; background:#475569; border-radius:10px; overflow:hidden; }
.order-photo-tile[hidden] { display:none!important; }
.order-photo-tile img { display:block; width:140px; height:100px; object-fit:cover; }
.photo-remove { position:absolute; top:5px; right:5px; width:24px; height:24px; border:1px solid #ffffff88; border-radius:50%; display:grid; place-items:center; padding:0; background:#0f172ae6; color:#fff; font:20px/1 Arial,sans-serif; cursor:pointer; box-shadow:0 2px 5px #0005; z-index:2; }
.photo-remove:hover { background:#dc2626; }
.photo-remove:focus-visible { outline:3px solid #60a5fa; outline-offset:2px; }
.order-photo-tile form { margin:0; }
.appointment-editor .draft-bar[hidden] { display:none!important; }
.appointment-editor,.notice-drawer { --editor-line:#dbe3ee; --editor-soft:#f6f8fc; --editor-muted:#64748b; --editor-ink:#172033; --editor-bg:#fff; }
.theme-dark .appointment-editor,.theme-dark .notice-drawer { --editor-line:#314056; --editor-soft:#0c1629; --editor-muted:#a3b2c8; --editor-ink:#f1f5f9; --editor-bg:#101827; }
#appointmentModalBody { overflow-y:auto!important; overscroll-behavior:contain; scrollbar-gutter:stable; max-height:calc(100dvh - 44px)!important; }
.appointment-modal-window:has(.appointment-editor) { width:min(1100px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:clip!important; }
#appointmentModalBody .appointment-modal-head { margin-bottom:22px; }
#appointmentModalBody .appointment-modal-head h2 { font-size:30px; line-height:1.2; }
#appointmentModalBody .appointment-modal-head p { font-size:14px; line-height:1.5; max-width:780px; }
.appointment-editor .form-grid,#appointmentModalBody .appointment-editor .form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px 24px!important; align-items:start; }
.appointment-editor .form-grid > .order-field { display:flex!important; flex-direction:column!important; align-items:stretch!important; justify-content:flex-start!important; gap:8px!important; min-width:0; width:100%; margin:0!important; padding:0!important; border:0!important; border-radius:0!important; background:none!important; font-weight:600; }
.appointment-editor .order-field > span { font-size:14px; line-height:20px; color:var(--editor-ink); }
.appointment-editor input:not([type=checkbox]):not([type=file]):not([type=hidden]),.appointment-editor select { box-sizing:border-box; width:100%; height:48px!important; min-height:48px!important; max-height:48px!important; padding:11px 13px!important; margin:0!important; font-size:14px; line-height:24px; border-radius:12px!important; flex:none!important; }
.appointment-editor textarea,#appointmentModalBody .appointment-editor textarea { width:100%; min-height:112px!important; height:112px; max-height:300px!important; resize:vertical!important; padding:12px!important; border-radius:12px; font-size:14px; }
.appointment-editor .car-input-action-wrap,.appointment-editor .service-line-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:start; width:100%; }
.appointment-editor .service-line-row:has(.service-line-remove) { grid-template-columns:minmax(0,1fr) auto auto; }
.appointment-editor .found-services-button { height:48px; padding:0 12px; border-radius:12px; font-size:12px; }
.appointment-editor .found-services-button svg { width:16px; height:16px; }
.appointment-editor .service-add-line-button { margin-top:2px; width:fit-content; font-size:12px; }
.appointment-editor .service-line-remove { width:32px; height:48px; padding:0; border-radius:10px; }
.appointment-editor .appointment-datetime-wrap { width:100%; }
.appointment-editor .appointment-datetime-btn { position:absolute; top:4px!important; right:4px; width:40px; height:40px; border-radius:9px; transform:none!important; margin:0; padding:0; display:grid; place-items:center; }
.appointment-editor .char-counter { min-height:14px; margin:0; font-size:11px; line-height:14px; text-align:right; font-weight:400; }
.appointment-editor .field-help,.appointment-editor small[data-draft-note],#appointmentModalBody .appointment-editor .field-help,#appointmentModalBody .appointment-editor small[data-draft-note] { color:var(--editor-muted)!important; font-size:12px; line-height:1.5; font-weight:400; margin:0; }
.appointment-editor .char-counter,#appointmentModalBody .appointment-editor .char-counter { color:var(--editor-muted); }
.appointment-editor .field-error,#appointmentModalBody .appointment-editor .field-error { color:#ef4444!important; font-size:12px; line-height:1.5; margin:0; font-weight:500; }
.appointment-editor .has-error input,.appointment-editor .has-error select { border-color:#ef4444!important; }
.appointment-editor .span-2 { grid-column:1/-1; }
.appointment-editor .draft-bar { padding:12px 14px; margin:0 0 22px; border-color:var(--editor-line); background:var(--editor-soft); border-radius:14px; }
.appointment-editor .draft-bar .button { padding:9px 12px; font-size:12px; }
.appointment-editor .appointment-additional-card { margin-top:22px; border:1px solid var(--editor-line); border-radius:18px; background:var(--editor-soft); overflow:hidden; }
.appointment-editor .appointment-additional-summary { padding:17px 18px; display:flex; justify-content:space-between; align-items:center; gap:18px; }
.appointment-editor .appointment-additional-summary > span { font-size:16px; line-height:22px; }
.appointment-editor .appointment-additional-summary > small { color:var(--editor-muted)!important; font-size:12px; font-weight:400; line-height:1.5; }
.appointment-editor .appointment-additional-grid { padding:20px!important; margin:0!important; border-top:1px solid var(--editor-line); }
.appointment-editor .order-payment-help { margin-top:-10px; }
.appointment-editor .payment-totals,.appointment-editor .order-price-summary { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-start; gap:12px 24px; border:1px solid var(--editor-line); padding:12px 16px; border-radius:12px; background:var(--editor-bg); font-size:13px; }
.appointment-editor .order-price-summary[hidden] { display:none!important; }
.appointment-editor .order-price-summary span { display:grid; gap:4px; color:var(--editor-muted); }
.appointment-editor .order-price-summary strong { color:var(--editor-ink); font-size:16px; }
.appointment-editor .order-upload-panel { border:1px dashed var(--editor-line); border-radius:14px; padding:16px; min-width:0; background:var(--editor-bg); }
.appointment-editor .order-upload-heading { display:flex; justify-content:space-between; align-items:center; gap:18px; }
.appointment-editor .order-upload-heading h3 { margin:0 0 6px; font-size:14px; }
.appointment-editor .photo-add { position:relative; flex-shrink:0; padding:10px 14px; border-style:solid; border-color:var(--editor-line); border-radius:12px; font-size:13px; }
.appointment-editor .photo-add svg { width:21px; height:21px; }
.appointment-editor .order-workers { min-width:0; margin:0; padding:16px; border:1px solid var(--editor-line); border-radius:14px; background:var(--editor-bg); }
.appointment-editor .order-workers legend { padding:0 7px; font-size:14px; font-weight:600; }
.appointment-editor .order-workers #id_worker_ids { gap:8px; display:flex; flex-wrap:wrap; }
.appointment-editor .order-workers label { display:flex; align-items:center; gap:8px; padding:9px 12px; border:1px solid var(--editor-line); border-radius:10px; width:auto; background:var(--editor-soft); font-size:13px; margin:0!important; }
.appointment-editor .order-workers input[type=checkbox] { width:16px!important; height:16px; min-height:0; margin:0; accent-color:#2563eb; }
.appointment-editor .order-workers .field-help { margin-top:12px!important; }
.appointment-editor .appointment-modal-actions { padding-top:18px; margin-top:20px!important; border-top:1px solid var(--editor-line); }
.appointment-editor .appointment-modal-actions .button { min-height:44px; border-radius:12px; padding:11px 20px; font-size:13px; }
.notice-count { display:inline-grid; place-items:center; min-width:22px; height:22px; padding:0 5px; border-radius:20px; background:#2563eb; color:white; font-size:11px; }
.notice-count[hidden],.notice-drawer[hidden],.notice-backdrop[hidden],.notice-region[hidden] { display:none!important; }
.notifications-nav .notice-count { margin-left:auto; }
.notifications-rail { display:flex; position:fixed; left:8px; top:66px; z-index:72; width:86px; height:40px; border:1px solid #334155; border-radius:12px; align-items:center; justify-content:center; gap:8px; color:#dbeafe; background:#162236; text-decoration:none; opacity:0; visibility:hidden; pointer-events:none; transform:translateX(-12px); transition:opacity .26s ease,transform .26s ease,visibility 0s linear .26s; }
.notifications-rail svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; }
body.sidebar-collapsed .notifications-rail { opacity:1; visibility:visible; pointer-events:auto; transform:translateX(0); transition-delay:0s; }
body { --notice-menu-edge:280px; }
body.sidebar-collapsed { --notice-menu-edge:102px; }
.notice-backdrop { position:fixed; inset:0 0 0 var(--notice-menu-edge); z-index:4000; background:transparent; backdrop-filter:none; }
/* The clipping boundary makes the drawer emerge from beneath the menu. */
.notice-region { position:fixed; inset:0 0 0 var(--notice-menu-edge); z-index:4001; overflow:clip; pointer-events:none; transition:left .26s ease; }
.notice-drawer { position:absolute; inset:0 auto 0 0; width:min(450px,100%); background:var(--editor-bg); color:var(--editor-ink); padding:24px; overflow:auto; overscroll-behavior:contain; border-right:1px solid var(--editor-line); box-shadow:16px 0 40px #0003; transform:translateX(calc(-100% - 40px)); transition:transform .28s cubic-bezier(.22,.68,.25,1); pointer-events:none; }
.notice-region.is-open .notice-drawer { transform:translateX(0); pointer-events:auto; }
.notice-drawer > header { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:22px; }
.notice-drawer h2 { margin:0 0 6px; font-size:24px; }
.notice-drawer small,.notice-hint { color:var(--editor-muted); }
.notice-tools { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.notice-tools label { font-size:12px; }
.notice-tools select { flex:1; min-width:0; height:42px; padding:8px; }
.notice-tools .button { width:100%; font-size:12px; }
.notice-hint { font-size:12px; line-height:1.6; margin:16px 0; }
.notice-card { padding:18px; border:1px solid var(--editor-line); border-left:3px solid #2563eb; border-radius:14px; margin:12px 0; background:var(--editor-soft); }
.notice-card[data-category=conflict] { border-left-color:#f59e0b; }
.notice-card.is-read { border-left-color:var(--editor-line); }
.notice-type { text-transform:uppercase; font-size:10px; letter-spacing:.06em; }
.notice-card h3 { font-size:15px; line-height:1.4; margin:8px 0; }
.notice-card p { font-size:13px; line-height:1.6; color:var(--editor-muted); overflow-wrap:anywhere; }
.notice-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:14px; }
.notice-actions a,.notice-actions button { font-size:12px; color:#2563eb; border:0; padding:0; background:none; cursor:pointer; }
.theme-dark .notice-actions a,.theme-dark .notice-actions button { color:#93c5fd; }
body.notifications-open { overflow:hidden; }
body.notifications-open .global-create-appointment-fab { display:none!important; }
@media(max-width:600px) {
    body { --notice-menu-edge:0px; }
    body.sidebar-collapsed { --notice-menu-edge:min(102px,20vw); }
    .notice-drawer { padding:18px; }
}
@media(prefers-reduced-motion:reduce) {
    .notice-region,.notice-drawer,.notifications-rail { transition:none; }
}
@media(max-width:760px) {
    .appointment-editor .form-grid,#appointmentModalBody .appointment-editor .form-grid { grid-template-columns:minmax(0,1fr); gap:18px!important; }
    .appointment-editor .appointment-additional-summary { flex-direction:column; align-items:flex-start; gap:8px; }
    .appointment-editor .appointment-additional-summary small { text-align:left; }
    .appointment-editor .order-upload-heading { flex-direction:column; align-items:flex-start; }
    .appointment-editor .draft-bar { flex-wrap:wrap; }
    .appointment-editor .appointment-modal-actions .button { flex:1; text-align:center; }
    .appointment-editor .appointment-additional-grid { padding:16px!important; }
}
