/* ============================================================
   Pedigroom — Design System
   Ispirato a Felioom: teal/blu primario + accenti arancio.
   No Material. Modern, clean, Inter, spazio bianco.
   ============================================================ */

:root {
    /* Palette */
    --c-primary: #0E7490;
    --c-primary-600: #0891b2;
    --c-primary-700: #155e75;
    --c-primary-50: #ecfeff;
    --c-primary-100: #cffafe;
    --c-accent: #F97316;
    --c-accent-600: #ea580c;

    --c-bg: #F6F8FA;
    --c-surface: #FFFFFF;
    --c-surface-2: #F1F5F9;
    --c-text: #0F172A;
    --c-muted: #64748B;
    --c-muted-2: #94a3b8;
    --c-border: #E2E8F0;
    --c-border-strong: #CBD5E1;

    --c-success: #16A34A;
    --c-success-50: #dcfce7;
    --c-warning: #D97706;
    --c-warning-50: #fef3c7;
    --c-danger: #DC2626;
    --c-danger-50: #fee2e2;
    --c-info: #2563eb;
    --c-info-50: #dbeafe;

    /* Radius & shadow */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
    --shadow: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
    --shadow-md: 0 4px 12px rgba(15,23,42,.08);
    --shadow-lg: 0 12px 32px rgba(15,23,42,.12);

    /* Typography */
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --fs-xs: 12px;
    --fs-sm: 13px;
    --fs-base: 14px;
    --fs-md: 15px;
    --fs-lg: 18px;
    --fs-xl: 22px;
    --fs-2xl: 28px;

    /* Spacing */
    --space: 16px;

    /* Sidebar */
    --sidebar-w: 248px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: var(--font);
    font-size: var(--fs-base);
    color: var(--c-text);
    background: var(--c-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary-700); text-decoration: none; }
a:hover { color: var(--c-primary); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--c-text); }

.muted { color: var(--c-muted); }
.center { text-align: center; }

/* ============================================================
   App shell
   ============================================================ */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    background: var(--c-surface);
    border-right: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px;
    border-bottom: 1px solid var(--c-border);
}
.brand-logo {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-600));
    color: #fff;
    display: grid; place-items: center;
    flex-shrink: 0;
}
.brand-logo.big { width: 64px; height: 64px; border-radius: 16px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: var(--fs-md); color: var(--c-text); }
.brand-text span { font-size: var(--fs-xs); color: var(--c-muted); }

.nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--c-muted);
    font-weight: 500;
    font-size: var(--fs-base);
    transition: background .15s, color .15s;
    position: relative;
}
.nav-item:hover {
    background: var(--c-surface-2);
    color: var(--c-text);
}
.nav-item.active {
    background: var(--c-primary-50);
    color: var(--c-primary-700);
    font-weight: 600;
}
.nav-item.active svg { color: var(--c-primary); }
.nav-item[data-soon] { cursor: not-allowed; }
.badge-soon {
    margin-left: auto;
    font-style: normal;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: var(--c-surface-2);
    color: var(--c-muted-2);
    padding: 2px 6px;
    border-radius: var(--radius-pill);
    font-weight: 600;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--c-border);
}
.wa-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-xs);
    color: var(--c-muted);
    padding: 8px 12px;
    margin-bottom: 6px;
}
.wa-status .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--c-muted-2);
}
.wa-status.on .dot { background: var(--c-success); box-shadow: 0 0 0 3px var(--c-success-50); }
.wa-status.off .dot { background: var(--c-warning); box-shadow: 0 0 0 3px var(--c-warning-50); }

/* ---------- Main ---------- */
.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 72px;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}
.page-title { font-size: var(--fs-xl); font-weight: 700; }
.page-subtitle { margin: 2px 0 0; color: var(--c-muted); font-size: var(--fs-sm); }

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    background: var(--c-surface-2);
}
.user-chip .avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-600));
    color: #fff;
    display: grid; place-items: center;
    font-weight: 600;
    font-size: var(--fs-sm);
}
.user-name { font-weight: 500; font-size: var(--fs-sm); }

.content {
    padding: 28px;
    flex: 1;
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
}

/* ============================================================
   Layout helpers
   ============================================================ */
.grid { display: grid; gap: 16px; }
.grid.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid.grid-4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 24px; }
.mb { margin-bottom: 16px; }
.flex-1 { flex: 1; }
.divider { height: 1px; background: var(--c-border); margin: 12px 0; }

/* ============================================================
   Cards
   ============================================================ */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-head {
    padding: 16px 18px;
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-head h2 { font-size: var(--fs-md); }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px; }

/* KPI cards */
.card.kpi {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-left: 3px solid var(--c-primary);
}
.card.kpi.accent { border-left-color: var(--c-accent); }
.card.kpi.success { border-left-color: var(--c-success); }
.kpi-label { font-size: var(--fs-sm); color: var(--c-muted); font-weight: 500; }
.kpi-value { font-size: var(--fs-2xl); font-weight: 700; color: var(--c-text); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border-strong);
    background: var(--c-surface);
    color: var(--c-text);
    font-family: inherit;
    font-size: var(--fs-base);
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .05s;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}
.btn:hover { background: var(--c-surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: var(--c-primary);
    border-color: var(--c-primary);
    color: #fff;
}
.btn-primary:hover { background: var(--c-primary-700); border-color: var(--c-primary-700); color: #fff; }

.btn-accent {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: #fff;
}
.btn-accent:hover { background: var(--c-accent-600); border-color: var(--c-accent-600); color: #fff; }

.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--c-surface-2); }

.btn-danger { color: var(--c-danger); border-color: var(--c-danger); background: var(--c-surface); }
.btn-danger:hover { background: var(--c-danger-50); }

.btn-sm { padding: 6px 10px; font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; }

.btn[disabled], .btn:disabled { opacity: .55; cursor: not-allowed; }

/* ============================================================
   Forms
   ============================================================ */
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field label {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--c-text);
}
.field .help { font-size: var(--fs-xs); color: var(--c-muted); font-weight: 400; }
.field .error { font-size: var(--fs-xs); color: var(--c-danger); font-weight: 500; }

input, select, textarea {
    font-family: inherit;
    font-size: var(--fs-base);
    color: var(--c-text);
    background: var(--c-surface);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--c-primary-600);
    box-shadow: 0 0 0 3px var(--c-primary-50);
}
textarea { min-height: 80px; resize: vertical; }
input[type="checkbox"], input[type="radio"] {
    width: auto; margin: 0;
}
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.form-row.form-row-3 { grid-template-columns: repeat(3, 1fr); }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
}
.checkbox-row input { width: 18px; height: 18px; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-base);
}
table.data th {
    text-align: left;
    padding: 10px 14px;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--c-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface-2);
}
table.data td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--c-border);
    vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--c-surface-2); }
table.data a { color: var(--c-text); font-weight: 500; }
table.data a:hover { color: var(--c-primary-700); }

/* ============================================================
   Badges & chips
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 600;
    background: var(--c-surface-2);
    color: var(--c-muted);
}
.badge.primary { background: var(--c-primary-50); color: var(--c-primary-700); }
.badge.success { background: var(--c-success-50); color: var(--c-success); }
.badge.warning { background: var(--c-warning-50); color: var(--c-warning); }
.badge.danger { background: var(--c-danger-50); color: var(--c-danger); }
.badge.info { background: var(--c-info-50); color: var(--c-info); }
.badge.accent { background: #ffedd5; color: var(--c-accent-600); }

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 600;
    background: var(--c-primary-50);
    color: var(--c-primary-700);
    border: 1px solid transparent;
}
.tag-chip .emoji { font-style: normal; }
.tag-chip.removable { cursor: default; }
.tag-chip .x { cursor: pointer; opacity: .6; }
.tag-chip .x:hover { opacity: 1; }

/* Status appuntamento */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 600;
}
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-bozza { background: var(--c-surface-2); color: var(--c-muted); }
.status-confermato { background: var(--c-success-50); color: var(--c-success); }
.status-completato { background: var(--c-info-50); color: var(--c-info); }
.status-cancellato { background: var(--c-danger-50); color: var(--c-danger); }
.status-noshow { background: var(--c-warning-50); color: var(--c-warning); }

/* ============================================================
   Alerts & messages
   ============================================================ */
.messages { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    border: 1px solid transparent;
}
.alert-info, .alert-debug { background: var(--c-info-50); color: var(--c-info); border-color: #bfdbfe; }
.alert-success { background: var(--c-success-50); color: var(--c-success); border-color: #bbf7d0; }
.alert-warning { background: var(--c-warning-50); color: var(--c-warning); border-color: #fde68a; }
.alert-error, .alert-danger { background: var(--c-danger-50); color: var(--c-danger); border-color: #fecaca; }

/* ============================================================
   Empty states
   ============================================================ */
.empty {
    text-align: center;
    color: var(--c-muted);
    padding: 32px 16px;
    font-size: var(--fs-base);
}
.empty .icon {
    display: block;
    margin: 0 auto 12px;
    width: 48px; height: 48px;
    color: var(--c-muted-2);
}

/* ============================================================
   Appointments list (dashboard)
   ============================================================ */
.appt-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.appt-list li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--c-border);
}
.appt-list li:last-child { border-bottom: none; }
.appt-time { font-weight: 600; color: var(--c-primary-700); min-width: 56px; }
.appt-pet { font-weight: 600; min-width: 120px; }
.appt-owner { min-width: 140px; }
.appt-op {
    margin-left: auto;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--c-text);
    background: color-mix(in srgb, var(--op-color, var(--c-primary)) 14%, transparent);
    color: var(--op-color, var(--c-primary-700));
    padding: 3px 10px;
    border-radius: var(--radius-pill);
}

/* ============================================================
   Modal (HTMX)
   ============================================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15,23,42,.45);
    padding: 20px;
}
.modal.show { display: flex; }
.modal-box {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: auto;
    animation: modalIn .18s ease;
}
.modal-box.lg { max-width: 760px; }
@keyframes modalIn {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: none; }
}
.modal-head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-head h2 { font-size: var(--fs-lg); }
.modal-body { padding: 20px; }
.modal-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--c-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--c-surface-2);
}
.modal-close {
    background: none; border: none;
    color: var(--c-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}
.modal-close:hover { background: var(--c-surface-2); color: var(--c-text); }

/* ============================================================
   Toasts
   ============================================================ */
.toasts {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    background: var(--c-text);
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    box-shadow: var(--shadow-md);
    animation: toastIn .2s ease;
}
.toast.success { background: var(--c-success); }
.toast.error { background: var(--c-danger); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: none; }
}

/* ============================================================
   Login page
   ============================================================ */
.login-wrap {
    min-height: calc(100vh - 0px);
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--c-primary-50), var(--c-bg));
}
.login-card {
    background: var(--c-surface);
    padding: 36px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 380px;
    border: 1px solid var(--c-border);
}
.login-card h1 { text-align: center; margin: 16px 0 4px; font-size: var(--fs-xl); }
.login-card .brand-logo { margin: 0 auto; }

/* ============================================================
   Tabs & segmented
   ============================================================ */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--c-surface-2);
    padding: 4px;
    border-radius: var(--radius-sm);
    width: fit-content;
}
.tabs button, .tabs a {
    padding: 7px 14px;
    border: none;
    background: transparent;
    color: var(--c-muted);
    font-weight: 500;
    font-size: var(--fs-sm);
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
}
.tabs button.active, .tabs a.active {
    background: var(--c-surface);
    color: var(--c-text);
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   Search & filters bar
   ============================================================ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.search-input {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 420px;
}
.search-input input { padding-left: 36px; }
.search-input svg {
    position: absolute;
    left: 10px; top: 50%;
    transform: translateY(-50%);
    color: var(--c-muted);
    width: 18px; height: 18px;
}

/* ============================================================
   Detail layout (cliente/pet)
   ============================================================ */
.detail-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}
.detail-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 88px; }
.detail-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.avatar-lg {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-600));
    color: #fff;
    display: grid; place-items: center;
    font-weight: 600;
    font-size: var(--fs-xl);
    flex-shrink: 0;
}
.identity {
    display: flex;
    gap: 14px;
    align-items: center;
}
.identity .meta h2 { font-size: var(--fs-lg); }
.identity .meta p { margin: 2px 0 0; color: var(--c-muted); font-size: var(--fs-sm); }

.kv {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 10px 12px;
    font-size: var(--fs-sm);
}
.kv dt { color: var(--c-muted); font-weight: 500; }
.kv dd { margin: 0; color: var(--c-text); }

/* ============================================================
   Photo gallery
   ============================================================ */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}
.photo-thumb {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--c-border);
    position: relative;
    background: var(--c-surface-2);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb .photo-meta {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 6px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,.6));
    color: #fff;
    font-size: 11px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: -260px;
        z-index: 50;
        transition: left .2s;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { left: 0; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-side { position: static; }
    .grid.grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .grid.grid-2, .grid.grid-3, .grid.grid-4 { grid-template-columns: 1fr; }
    .form-row, .form-row.form-row-3 { grid-template-columns: 1fr; }
    .page-title { font-size: var(--fs-lg); }
}

/* Utility */
.hidden { display: none !important; }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-muted { color: var(--c-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.font-semibold { font-weight: 600; }
.cursor-pointer { cursor: pointer; }

/* HTMX indicator */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }
[aria-busy="true"] { opacity: .6; pointer-events: none; }

/* ============================================================
   Agenda (calendario)
   ============================================================ */
.agenda-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.agenda-date {
    display: flex;
    align-items: center;
    gap: 8px;
}
.agenda-date h2 { font-size: var(--fs-lg); font-weight: 700; }
.agenda-date .sub { color: var(--c-muted); font-size: var(--fs-sm); }
.cal-grid {
    display: grid;
    gap: 1px;
    background: var(--c-border);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.cal-grid.day-cols { grid-template-columns: repeat(var(--cols, 1), 1fr); }
.cal-grid.week-cols { grid-template-columns: repeat(7, 1fr); }
.cal-col {
    background: var(--c-surface);
    min-height: 240px;
    display: flex;
    flex-direction: column;
}
.cal-col-head {
    padding: 10px 12px;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface-2);
    font-weight: 600;
    font-size: var(--fs-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--c-text);
}
.cal-col-head .op-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--op-color, var(--c-primary));
}
.cal-col-head.today { background: var(--c-primary-50); color: var(--c-primary-700); }
.cal-col-head .day-num {
    margin-left: auto;
    font-size: var(--fs-xs);
    color: var(--c-muted);
    font-weight: 500;
}
.cal-col-body {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

/* Appointment card */
.appt-card {
    border: 1px solid var(--c-border);
    border-left: 3px solid var(--op-color, var(--c-primary));
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    background: var(--c-surface);
    cursor: pointer;
    transition: box-shadow .15s, transform .05s;
    position: relative;
}
.appt-card:hover { box-shadow: var(--shadow-md); }
.appt-card.status-cancellato { opacity: .55; text-decoration: line-through; }
.appt-card.status-completato { background: var(--c-surface-2); }
.appt-time {
    font-weight: 600;
    font-size: var(--fs-xs);
    color: var(--c-primary-700);
    display: flex;
    align-items: center;
    gap: 6px;
}
.appt-pet-name { font-weight: 600; font-size: var(--fs-sm); margin-top: 2px; }
.appt-client { font-size: var(--fs-xs); color: var(--c-muted); }
.appt-servizi {
    font-size: var(--fs-xs);
    color: var(--c-muted);
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.appt-servizi .mini { background: var(--c-surface-2); padding: 1px 6px; border-radius: var(--radius-pill); }
.appt-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    gap: 6px;
}
.appt-wa-icon {
    color: var(--c-success);
    display: inline-flex;
    align-items: center;
}
.appt-wa-icon.dim { color: var(--c-muted-2); }

/* Status select inline */
.status-select {
    border: 1px solid var(--c-border);
    border-radius: var(--radius-pill);
    padding: 2px 8px;
    font-size: var(--fs-xs);
    background: var(--c-surface);
    cursor: pointer;
}

/* Agenda empty slot (click to create) */
.slot-empty {
    border: 1px dashed var(--c-border);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
    color: var(--c-muted-2);
    font-size: var(--fs-xs);
    cursor: pointer;
}
.slot-empty:hover { border-color: var(--c-primary-600); color: var(--c-primary-700); background: var(--c-primary-50); }

/* Form 2-col per appuntamento (rich fields) */
.appt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.appt-grid .full { grid-column: 1 / -1; }
