/* Owner workspace: existing Figtree/cyan identity, accessible desktop/mobile forms. */
.owner-view { max-width: none; padding: 0; }
#ownerApp { min-height: 100vh; background: var(--cloud); color: var(--ink-dark); }
#ownerApp h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.15; margin: 0 0 12px; }
#ownerApp h2, .workspace-dialog h2 { font-size: 1.2rem; line-height: 1.3; }
#ownerApp h3, .workspace-dialog h3 { font-size: 1.05rem; }
#ownerApp p, .workspace-dialog p { overflow-wrap: anywhere; }
#ownerApp a, .workspace-dialog a { color: var(--ink); }
.workspace-header { padding: 24px max(24px, calc((100vw - 1280px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: white; border-bottom: 1px solid var(--line); }
.workspace-header .wordmark { font-size: 1.3rem; white-space: nowrap; text-decoration: none; font-weight: 800; }
.workspace-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.workspace-tabs { display: flex; gap: 24px; padding: 0 max(24px, calc((100vw - 1280px)/2)); background: white; border-bottom: 1px solid var(--line); overflow-x: auto; }
.workspace-tabs a { display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 12px 4px; font-weight: 700; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.workspace-tabs a[aria-current] { border-bottom-color: var(--green); color: #066c83 !important; }
.tab-count { min-width: 23px; text-align: center; padding: 1px 5px; background: #fee2e2; color: #991b1b; border-radius: 20px; font-size: .8rem; }
.workspace-main { max-width: 1328px; margin: auto; padding: 36px 24px 72px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.section-heading p { color: var(--muted); margin: 6px 0 0; }
.section-heading .eyebrow { color: #066c83; margin-bottom: 10px; }
.filter-bar { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; margin: 20px 0 24px; }
.filter-bar label { min-width: 170px; }
.workspace-form label, .filter-bar label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--ink-dark); }
.workspace-form input, .workspace-form textarea, .workspace-form select, .filter-bar input, .filter-bar select, .workspace-table input, .workspace-table select { width: 100%; min-height: 44px; background: white; color: #0f172a; border: 1px solid #94a3b8; border-radius: 8px; padding: 10px 12px; font: inherit; font-weight: 400; }
.workspace-form textarea { resize: vertical; min-height: 90px; }
.workspace-form input[type="checkbox"], .filter-bar input[type="checkbox"], .workspace-table input[type="checkbox"] { width: 22px; height: 22px; min-height: 22px; flex: 0 0 22px; accent-color: #087f96; }
.workspace-form .check-field, .filter-bar .check-field { display: flex; flex-direction: row; align-items: center; gap: 10px; min-height: 44px; }
.check-field { cursor: pointer; }
#ownerApp button, .workspace-dialog button, #ownerApp .tool-button, #ownerApp .action-button { min-height: 44px; cursor: pointer; }
#ownerApp .action-button, .workspace-dialog .action-button { border: 1px solid #94a3b8; background: white; color: var(--ink-dark); box-shadow: none; padding: 10px 16px; font-size: .9rem; font-weight: 700; border-radius: 8px; white-space: normal; }
#ownerApp .action-button.primary, .workspace-dialog .action-button.primary { background: #087f96; border-color: #087f96; color: white; }
#ownerApp .action-button:hover, .workspace-dialog .action-button:hover { background: #ecfeff; transform: none; }
#ownerApp .action-button.primary:hover, .workspace-dialog .action-button.primary:hover { background: #066c83; }
#ownerApp button:disabled, .workspace-dialog button:disabled { opacity: .5; cursor: wait; }
#ownerApp :focus-visible, .workspace-dialog :focus-visible { outline: 3px solid #0891b2; outline-offset: 3px; }
.workspace-dialog .danger { color: #991b1b; border-color: #fca5a5; }
.workspace-message, .notice { padding: 14px 18px; border-radius: 8px; background: #e0f2fe; color: #0c4a6e; border: 1px solid #bae6fd; }
.workspace-message.is-error, .form-error { color: #991b1b; background: #fef2f2; border-radius: 8px; }
.form-error:not(:empty) { padding: 12px; }
.form-error:empty { display: none; }
.owner-login { max-width: 520px; margin: auto; padding: 100px 24px; }
.owner-login h1 { font-size: 2.2rem; }
.owner-login .action-button { margin: 12px 0; }
.muted { color: var(--muted); font-size: .9rem; }
.preserve-lines { white-space: pre-wrap; }
.workspace-months { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; margin-top: 20px; }
.workspace-month { border: 1px solid #cbd5e1; background: white; border-radius: 12px; padding: 18px; }
.workspace-month h2 { margin: 0 0 18px; }
.workspace-weekdays, .workspace-days { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; }
.workspace-weekdays { text-align: center; font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.workspace-day { position: relative; border: 1px solid var(--unavailable-border); border-radius: 7px; min-width: 0; min-height: 44px; padding: 8px 0; background: var(--unavailable); color: var(--unavailable-ink); font: inherit; font-weight: 600; }
.workspace-day.available { background: var(--available); color: var(--available-ink); border-color: var(--available-border); }
.workspace-day.booked { background: var(--booked); color: var(--booked-ink); border-color: var(--booked-border); }
@media (hover: hover) {
  .workspace-day:hover { background: var(--unavailable-hover); }
  .workspace-day.available:hover { background: var(--available-hover); }
  .workspace-day.booked:hover { background: var(--booked-hover); }
}
.workspace-day.is-today { outline: 2px solid var(--ink-dark); outline-offset: 1px; }
.completed-dot { position: absolute; font-size: 9px; right: 2px; bottom: 0; }
.workspace-dialog { width: min(650px,calc(100vw - 24px)); max-height: calc(100dvh - 40px); margin: auto; padding: 24px; border: 1px solid #cbd5e1; border-radius: 14px; color: var(--ink-dark); background: white; box-shadow: 0 24px 80px #08334433; }
.workspace-dialog.dialog-wide { width: min(1000px,calc(100vw - 24px)); }
.workspace-dialog::backdrop { background: #082f4966; }
.workspace-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.workspace-dialog > header h2 { margin: 0; }
.workspace-dialog > header button { min-width: 44px; font-size: 1.5rem; }
.workspace-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.workspace-form .wide { grid-column: 1/-1; }
.form-actions, .detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.settings-form { max-width: 860px; background: white; border: 1px solid #cbd5e1; padding: 24px; border-radius: 12px; }
.account-settings { margin-top: 32px; max-width: 860px; }
.clinic-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; }
.clinic-card { display: flex; flex-direction: column; align-items: start; justify-content: space-between; gap: 20px; background: white; border: 1px solid #cbd5e1; border-radius: 12px; padding: 22px; }
.clinic-card h2 { margin: 0 0 12px; }
.clinic-card p { margin: 7px 0; color: var(--muted); }
.invoice-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin: 24px 0; }
.invoice-metrics article { padding: 20px; border: 1px solid #cbd5e1; border-radius: 12px; background: white; }
.invoice-metrics span { display: block; color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.invoice-metrics strong { font-size: clamp(1.4rem,2.4vw,1.9rem); font-variant-numeric: tabular-nums; }
.invoice-detail .invoice-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
.table-scroll { width: 100%; overflow-x: auto; border: 1px solid #cbd5e1; border-radius: 10px; background: white; }
.workspace-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
.workspace-table th { background: #f1f5f9; font-weight: 600; color: #334155; }
.workspace-table th, .workspace-table td { padding: 14px 16px; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
.workspace-table td { font-variant-numeric: tabular-nums; }
.workspace-table td > span:not(.owner-badge) { display: block; margin-top: 4px; color: var(--muted); }
.workspace-table tr:last-child td { border-bottom: 0; }
.workspace-table input:not([type="checkbox"]) { min-width: 95px; }
.workspace-table select { min-width: 110px; }
.owner-badge { display: inline-block; padding: 4px 9px; border-radius: 20px; background: #e2e8f0; color: #334155; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.status-paid { color: #065f46; background: #d1fae5; }
.status-overdue { color: #991b1b; background: #fee2e2; }
.status-unpaid, .status-part-paid { color: #92400e; background: #fef3c7; }
.status-draft { color: #075985; background: #e0f2fe; }
.reminder-due { color: #991b1b; }
.invoice-detail-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.invoice-detail-heading h3 { margin: 0; }
.draft-totals { padding: 18px; background: #ecfeff; border-radius: 8px; font-weight: 700; }
.history-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #e2e8f0; }
.history-row p { margin: 5px 0; color: var(--muted); }
.empty-state { padding: 48px 24px; text-align: center; background: white; border: 1px dashed #94a3b8; border-radius: 12px; grid-column: 1/-1; }
.empty-state h2 { margin: 0 0 12px; }
.import-conflict { border: 1px solid #cbd5e1; padding: 16px; border-radius: 8px; }
.setup-secret { font-family: monospace; padding: 16px; background: #f1f5f9; overflow-wrap: anywhere; user-select: all; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media(max-width:1050px) { .workspace-months,.clinic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .workspace-header { align-items: start; } .workspace-tools { justify-content: end; } }
@media(max-width:700px) {
  .workspace-header { padding: 18px 16px; flex-direction: column; gap: 14px; }
  .workspace-tools { justify-content: start; gap: 4px; }
  .workspace-tools .tool-button { font-size: .8rem; padding: 7px 9px; }
  .workspace-tabs { gap: 20px; padding: 0 16px; }
  .workspace-main { padding: 24px 16px 48px; }
  .section-heading { flex-direction: column; align-items: start; gap: 16px; }
  .workspace-months,.clinic-grid { grid-template-columns: 1fr; }
  .workspace-month { padding: 16px; }
  .workspace-form { grid-template-columns: 1fr; }
  .invoice-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .invoice-metrics article { padding: 16px; }
  .invoice-detail .invoice-metrics { grid-template-columns: 1fr; }
  .invoice-detail .invoice-metrics article { display:flex;align-items:center;justify-content:space-between;gap:8px; }
  .invoice-detail .invoice-metrics span { margin:0; }
  .workspace-dialog { padding: 18px; max-height: calc(100dvh - 24px); }
  .settings-form { padding: 18px; }
  .workspace-table { min-width: 650px; }
  .workspace-table th,.workspace-table td { padding: 12px; }
  .filter-bar label { flex:1;min-width:140px; }
}
@media(prefers-reduced-motion:reduce) { #ownerApp *, .workspace-dialog * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
