/* ════════════════════════════════════════════
   DESIGN SYSTEM
   Font: Inter (loaded in App.razor)
   Brand: --c-primary-* default green; each shop overrides them via Shop:Colors
   ════════════════════════════════════════════ */

:root {
    --c-primary:     #16a34a;
    --c-primary-dk:  #15803d;
    --c-primary-lt:  #f0fdf4;
    --c-primary-100: #dcfce7;
    --c-primary-200: #bbf7d0;
    --c-primary-400: #4ade80;
    --c-primary-800: #166534;
    --c-primary-900: #14532d;
    --c-primary-rgb: 22, 163, 74;
    --c-hero-tint:   rgba(15, 90, 45, .88);
    --c-text:        #1f2937;
    --c-body:        #4b5563;
    --c-muted:       #6b7280;
    --c-border:      #e5e7eb;
    --c-bg:          #f5f6f8;
    --c-surface:     #ffffff;
    --c-error:       #dc2626;
    --c-error-bg:    #fef2f2;
    --radius-sm:     6px;
    --radius:        8px;
    --radius-lg:     14px;
    --shadow-sm:     0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow:        0 4px 14px rgba(16, 24, 40, .08);
    --shadow-lg:     0 12px 32px rgba(16, 24, 40, .14);
    --font:          'Inter', 'Open Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --nav-h:         64px;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv11", "ss01";
    font-size: 15px;
    line-height: 1.7;
    color: var(--c-body);
    background-color: var(--c-bg);
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font);
    color: var(--c-text);
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-top: 0;
}

h1 { font-size: clamp(22px, 5vw, 30px); }
h2 { font-size: clamp(18px, 4vw, 26px); }
h3 { font-size: clamp(16px, 3.5vw, 22px); }
h4 { font-size: clamp(15px, 3vw, 18px); }

h1:focus { outline: none; }

a { color: var(--c-primary); transition: color .2s; }
a:hover { color: var(--c-primary-dk); }

/* ── Focus and form polish ── */
:focus-visible { outline: 2px solid rgba(var(--c-primary-rgb), .55); outline-offset: 2px; }
input, select, textarea, button { font-family: inherit; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):focus,
select:focus, textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb), .15);
}
input[type=checkbox], input[type=radio] { accent-color: var(--c-primary); }
::selection { background: rgba(var(--c-primary-rgb), .18); }

/* ── Navbar spacer ── */
.navbar-spacer { height: var(--nav-h); }

/* ── Loading spinner ── */
.spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 3px solid rgba(var(--c-primary-rgb), .18);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: _spin .7s linear infinite;
}
@keyframes _spin { to { transform: rotate(360deg); } }

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    gap: 14px;
    color: var(--c-muted);
    font-size: 15px;
}

/* ── Error state ── */
.error-state { text-align: center; padding: 40px 20px; }
.error-state p { color: var(--c-error); margin-bottom: 12px; font-size: 15px; }
.error-state .btn-retry {
    padding: 10px 28px;
    background: var(--c-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    transition: background .2s;
}
.error-state .btn-retry:hover { background: var(--c-primary-dk); }

/* ── Validation ── */
.valid.modified:not([type=checkbox])  { outline: 1px solid var(--c-primary); }
.invalid                               { outline: 1px solid var(--c-error); }
.validation-message                    { color: var(--c-error); font-size: 0.85em; margin-top: 2px; }

/* ── Blazor error boundary ── */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

.darker-border-checkbox.form-check-input { border-color: #929292; }

/* ── Global table scroll ── */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Responsive base ── */
@media (max-width: 768px) {
    body { font-size: 14px; }
}

@media (max-width: 480px) {
    .loading-container { padding: 40px 16px; }
}

/* ════════════════════════════════════════════
   BACK OFFICE KIT
   Shared pieces for list and detail pages (Clientes, client page, Produtos).
   Everything follows the shop's --c-primary-* colours.
   ════════════════════════════════════════════ */

.bo-page {
    width: 94%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 0 64px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bo-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.bo-head h1 { margin: 0 auto 0 0; font-size: 26px; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 10px; }
.bo-count { font-size: 14px; font-weight: 500; color: var(--c-muted); letter-spacing: 0; }

.bo-crumb { font-size: 13px; color: var(--c-muted); display: flex; align-items: center; gap: 4px; }
.bo-crumb a { color: var(--c-muted); text-decoration: none; font-weight: 600; }
.bo-crumb a:hover { color: var(--c-primary); }

/* Buttons */
.bo-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 8px 14px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-surface);
    color: var(--c-text);
    font-family: var(--font); font-size: 14px; font-weight: 600; line-height: 1.3;
    text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.bo-btn:hover { border-color: #cfd4dc; background: var(--c-bg); color: var(--c-text); }
.bo-btn:disabled { opacity: .55; cursor: not-allowed; }
.bo-btn--primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.bo-btn--primary:hover { background: var(--c-primary-dk); border-color: var(--c-primary-dk); color: #fff; }
.bo-btn--wa { background: #25d366; border-color: #25d366; color: #fff; }
.bo-btn--wa:hover { background: #1ebe5a; border-color: #1ebe5a; color: #fff; }
.bo-btn--ghost { background: transparent; border-color: transparent; color: var(--c-muted); }
.bo-btn--ghost:hover { background: var(--c-bg); border-color: transparent; color: var(--c-text); }
.bo-btn--danger { background: var(--c-error); border-color: var(--c-error); color: #fff; }
.bo-btn--danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.bo-btn--sm { padding: 5px 10px; font-size: 13px; }

.bo-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; flex: none;
    border: 1px solid var(--c-border); border-radius: var(--radius);
    background: var(--c-surface); color: var(--c-muted);
    cursor: pointer; text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}
.bo-icon-btn:hover { background: var(--c-bg); color: var(--c-text); }
.bo-icon-btn--wa { background: #25d366; border-color: #25d366; color: #fff; }
.bo-icon-btn--wa:hover { background: #1ebe5a; color: #fff; }

/* Search */
.bo-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.bo-toolbar .bo-search { flex: 1 1 260px; }
.bo-search {
    min-width: 0;
    display: flex; align-items: center; gap: 8px;
    padding: 0 12px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    color: var(--c-muted);
    transition: border-color .15s, box-shadow .15s;
}
.bo-search:focus-within { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb), .15); }
.bo-search input {
    flex: 1; min-width: 0;
    border: 0; outline: 0; background: transparent;
    padding: 10px 0;
    font-size: 15px; color: var(--c-text);
}
.bo-search input:focus { box-shadow: none; }

/* Filter chips */
.bo-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bo-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--c-border); border-radius: 999px;
    background: var(--c-surface); color: var(--c-body);
    font-family: var(--font); font-size: 13px; font-weight: 600;
    cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.bo-chip:hover { border-color: #cfd4dc; color: var(--c-text); }
.bo-chip--on, .bo-chip--on:hover { background: var(--c-text); border-color: var(--c-text); color: #fff; }
.bo-chip-count { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--c-bg); color: var(--c-muted); }
.bo-chip--on .bo-chip-count { background: rgba(255,255,255,.2); color: #fff; }

/* Segmented tabs */
.bo-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius); background: #eceef1; }
.bo-seg button {
    padding: 6px 14px; border: 0; border-radius: 6px; background: transparent;
    font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--c-muted); cursor: pointer;
}
.bo-seg button.on { background: var(--c-surface); color: var(--c-text); box-shadow: 0 1px 2px rgba(16,24,40,.08); }

/* Cards and lists */
.bo-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}
.bo-card-head {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    padding: 14px 18px 10px;
}
.bo-card-head h2 { margin: 0; font-size: 16px; letter-spacing: -0.01em; }

.bo-list { display: flex; flex-direction: column; }
.bo-row {
    display: grid; align-items: center; gap: 14px;
    padding: 12px 18px;
    border-top: 1px solid var(--c-border);
    color: var(--c-body); font-size: 14px;
}
.bo-row:first-child { border-top: 0; }
.bo-row--head {
    padding-block: 9px;
    background: #fafbfc;
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted);
}
.bo-card > .bo-list > .bo-row--head:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.bo-row--link { cursor: pointer; transition: background .12s; }
.bo-row--link:hover { background: #fafbfc; }
.bo-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.bo-row .strong { color: var(--c-text); font-weight: 600; }
.bo-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }

.bo-empty { padding: 36px 18px; text-align: center; color: var(--c-muted); }
.bo-empty strong { display: block; color: var(--c-text); font-size: 15px; margin-bottom: 4px; }

.bo-sub { display: block; font-size: 12px; color: var(--c-muted); font-weight: 400; }
.bo-money { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--c-text); white-space: nowrap; }

/* People and pets */
.bo-avatar {
    --size: 36px;
    width: var(--size); height: var(--size); flex: none;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--c-primary-lt); color: var(--c-primary-dk);
    font-size: calc(var(--size) * .36); font-weight: 700;
    object-fit: cover;
}
.bo-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bo-who > div { min-width: 0; }
.bo-who .strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bo-pet {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 10px 2px 2px; margin: 2px 6px 2px 0;
    border: 1px solid var(--c-border); border-radius: 999px;
    background: var(--c-surface);
    font-size: 12px; font-weight: 600; color: var(--c-text); white-space: nowrap;
}
.bo-pet .bo-avatar { --size: 22px; }
.bo-pet small { font-weight: 400; color: var(--c-muted); }

/* Badges */
.bo-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 700; white-space: nowrap; vertical-align: middle;
}
.bo-badge--ok   { background: var(--c-primary-lt); color: var(--c-primary-dk); }
.bo-badge--late { background: var(--c-error-bg); color: var(--c-error); }
.bo-badge--warn { background: #fef3c7; color: #92400e; }
.bo-badge--muted { background: var(--c-bg); color: var(--c-muted); }

.bo-tag {
    display: inline-block; padding: 1px 8px; border-radius: 999px;
    background: var(--c-bg); color: var(--c-body);
    font-size: 11px; font-weight: 600; white-space: nowrap; vertical-align: middle;
}

/* Pager */
.bo-pager {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    padding: 12px 18px; border-top: 1px solid var(--c-border);
    font-size: 13px; color: var(--c-muted);
}
.bo-pager-pages { display: flex; gap: 4px; }
.bo-pager-pages button {
    min-width: 32px; height: 32px; padding: 0 8px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--c-border); border-radius: var(--radius);
    background: var(--c-surface); color: var(--c-text);
    font-family: var(--font); font-size: 13px; font-weight: 600; cursor: pointer;
}
.bo-pager-pages button:hover:not(:disabled) { background: var(--c-bg); }
.bo-pager-pages button.on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.bo-pager-pages button:disabled { opacity: .4; cursor: default; }

/* Row menu */
.bo-menu { position: relative; display: inline-flex; }
.bo-menu-backdrop { position: fixed; inset: 0; z-index: 50; }
.bo-menu-list {
    position: absolute; right: 0; top: calc(100% + 4px); z-index: 51;
    min-width: 180px; padding: 4px;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
}
.bo-menu-list button, .bo-menu-list a {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border: 0; border-radius: 6px; background: transparent;
    font-family: var(--font); font-size: 14px; font-weight: 500; color: var(--c-text);
    text-align: left; text-decoration: none; cursor: pointer;
}
.bo-menu-list button:hover, .bo-menu-list a:hover { background: var(--c-bg); }
.bo-menu-list .danger { color: var(--c-error); }

/* Forms */
.bo-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 14px; }
.bo-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bo-field--full { grid-column: 1 / -1; }
.bo-field label { font-size: 12px; font-weight: 600; color: var(--c-muted); }
.bo-field label .req { color: var(--c-error); }
.bo-field input, .bo-field select, .bo-field textarea {
    width: 100%; padding: 9px 11px;
    border: 1px solid var(--c-border); border-radius: var(--radius);
    background: var(--c-surface); color: var(--c-text);
    font-family: var(--font); font-size: 14px;
}
.bo-field textarea { resize: vertical; min-height: 64px; }
.bo-field input:disabled { background: var(--c-bg); color: var(--c-muted); }
.bo-field--wide { grid-column: span 2; }
.bo-inline { display: flex; gap: 6px; }
.bo-inline .bo-unit { width: 72px; flex: none; }
.bo-picker { position: relative; }
.bo-picker-list {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40;
    margin: 0; padding: 4px; list-style: none;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto;
}
.bo-picker-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.bo-picker-list li:hover { background: var(--c-bg); }
.bo-picker-list .strong { display: block; color: var(--c-text); font-weight: 600; font-size: 14px; }
.bo-picked {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 6px 8px; border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-bg);
}
.bo-picked .strong { color: var(--c-text); font-weight: 600; }
.bo-picked .bo-btn { margin-left: auto; }
.bo-form-actions { display: flex; gap: 8px; flex-wrap: wrap; grid-column: 1 / -1; }
.bo-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.bo-quick button {
    padding: 5px 11px; border: 1px solid var(--c-border); border-radius: 999px;
    background: var(--c-surface); color: var(--c-body);
    font-family: var(--font); font-size: 13px; font-weight: 500; cursor: pointer;
}
.bo-quick button.on { border-color: var(--c-primary); background: var(--c-primary-lt); color: var(--c-primary-dk); font-weight: 600; }

.bo-panel { border-color: var(--c-primary-200); box-shadow: inset 3px 0 0 var(--c-primary), var(--shadow); }
.bo-panel .bo-card-body { padding: 4px 18px 18px; }

/* Side drawer (e.g. Registar venda) */
.bo-drawer-backdrop { position: fixed; inset: 0; z-index: 1100; background: rgba(17, 24, 39, .35); }
.bo-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 1101;
    width: min(460px, 100%);
    background: var(--c-surface); box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column;
}
.bo-drawer > .bo-card-head { padding: 18px 20px 12px; border-bottom: 1px solid var(--c-border); }
.bo-drawer-body { padding: 16px 20px 24px; overflow-y: auto; }
.bo-drawer .bo-form { grid-template-columns: 1fr 1fr; }
.bo-drawer .bo-field--wide { grid-column: 1 / -1; }

/* Messages */
.bo-alert { padding: 10px 14px; border-radius: var(--radius); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.bo-alert--ok  { background: var(--c-primary-lt); color: var(--c-primary-dk); border: 1px solid var(--c-primary-200); }
.bo-alert--err { background: var(--c-error-bg); color: var(--c-error); border: 1px solid #fecaca; }

/* KPI strip */
.bo-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.bo-kpi { padding: 14px 18px; }
.bo-kpi-label { font-size: 13px; color: var(--c-muted); }
.bo-kpi-value { font-size: 22px; font-weight: 700; color: var(--c-text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bo-bar { height: 6px; border-radius: 99px; background: var(--c-bg); overflow: hidden; }
.bo-bar > i { display: block; height: 100%; border-radius: 99px; background: var(--c-primary); }

@media (max-width: 640px) {
    .bo-page { width: 100%; padding: 20px 12px 48px; }
    .bo-head h1 { font-size: 22px; }
    .bo-row { padding: 12px 14px; }
    .bo-card-head { padding: 12px 14px 8px; }
    .bo-pager { justify-content: center; }
    .bo-field--wide { grid-column: 1 / -1; }
    .bo-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
    .bo-kpi { padding: 10px 12px; }
    .bo-kpi-label { font-size: 12px; }
    .bo-kpi-value { font-size: 18px; }
}

/* ════════════════════════════════════════════
   CLIENT PAGE (detalhes-cliente)
   ════════════════════════════════════════════ */

.dc-page { max-width: 1080px; }
.dc-body { padding: 4px 18px 16px; }
.dc-section { display: flex; flex-direction: column; gap: 12px; }

/* Header */
.dc-head { padding: 20px; display: flex; align-items: center; flex-wrap: wrap; gap: 16px 20px; }
.dc-head:has(form) { display: block; padding: 0; }
.dc-who { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1 1 360px; }
.dc-who .bo-avatar { font-size: 20px; }
.dc-who-text { min-width: 0; }
.dc-who h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.02em; }
.dc-contacts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--c-muted); }
.dc-contacts a, .dc-contacts span { display: inline-flex; align-items: center; gap: 5px; color: var(--c-muted); text-decoration: none; }
.dc-contacts a:hover { color: var(--c-primary-dk); }
.dc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Pet tabs */
.dc-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 14px 4px 4px; border: 1px solid var(--c-border); border-radius: 999px;
    background: var(--c-surface); color: var(--c-text);
    font-family: var(--font); font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.dc-tab:hover { border-color: #cfd4dc; color: var(--c-text); }
.dc-tab small { font-weight: 500; color: var(--c-muted); }
.dc-tab--on, .dc-tab--on:hover { border-color: var(--c-primary); background: var(--c-primary-lt); color: var(--c-primary-dk); box-shadow: 0 0 0 1px var(--c-primary) inset; }
.dc-tab--gone { opacity: .7; }
.dc-tab--add { padding: 8px 14px; border-style: dashed; color: var(--c-muted); background: transparent; }
.dc-tab--add:hover { color: var(--c-primary-dk); border-color: var(--c-primary); }

/* Pet card */
.dc-pet { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 20px; padding: 18px; }
.dc-photo { position: relative; width: 112px; height: 112px; border-radius: 12px; overflow: hidden; background: var(--c-bg); }
.dc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dc-photo-empty { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #b0b6bf; font-size: 12px; }
.dc-photo-up {
    position: absolute; left: 6px; right: 6px; bottom: 6px;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    padding: 4px 6px; border-radius: 6px;
    background: rgba(17, 24, 39, .72); color: #fff; font-size: 12px; font-weight: 600; cursor: pointer;
}
.dc-photo-up input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dc-photo-up.busy { cursor: wait; }
.dc-pet-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 10px; }
.dc-pet-title h2 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.dc-pet-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.dc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; margin: 0; }
.dc-facts dt { font-size: 12px; color: var(--c-muted); margin: 0 0 2px; }
.dc-facts dd { margin: 0; font-size: 14px; font-weight: 600; color: var(--c-text); }
.dc-obs { margin: 12px 0 0; padding: 8px 12px; border-radius: var(--radius); background: var(--c-bg); font-size: 13px; color: var(--c-body); }

/* Services and purchases */
.dc-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.dc-split--open { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); }
.dc-novo .bo-form { grid-template-columns: 1fr 1fr; }
.dc-svc { grid-template-columns: 110px minmax(0, 1fr) 90px auto; }
.dc-svc--edit { background: #fafbfc; }
.dc-svc-date .strong, .dc-svc-what .strong { display: inline; }
.dc-svc-date .bo-sub { display: block; }
.dc-svc-what { min-width: 0; }
.dc-svc-what .bo-badge { margin-left: 6px; }
.dc-svc-editor { padding: 4px 18px 16px; background: #fafbfc; border-top: 1px dashed var(--c-border); }
.dc-svc-editor .bo-form { padding-top: 10px; }
.dc-compra { grid-template-columns: 96px minmax(0, 1fr) 80px 90px auto; }
.dc-compra-date { color: var(--c-muted); font-variant-numeric: tabular-nums; }
.dc-compra-what .bo-tag { margin-left: 6px; }
.dc-compra-qty { color: var(--c-muted); }
.dc-compra-form { border-bottom: 1px solid var(--c-border); }

@media (max-width: 900px) {
    .dc-split--open { grid-template-columns: minmax(0, 1fr); }
    .dc-split--open .dc-novo { order: -1; }
}
@media (max-width: 640px) {
    .dc-head { padding: 16px; }
    .dc-who h1 { font-size: 20px; }
    .dc-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; width: 100%; }
    .dc-actions .bo-btn { padding-inline: 8px; }
    .dc-pet { grid-template-columns: 76px minmax(0, 1fr); gap: 14px; padding: 14px; }
    .dc-photo { width: 76px; height: 76px; }
    .dc-photo-up span { display: none; }
    .dc-pet-actions { margin-left: 0; width: 100%; }
    .dc-facts { grid-template-columns: 1fr 1fr; }
    .dc-svc { grid-template-columns: minmax(0, 1fr) auto auto; }
    .dc-svc-date { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; }
    .dc-svc-date .bo-sub { display: inline; }
    .dc-novo .bo-form { grid-template-columns: 1fr; }
    .dc-compra { grid-template-columns: minmax(0, 1fr) auto auto; }
    .dc-compra-date { grid-column: 1 / -1; font-size: 12px; }
    .dc-compra-qty { display: none; }
}
