/* ═══════════════════════════════════════════════════
   AYN Garage — Industrial Refined
   Dark steel + tungsten warmth
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Surface palette — warm dark steel */
    --bg: oklch(0.14 0.006 250);
    --surface: oklch(0.19 0.006 250);
    --surface2: oklch(0.23 0.006 250);
    --surface3: oklch(0.27 0.006 250);
    --border: oklch(0.30 0.006 250);
    --border-subtle: oklch(0.25 0.006 250);

    /* Text */
    --text: oklch(0.93 0.006 250);
    --text-secondary: oklch(0.72 0.008 250);
    --text-muted: oklch(0.55 0.008 250);

    /* Accent — warm amber tungsten */
    --primary: oklch(0.78 0.15 70);
    --primary-hover: oklch(0.84 0.15 70);
    --primary-muted: oklch(0.68 0.10 70);
    --primary-alpha: oklch(0.78 0.15 70 / 0.10);
    --primary-alpha-strong: oklch(0.78 0.15 70 / 0.18);

    /* Semantic */
    --success: oklch(0.72 0.16 160);
    --success-alpha: oklch(0.72 0.16 160 / 0.12);
    --warning: oklch(0.82 0.13 85);
    --warning-alpha: oklch(0.82 0.13 85 / 0.12);
    --danger: oklch(0.68 0.18 25);
    --danger-alpha: oklch(0.68 0.18 25 / 0.12);
    --info: oklch(0.72 0.10 240);
    --info-alpha: oklch(0.72 0.10 240 / 0.12);

    /* Legacy aliases (used in inline styles across templates) */
    --green: var(--success);
    --red: var(--danger);
    --yellow: var(--warning);
    --bg-card: var(--surface);
    --bg-hover: var(--surface2);
    --text-primary: var(--text);

    /* Structure */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --sidebar-w: 260px;
    --topbar-h: 56px;
    --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.2);
    --shadow: 0 4px 16px oklch(0 0 0 / 0.3);
    --shadow-lg: 0 12px 40px oklch(0 0 0 / 0.4);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Light Theme ─── */
[data-theme="light"] {
    --bg: oklch(0.97 0.004 250);
    --surface: oklch(1 0.003 250);
    --surface2: oklch(0.95 0.004 250);
    --surface3: oklch(0.91 0.005 250);
    --border: oklch(0.85 0.005 250);
    --border-subtle: oklch(0.90 0.004 250);

    --text: oklch(0.18 0.008 250);
    --text-secondary: oklch(0.40 0.008 250);
    --text-muted: oklch(0.55 0.006 250);

    --primary: oklch(0.55 0.18 70);
    --primary-hover: oklch(0.50 0.18 70);
    --primary-muted: oklch(0.60 0.12 70);
    --primary-alpha: oklch(0.55 0.18 70 / 0.08);
    --primary-alpha-strong: oklch(0.55 0.18 70 / 0.14);

    --success: oklch(0.50 0.16 160);
    --success-alpha: oklch(0.50 0.16 160 / 0.10);
    --warning: oklch(0.60 0.16 85);
    --warning-alpha: oklch(0.60 0.16 85 / 0.10);
    --danger: oklch(0.55 0.20 25);
    --danger-alpha: oklch(0.55 0.20 25 / 0.10);
    --info: oklch(0.50 0.14 240);
    --info-alpha: oklch(0.50 0.14 240 / 0.10);

    --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.06);
    --shadow: 0 4px 16px oklch(0 0 0 / 0.08);
    --shadow-lg: 0 12px 40px oklch(0 0 0 / 0.12);

    /* Legacy aliases */
    --green: var(--success);
    --red: var(--danger);
    --yellow: var(--warning);
    --bg-card: var(--surface);
    --bg-hover: var(--surface2);
    --text-primary: var(--text);
}

[data-theme="light"] .btn-primary { color: oklch(0.98 0.01 70); }
[data-theme="light"] .btn-success { color: oklch(0.98 0.01 160); }
[data-theme="light"] .btn-warning { color: oklch(0.15 0.02 85); }
[data-theme="light"] .btn-danger { color: oklch(0.98 0.01 25); }
[data-theme="light"] tbody tr:hover { background: oklch(0.95 0.004 250 / 0.8); }
[data-theme="light"] tbody tr:nth-child(even) { background: oklch(0.97 0.003 250 / 0.5); }
[data-theme="light"] tbody tr:nth-child(even):hover { background: oklch(0.95 0.004 250 / 0.8); }
[data-theme="light"] .sidebar-overlay { background: oklch(0 0 0 / 0.3); }
[data-theme="light"] .modal-overlay { background: oklch(0 0 0 / 0.35); }

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    font-size: 14px;
}

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Better selection */
::selection {
    background: var(--primary-alpha-strong);
    color: var(--text);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--surface3); }

/* ═══════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.4s var(--ease);
}

.sidebar-brand {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    transition: all 0.3s var(--ease);
    box-shadow: 0 0 0 4px var(--surface2);
}

.sidebar-logo:hover {
    border-color: var(--primary);
    box-shadow: 0 0 16px var(--primary-alpha-strong), 0 0 0 4px var(--primary-alpha);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all 0.2s var(--ease);
    position: relative;
}

.sidebar-nav a:hover {
    background: var(--surface2);
    color: var(--text);
}

.sidebar-nav a.active {
    background: var(--primary-alpha-strong);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}

.sidebar-nav a svg, .sidebar-nav a i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s var(--ease);
}

.sidebar-nav a.active svg,
.sidebar-nav a.active i,
.sidebar-nav a:hover svg,
.sidebar-nav a:hover i { opacity: 1; }

/* ─── Nav Groups (collapsible) ─── */
.nav-group {
    margin-top: 2px;
}

.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    position: relative;
    text-align: left;
}

.nav-group-toggle:hover {
    background: var(--surface2);
    color: var(--text);
}

.nav-group-toggle svg,
.nav-group-toggle i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s var(--ease);
}

.nav-group-toggle:hover svg,
.nav-group-toggle:hover i { opacity: 1; }

.nav-group.open > .nav-group-toggle {
    color: var(--text);
}

.nav-group.open > .nav-group-toggle svg,
.nav-group.open > .nav-group-toggle i { opacity: 1; }

.nav-chevron {
    margin-left: auto;
    width: 14px !important;
    height: 14px !important;
    opacity: 0.4 !important;
    transition: transform 0.25s var(--ease), opacity 0.2s var(--ease) !important;
}

.nav-group.open > .nav-group-toggle .nav-chevron {
    transform: rotate(90deg);
    opacity: 0.7 !important;
}

.nav-group-items {
    display: none;
    flex-direction: column;
    gap: 1px;
    padding-left: 12px;
    overflow: hidden;
}

.nav-group.open > .nav-group-items {
    display: flex;
}

.nav-group-items a {
    padding-left: 24px;
    font-size: 0.85rem;
}

.nav-group-items a svg,
.nav-group-items a i {
    width: 16px;
    height: 16px;
}

/* Separator between groups */
.nav-group + .nav-group,
.nav-group + a,
a + .nav-group {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--border-subtle);
}

/* ─── Lucide icon sizing ─── */
.btn svg, .btn-icon svg { width: 16px; height: 16px; }
.btn-sm svg { width: 14px; height: 14px; }
.badge svg { width: 12px; height: 12px; }
.form-heading svg { width: 18px; height: 18px; color: var(--primary); }
.page-header h2 svg { width: 22px; height: 22px; vertical-align: middle; }
.section-title svg { width: 16px; height: 16px; vertical-align: middle; }
.search-icon svg { width: 16px; height: 16px; }
.empty-state > svg, .empty-state > i > svg { width: 48px; height: 48px; margin-bottom: 16px; }
.upload-area .upload-icon svg { width: 48px; height: 48px; }
.os-meta-done svg { width: 14px; height: 14px; vertical-align: middle; }

/* ─── Top Bar ─── */
.top-bar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    padding: 10px 14px;
    align-items: center;
    justify-content: space-between;
}

/* Desktop: only show bell, no top-bar background */
@media (min-width: 769px) {
    .top-bar {
        display: flex;
        left: var(--sidebar-w);
        height: var(--topbar-h);
        padding: 0 40px;
        align-items: center;
        justify-content: flex-end;
        pointer-events: none;
    }
    .top-bar > * { pointer-events: auto; }
    .top-bar .hamburger { display: none !important; }
}

/* ─── Hamburger ─── */
.hamburger {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    cursor: pointer;
    color: var(--text);
    line-height: 1;
    box-shadow: var(--shadow-sm);
}

.hamburger svg { width: 20px; height: 20px; }

/* ─── Notification Bell ─── */
.notif-bell {
    position: relative;
}

.notif-bell-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
    box-shadow: var(--shadow-sm);
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.notif-bell-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.notif-bell-btn svg { width: 20px; height: 20px; }

/* ─── Top-bar right group + usuario logado ─── */
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.top-bar-right.faded {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    color: var(--text);
    text-decoration: none;
    line-height: 1.1;
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.topbar-user:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.topbar-user svg { width: 22px; height: 22px; flex-shrink: 0; }

.topbar-user-info {
    display: flex;
    flex-direction: column;
}

.topbar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.topbar-user-role {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Em telas estreitas, mostrar so o icone do usuario */
@media (max-width: 480px) {
    .topbar-user-info { display: none; }
    .topbar-user { padding: 8px; }
}

.notif-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    pointer-events: none;
    font-family: 'DM Sans', sans-serif;
}

/* ─── Notification Dropdown ─── */
.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 520px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 300;
}

.notif-dropdown.show { display: flex; flex-direction: column; }

.notif-dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text);
}

.notif-mark-all {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    line-height: 1;
    transition: color 0.2s;
}

.notif-mark-all:hover { color: var(--primary); }
.notif-mark-all svg { width: 16px; height: 16px; }

.notif-dropdown-list {
    overflow-y: auto;
    flex: 1;
    max-height: 400px;
}

.notif-dropdown-footer {
    display: block;
    padding: 10px 16px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--primary);
    border-top: 1px solid var(--border-subtle);
    text-decoration: none;
    transition: background 0.2s;
}

.notif-dropdown-footer:hover { background: var(--primary-alpha); }

.notif-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ─── Notification Items ─── */
.notif-item {
    border-bottom: 1px solid var(--border-subtle);
}

.notif-item:last-child { border-bottom: none; }

.notif-item-link {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.15s;
}

a.notif-item-link:hover { background: var(--primary-alpha); }

.notif-unread { background: var(--primary-alpha); }
.notif-unread .notif-item-title { font-weight: 600; }

.notif-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface2);
    color: var(--text-secondary);
    margin-top: 2px;
}

.notif-item-icon svg { width: 16px; height: 16px; }

.notif-tipo-info .notif-item-icon { background: var(--info-alpha); color: var(--info); }
.notif-tipo-alerta .notif-item-icon { background: var(--warning-alpha); color: var(--warning); }
.notif-tipo-erro .notif-item-icon { background: var(--danger-alpha); color: var(--danger); }
.notif-tipo-sucesso .notif-item-icon { background: var(--success-alpha); color: var(--success); }

.notif-item-body { flex: 1; min-width: 0; }

.notif-item-title {
    font-size: 0.85rem;
    line-height: 1.4;
    font-weight: 400;
}

.notif-item-msg {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ─── Notification Page Styles ─── */
.notif-page-item {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.15s;
}

.notif-page-item:hover { background: var(--primary-alpha); }
.notif-page-item.notif-unread { background: var(--primary-alpha); }

.notif-page-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface2);
    color: var(--text-secondary);
}

.notif-page-icon svg { width: 20px; height: 20px; }
.notif-page-item.notif-tipo-info .notif-page-icon { background: var(--info-alpha); color: var(--info); }
.notif-page-item.notif-tipo-alerta .notif-page-icon { background: var(--warning-alpha); color: var(--warning); }
.notif-page-item.notif-tipo-erro .notif-page-icon { background: var(--danger-alpha); color: var(--danger); }
.notif-page-item.notif-tipo-sucesso .notif-page-icon { background: var(--success-alpha); color: var(--success); }

.notif-page-body { flex: 1; min-width: 0; }

.notif-page-title {
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.notif-page-item.notif-unread .notif-page-title { font-weight: 700; }

.notif-page-msg {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.notif-page-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notif-page-origem {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--surface2);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: oklch(0 0 0 / 0.55);
    z-index: 99;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ═══════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════ */
.main {
    margin-left: var(--sidebar-w);
    padding: var(--topbar-h) 40px 48px;
    min-height: 100vh;
}

/* ─── Breadcrumb ─── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: 0.3; }
.breadcrumb .current { color: var(--text-secondary); font-weight: 500; }

/* ─── Page header ─── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}

/* ═══════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.card-stat {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}

.card-stat::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    opacity: 0.7;
    transition: opacity 0.3s var(--ease);
}

.card-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--border);
}

.card-stat:hover::after { opacity: 1; }

.card-stat .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.card-stat .value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.card-stat.primary .value { color: var(--primary); }
.card-stat.primary::after { background: var(--primary); }
.card-stat.success .value { color: var(--success); }
.card-stat.success::after { background: var(--success); }
.card-stat.warning .value { color: var(--warning); }
.card-stat.warning::after { background: var(--warning); }
.card-stat.danger .value { color: var(--danger); }
.card-stat.danger::after { background: var(--danger); }
.card-stat.info .value { color: var(--info); }
.card-stat.info::after { background: var(--info); }

.card-highlight {
    background: var(--primary-alpha);
    border-color: oklch(0.78 0.15 70 / 0.25);
}

/* ═══════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════ */
.table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

thead th {
    background: var(--surface2);
    padding: 12px 18px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

thead th:first-child { border-radius: var(--radius-lg) 0 0 0; }
thead th:last-child { border-radius: 0 var(--radius-lg) 0 0; }

th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s var(--ease);
}

th.sortable:hover { color: var(--primary); }

th.sortable::after {
    content: '';
    display: inline-block;
    width: 0; height: 0;
    margin-left: 6px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--border);
    transition: border-color 0.2s var(--ease);
}

th.sortable.asc::after {
    border-top: none;
    border-bottom: 5px solid var(--primary);
}

th.sortable.desc::after {
    border-top: 5px solid var(--primary);
}

tbody td {
    padding: 12px 18px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border-subtle);
    font-variant-numeric: tabular-nums;
    transition: background 0.15s var(--ease-smooth);
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: var(--surface2); }

/* Zebra striping */
tbody tr:nth-child(even) { background: oklch(0.16 0.006 250 / 0.3); }
tbody tr:nth-child(even):hover { background: var(--surface2); }

/* Clickable rows */
tbody tr[role="button"] { cursor: pointer; }
tbody tr[role="button"]:active { transform: scale(0.998); }

tr[role="button"] { cursor: pointer; }
tr[role="button"]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

/* ═══════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge i { font-size: 12px; }

.badge-pendente { background: var(--warning-alpha); color: var(--warning); }
.badge-em_andamento { background: var(--info-alpha); color: var(--info); }
.badge-aguardando_peca { background: #f59e0b22; color: #f59e0b; }
.badge-concluido { background: var(--success-alpha); color: var(--success); }
.badge-finalizada { background: var(--success-alpha); color: var(--success); }
.badge-entregue { background: #10b98122; color: #10b981; }
.badge-cancelada { background: #ef444422; color: #ef4444; }
.badge-feito { background: var(--success-alpha); color: var(--success); }

.badge-toggle {
    cursor: pointer;
    border: none;
    transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.badge-toggle:hover { transform: scale(1.05); }
.badge-toggle:active { transform: scale(0.97); }

/* ═══════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s var(--ease);
    position: relative;
    letter-spacing: 0.01em;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: oklch(0.15 0.02 70);
    box-shadow: 0 1px 3px oklch(0.78 0.15 70 / 0.2);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 4px 16px oklch(0.78 0.15 70 / 0.35);
    transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(0.98); box-shadow: 0 1px 4px oklch(0.78 0.15 70 / 0.2); }

.btn-success { background: var(--success); color: oklch(0.15 0.02 160); }
.btn-success:hover:not(:disabled) { filter: brightness(1.1); box-shadow: 0 2px 12px var(--success-alpha); }
.btn-danger { background: var(--danger); color: oklch(0.98 0.005 25); }
.btn-danger:hover:not(:disabled) { filter: brightness(1.1); box-shadow: 0 2px 12px var(--danger-alpha); }
.btn-warning { background: var(--warning); color: oklch(0.2 0.02 85); }
.btn-warning:hover:not(:disabled) { filter: brightness(1.1); box-shadow: 0 2px 12px var(--warning-alpha); }

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-alpha);
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    text-decoration: none;
    font-size: 16px;
}
.btn-icon:hover { color: var(--primary); background: var(--primary-alpha); }
.btn-icon.danger:hover { color: var(--danger); background: var(--danger-alpha); }

/* ─── Loading spinner ─── */
.btn.loading {
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    border: 2px solid oklch(1 0 0 / 0.2);
    border-top-color: oklch(0.98 0.005 70);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
    min-height: 42px;
}

.form-control:hover { border-color: var(--border); }

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
    background: var(--surface);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23777' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.form-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 600px;
}

.form-card.wide { max-width: none; }

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

/* ─── Form inline ─── */
.form-inline {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-inline .form-group {
    flex: 1;
    min-width: 120px;
    margin-bottom: 0;
}

.form-inline .form-group:first-child {
    flex: 2;
    min-width: 200px;
}

/* ─── Form grid ─── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}

.form-grid .form-group { margin-bottom: 0; }

.form-span-2 { grid-column: span 2; }

/* ─── Form heading ─── */
.form-heading {
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

/* ─── Form toggle ─── */
.form-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.form-toggle .toggle-active {
    background: var(--primary-alpha-strong);
    border-color: var(--primary);
    color: var(--primary);
}

/* ─── Status form ─── */
.status-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ─── Checkbox group ─── */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.15s var(--ease);
}

.checkbox-label:hover {
    background: var(--primary-alpha);
    border-color: var(--primary-muted);
    color: var(--text);
}

.checkbox-label input[type="checkbox"] { accent-color: var(--primary); }

/* ─── Hidden form section ─── */
.form-section-hidden { display: none; }

/* ─── Hint text ─── */
.hint-text {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 12px;
}

.hint-text a {
    color: var(--primary);
    text-decoration: none;
}
.hint-text a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════
   FLASH MESSAGES
   ═══════════════════════════════════════════════════ */
.flash {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: flashIn 0.4s var(--ease);
    box-shadow: var(--shadow-sm);
}

@keyframes flashIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.flash-success { background: var(--success-alpha); color: var(--success); border: 1px solid oklch(0.72 0.16 160 / 0.2); }
.flash-error { background: var(--danger-alpha); color: var(--danger); border: 1px solid oklch(0.68 0.18 25 / 0.2); }
.flash-warning { background: var(--warning-alpha); color: var(--warning); border: 1px solid oklch(0.82 0.13 85 / 0.2); }

/* ═══════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: oklch(0 0 0 / 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fadeIn 0.2s var(--ease);
}

.modal-overlay.show { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s var(--ease);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-box h3 {
    font-size: 17px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.modal-box p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
    white-space: pre-line;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════
   OS DETAIL
   ═══════════════════════════════════════════════════ */
.os-header {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin-bottom: 24px;
}

.os-header .os-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.os-header .info-item .info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.os-header .info-item .info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.os-totals {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.os-total-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    text-align: center;
    transition: all 0.25s var(--ease);
}

.os-total-card:hover {
    border-color: var(--border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.os-total-card .total-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.os-total-card .total-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

/* ─── OS meta ─── */
.os-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.os-meta-date {
    color: var(--text-muted);
    font-size: 13px;
}

.os-meta-done {
    color: var(--success);
    font-size: 13px;
}

/* ─── Semantic helpers ─── */
.color-success { color: var(--success); }
.color-danger { color: var(--danger); }
.color-warning { color: var(--warning); }
.color-info { color: var(--info); }
.color-primary { color: var(--primary); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ─── Spacing ─── */
.section-mb { margin-bottom: 28px; }
.section-mt { margin-top: 36px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-16 { margin-bottom: 16px; }

/* ─── Form card stacking ─── */
.form-card + .form-card { margin-top: 16px; }
.form-card.compact { padding: 12px 16px; }

/* ─── Settings sections ─── */
.settings-section { margin-bottom: 32px; }

.settings-section-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.settings-section-title svg { width: 14px; height: 14px; }

.settings-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
}

.settings-card-divider {
    border-top: 1px solid var(--border-subtle);
    margin-top: 20px;
    padding-top: 20px;
}

/* ─── Month nav select ─── */
.month-select {
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 14px;
}

/* ─── Table subtotals/totals ─── */
.subtotal-row {
    background: var(--surface2);
}

.subtotal-cell {
    text-align: right;
    font-weight: 600;
    color: var(--text-muted);
}

.total-footer {
    font-size: 14px;
    border-top: 2px solid var(--primary-muted);
}

.total-footer-warning {
    font-size: 14px;
    border-top: 2px solid var(--warning);
}

.total-cell-right {
    text-align: right;
    font-weight: 700;
}

/* ─── Progress header ─── */
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.progress-header-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.progress-header-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
}

/* ─── Item check (OS items) ─── */
.item-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.item-check:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.item-check:hover { border-color: var(--success); }

.item-check.feito {
    background: var(--success);
    border-color: var(--success);
}

.item-check.feito::after {
    content: '';
    width: 10px; height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

tr.item-feito td { opacity: 0.4; text-decoration: line-through; }
tr.item-feito td:first-child { opacity: 1; text-decoration: none; }

/* ─── Upload area ─── */
.upload-area {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    transition: border-color 0.2s var(--ease);
    max-width: 600px;
}

.upload-area:hover { border-color: var(--primary); }

.upload-area .upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.upload-area p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════
   TABS (chamados / generic)
   ═══════════════════════════════════════════════════ */
.tab-bar {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    width: fit-content;
}

.tab-btn {
    padding: 8px 18px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s var(--ease);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab-btn:hover { color: var(--text); background: var(--bg-hover); }

.tab-btn.active {
    background: var(--bg);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.badge-count {
    background: var(--primary);
    color: #fff;
    border-radius: 99px;
    font-size: 0.72rem;
    padding: 1px 7px;
    font-weight: 600;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════
   SEARCH
   ═══════════════════════════════════════════════════ */
.search-box { position: relative; }

.search-box input {
    width: 260px;
    padding: 9px 14px 9px 38px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: all 0.2s var(--ease);
}

.search-box input:hover { border-color: var(--border); }

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
    background: var(--bg);
    width: 320px;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 4px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 50;
    max-height: 300px;
    overflow-y: auto;
}

.search-results.show { display: block; }

.search-results a {
    display: block;
    padding: 10px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.1s var(--ease-smooth);
}

.search-results a:hover { background: var(--surface2); }
.search-results a:last-child { border-bottom: none; }

.search-results .sr-type {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    color: var(--primary);
    margin-right: 8px;
    letter-spacing: 0.06em;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════════════ */
.progress {
    height: 5px;
    background: var(--surface2);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}

.progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s var(--ease);
    background: linear-gradient(90deg, var(--success), oklch(0.76 0.14 140));
}

.progress-bar.green { background: var(--success); }
.progress-bar.blue { background: var(--info); }
.progress-bar.yellow { background: var(--warning); }

/* ─── Large progress ─── */
.progress-lg {
    height: 10px;
    background: var(--surface2);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.progress-lg .progress-bar {
    height: 100%;
    border-radius: var(--radius);
    transition: width 0.6s var(--ease);
    background: linear-gradient(90deg, var(--success), oklch(0.76 0.14 140));
}

.progress-lg .progress-label {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    font-weight: 700;
    color: oklch(0.15 0.01 160);
    text-shadow: 0 1px 2px oklch(0 0 0 / 0.2);
}

/* ─── Section title ─── */
.section-title {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.section-title.warning { color: var(--warning); }

/* ─── Actions ─── */
.actions { display: flex; gap: 4px; align-items: center; }

/* ─── Filter pills ─── */
.filter-pills {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 7px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s var(--ease);
}

.filter-pill:hover,
.filter-pill.active {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-alpha);
}

/* ─── Empty state ─── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
}

.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; opacity: 0.3; }
.empty-state p { margin-bottom: 20px; font-size: 14px; line-height: 1.6; }

/* ─── Integration status ─── */
.integration-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.integration-status.connected {
    padding: 12px 16px;
    background: var(--success-alpha);
    border: 1px solid var(--success);
    border-radius: var(--radius);
}
.integration-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

/* ─── Inline editing ─── */
.editable {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all 0.15s var(--ease);
}
.editable:hover {
    border-color: var(--border);
    background: var(--surface2);
}
.editable-cliente {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all 0.15s var(--ease);
}
.editable-cliente:hover {
    border-color: var(--border);
    background: var(--surface2);
}
.editable-mecanico {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all 0.15s var(--ease);
}
.editable-mecanico:hover {
    border-color: var(--border);
    background: var(--surface2);
}

.edit-input {
    background: var(--bg);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 4px 8px;
    font-family: inherit;
    font-size: 14px;
    width: 100%;
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

/* ─── Header actions ─── */
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-stat {
    padding: 10px 18px;
    margin: 0;
    border-radius: var(--radius);
}

.header-stat .label { margin-bottom: 2px; }
.header-stat .value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
}

/* ─── Card link ─── */
.card-link {
    text-decoration: none;
    display: block;
}

.card-value-sm {
    font-size: 20px;
}

.card-meta {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 6px;
}

/* ─── Tfoot ─── */
tfoot td {
    padding: 14px 20px;
    font-size: 14px;
    border-top: 2px solid var(--border);
    font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════
   ANIMATIONS — Page load stagger
   ═══════════════════════════════════════════════════ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header { animation: fadeUp 0.4s var(--ease) both; }
.cards-grid { animation: fadeUp 0.4s var(--ease) 0.05s both; }
.table-wrapper { animation: fadeUp 0.4s var(--ease) 0.1s both; }
.form-card { animation: fadeUp 0.4s var(--ease) 0.08s both; }
.os-header { animation: fadeUp 0.4s var(--ease) 0.05s both; }
.os-totals { animation: fadeUp 0.4s var(--ease) 0.1s both; }
.empty-state { animation: fadeUp 0.5s var(--ease) 0.1s both; }

.card-stat {
    animation: fadeUp 0.4s var(--ease) both;
}

.card-stat:nth-child(1) { animation-delay: 0.03s; }
.card-stat:nth-child(2) { animation-delay: 0.06s; }
.card-stat:nth-child(3) { animation-delay: 0.09s; }
.card-stat:nth-child(4) { animation-delay: 0.12s; }
.card-stat:nth-child(5) { animation-delay: 0.15s; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
    .main { padding: 28px 24px 40px; }
    .card-stat .value { font-size: 16px; }
    .os-total-card .total-value { font-size: 18px; }
    .search-box input:focus { width: 280px; }
}

/* Tablet */
@media (max-width: 768px) {
    .top-bar {
        display: flex;
        background: var(--bg);
        border-bottom: 1px solid var(--border-subtle);
    }
    .hamburger { display: block; }
    .notif-dropdown { width: min(380px, calc(100vw - 28px)); right: -8px; }
    .sidebar { transform: translateX(-100%); top: 54px; height: calc(100vh - 54px); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }

    .main {
        margin-left: 0;
        padding: 64px 12px 24px;
        max-width: 100%;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .page-header h2 { font-size: 18px; }

    .header-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 8px;
    }

    .header-stat { text-align: center; }

    .breadcrumb { margin-bottom: 10px; }
    .page-header { margin-bottom: 20px; gap: 10px; }

    .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card-stat { padding: 14px; }
    .card-stat .value { font-size: 14px; }
    .card-stat .label { font-size: 10px; }

    .form-row { grid-template-columns: 1fr; }
    .form-card { padding: 16px; max-width: 100%; }
    .form-card.wide { max-width: 100%; }

    .form-inline,
    form[style*="display:flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .form-inline .form-group,
    form[style*="display:flex"] .form-group {
        min-width: 0 !important;
        flex: 1 !important;
        width: 100% !important;
        margin-bottom: 10px !important;
    }

    .form-inline .btn,
    form[style*="display:flex"] > .btn,
    form[style*="display:flex"] > button {
        width: 100%;
        justify-content: center;
    }

    .form-grid { grid-template-columns: 1fr; }
    .form-span-2 { grid-column: auto; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; justify-content: center; }

    .settings-section { margin-bottom: 20px; }
    .settings-card { padding: 16px 14px; }
    .settings-card-divider { margin-top: 16px; padding-top: 16px; }
    .settings-section-title { font-size: 0.72rem; margin-bottom: 10px; }

    /* Settings form: sticky save bar */
    form[action*="configuracoes"] .form-actions {
        position: sticky;
        bottom: 0;
        background: var(--bg);
        padding: 12px 0;
        margin: 0 -14px;
        padding-left: 14px;
        padding-right: 14px;
        border-top: 1px solid var(--border-subtle);
        z-index: 10;
    }

    /* Touch-friendly inputs */
    .settings-card .form-control {
        min-height: 44px;
        font-size: 15px;
        padding: 10px 12px;
    }
    .settings-card .form-group label {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .os-totals { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .os-total-card { padding: 12px 10px; }
    .os-total-card .total-value { font-size: 15px; }
    .os-total-card .total-label { font-size: 9px; }

    .os-header { padding: 16px; }
    .os-header .os-info { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    .search-box { width: 100%; }
    .search-box input { width: 100%; }
    .search-box input:focus { width: 100%; }

    .filter-pills { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
    .filter-pill { white-space: nowrap; }

    /* Tabelas responsivas */
    table { min-width: 0; width: 100%; }
    thead th { padding: 8px 10px; font-size: 10px; }
    tbody td { padding: 8px 10px; font-size: 13px; }
    tfoot td { padding: 8px 10px; font-size: 13px; }

    .btn { padding: 10px 16px; min-height: 42px; font-size: 13px; }
    .btn-sm { padding: 6px 12px; min-height: 34px; font-size: 12px; }
    .btn-icon { width: 36px; height: 36px; }
    .badge { padding: 4px 8px; font-size: 10px; }
    .badge-toggle { min-height: 34px; }

    .modal-box { padding: 20px; width: 95%; }
    .section-title { font-size: 12px; }
    .status-form { flex-wrap: wrap; gap: 8px; }
    .breadcrumb { font-size: 12px; }
    .empty-state { padding: 30px 12px; }

    /* Flex containers com gap no mobile */
    div[style*="display:flex"][style*="gap"] {
        flex-wrap: wrap !important;
    }

    /* Inputs e selects no mobile */
    input[style*="width:200px"],
    input[style*="width: 200px"] {
        width: 100% !important;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .main { padding: 60px 8px 20px; }

    .cards-grid { grid-template-columns: 1fr; }
    .os-totals { grid-template-columns: 1fr; }
    .os-header .os-info { grid-template-columns: 1fr; }
    .page-header h2 { font-size: 16px; }
    .card-stat .value { font-size: 13px; }

    thead th { padding: 6px 8px; font-size: 9px; }
    tbody td { padding: 6px 8px; font-size: 12px; }
    tfoot td { padding: 6px 8px; font-size: 12px; }

    .os-total-card .total-value { font-size: 14px; }

    .form-card { padding: 14px; }
    .form-control { padding: 8px 10px; font-size: 14px; }

    .settings-card { padding: 14px 12px; }
    .settings-card .form-control { min-height: 44px; font-size: 16px; }

    .progress-header { flex-direction: column; gap: 4px; }

    /* Botoes de acao na tabela empilhados */
    td div[style*="display:flex"] {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }
}

/* ═══════════════════════════════════════════════════
   THEME TOGGLE
   ═══════════════════════════════════════════════════ */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.sidebar-footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar-version {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.sidebar-version:hover {
    background: var(--surface2);
}
.sidebar-version .version-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}
.sidebar-version .version-number {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: monospace;
}
.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}
.sidebar-logout:hover {
    color: var(--danger);
    background: var(--danger-alpha);
}
.sidebar-logout svg {
    width: 16px;
    height: 16px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--surface2);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.theme-toggle:hover {
    background: var(--primary-alpha);
    color: var(--primary);
    border-color: var(--primary);
}

.theme-toggle svg { width: 18px; height: 18px; }

.theme-icon-light { display: none; }
.theme-icon-dark { display: block; }
[data-theme="light"] .theme-icon-light { display: block; }
[data-theme="light"] .theme-icon-dark { display: none; }

/* ═══════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    margin: 0;
    padding: 1rem;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    animation: fadeUp 0.5s var(--ease) both;
}

.login-logo {
    display: block;
    margin: 0 auto 1.5rem;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    box-shadow: 0 0 0 4px var(--surface2);
}

.login-title {
    text-align: center;
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0 0 1.5rem;
}

.login-field { margin-bottom: 1rem; }

.login-field label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.login-field input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.login-field input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.login-btn {
    width: 100%;
    padding: 0.7rem;
    background: var(--primary);
    color: oklch(0.15 0.02 70);
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    margin-top: 0.5rem;
    box-shadow: 0 2px 8px oklch(0.78 0.15 70 / 0.25);
}

.login-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px oklch(0.78 0.15 70 / 0.35);
}

.login-btn:active {
    transform: translateY(0);
}

.login-flash {
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius);
    font-size: 0.82rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.login-flash-danger { background: var(--danger-alpha); color: var(--danger); border: 1px solid var(--danger); }
.login-flash-warning { background: var(--warning-alpha); color: var(--warning); border: 1px solid var(--warning); }
.login-flash-info { background: var(--info-alpha); color: var(--info); border: 1px solid var(--info); }

/* ═══════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════ */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s var(--ease);
}

.alert-item:hover {
    transform: translateX(4px);
    filter: brightness(1.1);
}

.alert-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.alert-item.alert-warning {
    background: var(--warning-alpha);
    color: var(--warning);
    border: 1px solid oklch(0.82 0.13 85 / 0.15);
}

.alert-item.alert-danger {
    background: var(--danger-alpha);
    color: var(--danger);
    border: 1px solid oklch(0.68 0.18 25 / 0.15);
}

.alert-item.alert-info {
    background: var(--info-alpha);
    color: var(--info);
    border: 1px solid oklch(0.72 0.10 240 / 0.15);
}

.alert-item:hover {
    transform: translateX(4px);
    filter: brightness(1.1);
}

/* ═══════════════════════════════════════════════════
   ACTIVITY FEED
   ═══════════════════════════════════════════════════ */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    border-radius: var(--radius);
    transition: background 0.15s var(--ease);
}

.activity-item:hover { background: var(--surface); }

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon svg { width: 14px; height: 14px; }

.activity-icon.success { background: var(--success-alpha); color: var(--success); }
.activity-icon.info { background: var(--info-alpha); color: var(--info); }
.activity-icon.warning { background: var(--warning-alpha); color: var(--warning); }
.activity-icon.primary { background: var(--primary-alpha); color: var(--primary); }

.activity-content { flex: 1; min-width: 0; }

.activity-text {
    font-size: 13.5px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════
   CLIENT LINK
   ═══════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════
   CHART CARD
   ═══════════════════════════════════════════════════ */
.chart-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    animation: fadeUp 0.4s var(--ease) 0.1s both;
}

.chart-card canvas {
    max-height: 300px;
}

.client-link {
    color: var(--text);
    text-decoration: none;
    transition: color 0.15s var(--ease);
}

.client-link:hover {
    color: var(--primary);
}

/* ─── Suporte Page ─── */
.suporte-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.suporte-card {
    padding: 20px !important;
}

.suporte-info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.suporte-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.suporte-info-row:last-child {
    border-bottom: none;
}

.suporte-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.suporte-value {
    font-size: 0.85rem;
    color: var(--text);
    text-align: right;
}

.suporte-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.suporte-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suporte-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--surface2);
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s;
}

.suporte-link-item:hover {
    background: var(--surface3);
}

.suporte-link-item svg, .suporte-link-item i {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.suporte-link-item strong {
    display: block;
    font-size: 0.85rem;
}

.suporte-link-item small {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .suporte-grid {
        grid-template-columns: 1fr;
    }
    .suporte-card { padding: 16px !important; }
    .suporte-actions { flex-direction: column; }
    .suporte-actions .btn { width: 100%; justify-content: center; min-height: 44px; }
    .suporte-link-item { padding: 12px; min-height: 44px; }
    .suporte-info-row { padding: 8px 0; }
}


/* ─── Modal Content (reusable) ─── */

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s var(--ease);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }

.modal-body { color: var(--text-secondary); }


/* ─── Agenda / Calendario ─── */

.agenda-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
}

.cal-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-weekday {
    padding: 10px 8px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.cal-weekday.cal-weekend { color: var(--text-muted); }

.cal-day {
    min-height: 100px;
    padding: 6px;
    border-right: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.15s var(--ease);
    position: relative;
}
.cal-day:nth-child(7n) { border-right: none; }
.cal-day:hover { background: var(--surface2); }

.cal-day-other {
    background: var(--bg);
    opacity: 0.5;
}
.cal-day-other:hover { opacity: 0.7; }

.cal-day-today {
    background: var(--primary-alpha);
}
.cal-day-today .cal-day-num {
    background: var(--primary);
    color: var(--bg);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.cal-day-num {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
    display: inline-block;
}

.cal-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cal-event {
    font-size: 0.68rem;
    padding: 2px 5px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    font-weight: 500;
    transition: filter 0.15s;
}
.cal-event:hover { filter: brightness(1.15); }

.cal-event-primary { background: var(--primary-alpha-strong); color: var(--primary); }
.cal-event-success { background: var(--success-alpha); color: var(--success); }
.cal-event-warning { background: var(--warning-alpha); color: var(--warning); }
.cal-event-danger { background: var(--danger-alpha); color: var(--danger); }
.cal-event-info { background: var(--info-alpha); color: var(--info); }

.cal-event-done {
    opacity: 0.5;
    text-decoration: line-through;
}

.cal-event-time {
    font-weight: 600;
    margin-right: 3px;
}

.cal-event-more {
    font-size: 0.65rem;
    color: var(--text-muted);
    padding: 1px 5px;
    cursor: pointer;
}

.cal-month-label {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    padding: 0 8px;
}

/* Sidebar */
.agenda-sidebar {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 16px;
}
.agenda-sidebar h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.agenda-sidebar h3 svg { width: 16px; height: 16px; }

.agenda-upcoming {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agenda-upcoming-item {
    padding: 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.15s var(--ease), box-shadow 0.15s;
}
.agenda-upcoming-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.upcoming-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.upcoming-date {
    font-size: 0.72rem;
    font-weight: 600;
}
.upcoming-type {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.7;
}
.upcoming-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
}
.upcoming-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.empty-msg {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    padding: 20px 0;
}

/* Modal detail body */
#detInfo p {
    margin: 6px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
#detInfo strong {
    color: var(--text);
}

@media (max-width: 900px) {
    .agenda-layout {
        grid-template-columns: 1fr;
    }
    .cal-day { min-height: 70px; }
}
@media (max-width: 600px) {
    .cal-day { min-height: 50px; padding: 3px; }
    .cal-event { font-size: 0.6rem; }
    .cal-weekday { font-size: 0.65rem; padding: 6px 2px; }
    .cal-day-num { font-size: 0.7rem; }
    .cal-month-label { font-size: 0.9rem; }
}

/* ═══════════════════════════════════════════════════
   FAB — Botao flutuante chamado
   ═══════════════════════════════════════════════════ */
.fab-chamado {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 900;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px 0 16px;
    height: 44px;
    border-radius: 22px;
    background: var(--bg-card);
    color: var(--primary);
    border: 1.5px solid var(--primary);
    box-shadow: 0 4px 18px oklch(0 0 0 / 0.35), 0 0 0 0 var(--primary-alpha);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.15s;
    white-space: nowrap;
}
.fab-chamado svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.fab-chamado:hover {
    background: var(--primary);
    color: oklch(0.15 0.02 70);
    box-shadow: 0 6px 24px oklch(0 0 0 / 0.4), 0 0 0 4px var(--primary-alpha);
    transform: translateY(-2px);
}
.fab-chamado:hover svg {
    transform: rotate(-10deg) scale(1.1);
}
.fab-chamado:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 10px oklch(0 0 0 / 0.3);
}
@media (max-width: 480px) {
    .fab-chamado { bottom: 20px; right: 16px; padding: 0 14px 0 12px; height: 40px; font-size: 0.75rem; }
}
