/* =====================================================================
   Elomab Timesheet — Odoo 17 inspired back-office theme
   Palette: Odoo purple (brand) + Odoo teal (action) on neutral greys
   ===================================================================== */

:root {
    --o-brand: #714b67;
    --o-brand-hover: #624159;
    --o-brand-soft: #f3edf2;
    --o-action: #017e84;
    --o-action-hover: #01656a;
    --o-action-soft: #e6f2f3;

    --o-text: #374151;
    --o-heading: #111827;
    --o-muted: #6b7280;
    --o-subtle: #9ca3af;

    --o-bg: #f3f4f6;
    --o-surface: #ffffff;
    --o-surface-alt: #f9fafb;
    --o-hover: #f2f3f5;
    --o-border: #d8dadd;
    --o-border-light: #e7e9ed;

    --o-success: #28a745;
    --o-success-text: #155724;
    --o-success-soft: #d4edda;
    --o-danger: #d23f3a;
    --o-danger-text: #842029;
    --o-danger-soft: #f8d7da;
    --o-warning: #e99d00;
    --o-warning-soft: #fff3cd;
    --o-info-soft: #d9f0f7;

    --o-radius: 4px;
    --o-radius-lg: 8px;
    --o-shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
    --o-shadow: 0 2px 8px rgba(17, 24, 39, 0.08);
    --o-shadow-lg: 0 10px 30px rgba(17, 24, 39, 0.14);

    --o-navbar-h: 46px;
    --o-font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --o-transition: 150ms ease;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--o-font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--o-text);
    background: var(--o-bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--o-action); text-decoration: none; }
a:hover { color: var(--o-action-hover); text-decoration: underline; }

h1, h2, h3, h4 { color: var(--o-heading); font-weight: 500; line-height: 1.25; }

img { max-width: 100%; display: block; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.o-muted { color: var(--o-muted); }
.o-nowrap { white-space: nowrap; }
.o-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.o-icon { width: 16px; height: 16px; flex-shrink: 0; }

:focus-visible { outline: 2px solid var(--o-action); outline-offset: 2px; }

/* ===== GLOBAL LOADING BAR ===== */
.o-loading-bar {
    position: fixed; top: 0; left: 0; height: 2px; width: 0;
    background: var(--o-action); z-index: 2000; opacity: 0;
    transition: width 400ms ease, opacity 200ms ease;
}
body.o-is-loading .o-loading-bar { width: 70%; opacity: 1; }

/* ===== NAVBAR ===== */
.o-navbar {
    position: sticky; top: 0; z-index: 1000;
    display: flex; align-items: center; gap: 0.25rem;
    height: var(--o-navbar-h);
    padding: 0 0.5rem;
    background: var(--o-brand);
    color: #fff;
}

.o-navbar-toggle {
    display: none;
    align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: transparent; border: 0; color: #fff; cursor: pointer;
    border-radius: var(--o-radius);
}
.o-navbar-toggle:hover { background: rgba(255, 255, 255, 0.12); }

.o-navbar-brand {
    display: flex; align-items: center; gap: 0.6rem;
    height: 100%; padding: 0 0.75rem 0 0.5rem;
    color: #fff; font-size: 1.05rem; font-weight: 500;
}
.o-navbar-brand:hover { color: #fff; text-decoration: none; background: rgba(255, 255, 255, 0.08); }
.o-navbar-brand .o-apps-icon { display: inline-flex; opacity: 0.9; }
.o-navbar-logo { width: 26px; height: 26px; border-radius: 6px; background: #fff; padding: 2px; object-fit: contain; }

.o-menu { display: flex; align-items: stretch; height: 100%; }
.o-menu-item {
    display: flex; align-items: center;
    padding: 0 0.85rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.925rem;
    transition: background var(--o-transition), color var(--o-transition);
}
.o-menu-item:hover { color: #fff; background: rgba(255, 255, 255, 0.12); text-decoration: none; }
.o-menu-item.active { color: #fff; background: rgba(0, 0, 0, 0.14); font-weight: 500; }

.o-systray { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; height: 100%; }

.o-db-chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff; font-size: 0.8rem;
    max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* User dropdown (native <details>) */
.o-user-menu { position: relative; height: 100%; }
.o-user-menu > summary {
    list-style: none;
    display: flex; align-items: center; gap: 0.5rem;
    height: 100%; padding: 0 0.6rem;
    cursor: pointer; color: #fff;
    border-radius: var(--o-radius);
}
.o-user-menu > summary::-webkit-details-marker { display: none; }
.o-user-menu > summary:hover,
.o-user-menu[open] > summary { background: rgba(255, 255, 255, 0.12); }
.o-user-name { font-size: 0.9rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.o-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 6px;
    background: var(--o-action); color: #fff;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
}
.o-avatar-lg { width: 40px; height: 40px; font-size: 0.95rem; border-radius: 8px; }

.o-dropdown {
    position: absolute; right: 0; top: calc(100% + 4px);
    min-width: 240px;
    background: var(--o-surface);
    color: var(--o-text);
    border: 1px solid var(--o-border-light);
    border-radius: var(--o-radius-lg);
    box-shadow: var(--o-shadow-lg);
    padding: 0.5rem 0;
    z-index: 1100;
}
.o-dropdown-header { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 1rem 0.75rem; }
.o-dropdown-header strong { display: block; color: var(--o-heading); font-weight: 500; }
.o-dropdown-header small { color: var(--o-muted); font-size: 0.8rem; }
.o-dropdown-divider { height: 1px; background: var(--o-border-light); margin: 0.25rem 0; }
.o-dropdown-item {
    display: flex; align-items: center; gap: 0.6rem;
    width: 100%; padding: 0.5rem 1rem;
    background: none; border: 0; text-align: left;
    color: var(--o-text); font: inherit; cursor: pointer;
}
.o-dropdown-item:hover { background: var(--o-hover); color: var(--o-heading); text-decoration: none; }

/* ===== CONTROL PANEL (breadcrumb + actions + search) ===== */
.o-control-panel {
    background: var(--o-surface);
    border-bottom: 1px solid var(--o-border-light);
    padding: 0.65rem 1rem;
}
.o-cp-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
}
.o-cp-left { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.o-cp-right { display: flex; align-items: center; gap: 0.5rem; flex: 1 1 320px; justify-content: flex-end; }

.o-breadcrumb { display: flex; align-items: center; gap: 0.4rem; font-size: 1.1rem; min-width: 0; }
.o-breadcrumb a, .o-breadcrumb span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.o-breadcrumb a { color: var(--o-action); }
.o-breadcrumb .o-bc-sep { color: var(--o-subtle); }
.o-breadcrumb .o-bc-active { color: var(--o-heading); font-weight: 500; }
.o-cp-subtitle { color: var(--o-muted); font-size: 0.85rem; }
.o-cp-subtitle.is-danger { color: var(--o-danger); }

/* Search bar — Odoo style */
.o-searchbar {
    display: flex; align-items: center; gap: 0.4rem;
    width: 100%; max-width: 520px;
    border: 1px solid var(--o-border);
    border-radius: var(--o-radius);
    background: var(--o-surface);
    padding: 0 0.5rem;
    transition: border-color var(--o-transition), box-shadow var(--o-transition);
}
.o-searchbar:focus-within { border-color: var(--o-action); box-shadow: 0 0 0 3px var(--o-action-soft); }
.o-searchbar .o-icon { color: var(--o-muted); }
.o-searchbar input[type="text"],
.o-searchbar input[type="search"] {
    flex: 1; border: 0 !important; box-shadow: none !important;
    padding: 0.4rem 0.25rem; background: transparent;
}

/* Filter row below control panel */
.o-filter-bar {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1.25rem;
    margin-top: 0.65rem; padding-top: 0.65rem;
    border-top: 1px dashed var(--o-border-light);
}
.o-filter { display: flex; flex-direction: column; gap: 0.15rem; min-width: 150px; }
.o-filter label { font-size: 0.75rem; font-weight: 500; color: var(--o-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.o-filter-project { min-width: 220px; }

/* ===== MAIN ACTION AREA ===== */
.o-action { flex: 1; width: 100%; }
.o-content { padding: 1rem; }
.o-content-narrow { max-width: 1140px; margin: 0 auto; }

.o-section + .o-section { margin-top: 1.5rem; }
.o-section-header {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin-bottom: 0.6rem;
}
.o-section-header h2 { font-size: 1rem; font-weight: 500; display: flex; align-items: center; gap: 0.5rem; }
.o-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 20px; padding: 0 6px;
    border-radius: 999px; background: var(--o-border-light);
    font-size: 0.75rem; color: var(--o-muted); font-weight: 500;
}

/* ===== BUTTONS ===== */
button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.375rem 0.75rem;
    font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1.4;
    border: 1px solid transparent; border-radius: var(--o-radius);
    background: var(--o-border-light); color: var(--o-heading);
    cursor: pointer; white-space: nowrap;
    transition: background var(--o-transition), border-color var(--o-transition), color var(--o-transition);
}
button:hover, .btn:hover { background: #d9dce1; text-decoration: none; }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary, button[type="submit"] { background: var(--o-brand); color: #fff; }
.btn-primary:hover, button[type="submit"]:hover { background: var(--o-brand-hover); color: #fff; }

.btn-secondary { background: var(--o-border-light); color: var(--o-heading); }

.btn-link {
    background: transparent; color: var(--o-action); padding-left: 0.4rem; padding-right: 0.4rem;
}
.btn-link:hover { background: var(--o-action-soft); color: var(--o-action-hover); }

.btn-danger { background: transparent; color: var(--o-danger); border-color: transparent; }
.btn-danger:hover { background: var(--o-danger-soft); color: var(--o-danger-text); }

.btn-small { padding: 0.2rem 0.55rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* Icon-only buttons in list rows */
.btn-icon {
    width: 30px; height: 30px; padding: 0;
    background: transparent; color: var(--o-muted);
}
.btn-icon:hover { background: var(--o-hover); color: var(--o-heading); }
.btn-icon.is-danger:hover { background: var(--o-danger-soft); color: var(--o-danger); }
.btn-icon.is-success { color: var(--o-success); }
.btn-icon.is-success:hover { background: var(--o-success-soft); color: var(--o-success-text); }

/* Legacy names kept for routes that return raw HTML */
.btn-edit, .btn-delete, .btn-save, .btn-cancel { font-size: 0.8rem; padding: 0.25rem 0.6rem; }
.btn-save { background: var(--o-brand); color: #fff; }
.btn-save:hover { background: var(--o-brand-hover); color: #fff; }
.btn-cancel { background: var(--o-border-light); }

button.htmx-request { position: relative; color: transparent !important; pointer-events: none; }
button.htmx-request::after {
    content: ""; position: absolute; inset: 0; margin: auto;
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid currentColor; border-color: #fff #fff transparent transparent;
    animation: o-spin 0.6s linear infinite;
}
.btn-icon.htmx-request::after, .btn-link.htmx-request::after,
.btn-danger.htmx-request::after, .btn-secondary.htmx-request::after {
    border-color: var(--o-action) var(--o-action) transparent transparent;
}

/* ===== FORM CONTROLS (Odoo underline style) ===== */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
    width: 100%;
    font: inherit; font-size: 0.875rem; color: var(--o-heading);
    padding: 0.3rem 0.25rem;
    background: transparent;
    border: 0; border-bottom: 1px solid var(--o-border);
    border-radius: 0;
    transition: border-color var(--o-transition), background var(--o-transition);
}
input:hover:not(:disabled):not([readonly]), select:hover:not(:disabled), textarea:hover { border-bottom-color: var(--o-muted); }
input:focus, select:focus, textarea:focus { outline: none; border-bottom-color: var(--o-action); box-shadow: 0 1px 0 0 var(--o-action); }
input:disabled, select:disabled, input[readonly] { color: var(--o-muted); cursor: not-allowed; border-bottom-style: dashed; }
input::placeholder, textarea::placeholder { color: var(--o-subtle); }
textarea { resize: vertical; min-height: 72px; }
select {
    appearance: none; -webkit-appearance: none;
    padding-right: 1.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7280' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.35rem center;
    cursor: pointer;
}

/* Odoo form "group": label column + field column */
.o-group { display: grid; grid-template-columns: minmax(130px, 32%) 1fr; gap: 0.85rem 1rem; align-items: center; }
.o-group > label, .o-label { font-weight: 500; color: var(--o-heading); font-size: 0.875rem; }
.o-group .o-span-2 { grid-column: 1 / -1; }
.o-group .o-align-top { align-self: start; padding-top: 0.3rem; }
.o-required::after { content: " *"; color: var(--o-danger); }
.o-hint { display: block; color: var(--o-muted); font-weight: 400; font-size: 0.75rem; }

.o-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem 2.5rem; }

/* Generic stacked fields (inline edit forms) */
.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem 1.5rem; margin-bottom: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.2rem; }
.form-group label { font-size: 0.75rem; font-weight: 500; color: var(--o-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.form-group label span { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--o-subtle); }
.inline-form-actions { display: flex; align-items: center; gap: 0.5rem; }

/* ===== FORM SHEET ===== */
.o-form-view { padding: 1rem; }
.o-form-sheet {
    max-width: 860px; margin: 0 auto;
    background: var(--o-surface);
    border: 1px solid var(--o-border-light);
    border-radius: var(--o-radius-lg);
    box-shadow: var(--o-shadow-sm);
    padding: 1.75rem 2rem 2rem;
}
.o-form-sheet.is-narrow { max-width: 620px; }
.o-form-title { margin-bottom: 1.5rem; }
.o-form-title .o-form-eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--o-muted); font-weight: 500; }
.o-form-title h1 { font-size: 1.6rem; font-weight: 500; margin-top: 0.15rem; }
.o-form-footer { display: flex; gap: 0.5rem; margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--o-border-light); }
.o-form-message:empty { display: none; }
.o-form-message { margin-bottom: 1.25rem; }

/* ===== LIST VIEW ===== */
.o-list-view {
    background: var(--o-surface);
    border: 1px solid var(--o-border-light);
    border-radius: var(--o-radius-lg);
    overflow-x: auto;
    box-shadow: var(--o-shadow-sm);
}
.o-list-view table, table.o-list-table { width: 100%; border-collapse: collapse; }
.o-list-view thead th {
    position: sticky; top: 0;
    background: var(--o-surface-alt);
    color: var(--o-heading);
    font-weight: 500; font-size: 0.85rem;
    text-align: left;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--o-border);
    white-space: nowrap;
}
.o-list-view thead th.o-num { text-align: right; }
.o-list-view tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--o-border-light);
    vertical-align: middle;
}
.o-list-view tbody tr:last-child td { border-bottom: 0; }
.o-list-view tbody tr:hover { background: var(--o-hover); }
.o-list-view tfoot td {
    padding: 0.55rem 0.75rem;
    background: var(--o-surface-alt);
    border-top: 1px solid var(--o-border);
    font-weight: 500; color: var(--o-heading);
}
.o-list-view td.o-text-truncate { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-row-actions { width: 1%; white-space: nowrap; text-align: right; }
.o-row-actions > * + * { margin-left: 0.15rem; }
.o-list-view .o-row-actions { opacity: 0.55; transition: opacity var(--o-transition); }
.o-list-view tr:hover .o-row-actions,
.o-list-view tr:focus-within .o-row-actions { opacity: 1; }

/* Editable rows (inline add/edit) */
.o-list-view tr.edit-row,
.o-list-view tr.add-row,
.o-list-view tr.user-edit-row { background: var(--o-action-soft) !important; }
.o-list-view tr.edit-row td,
.o-list-view tr.add-row td,
.o-list-view tr.user-edit-row td { border-bottom-color: #c8e2e3; }
.o-list-view tr.edit-row td:first-child,
.o-list-view tr.add-row td:first-child,
.o-list-view tr.user-edit-row td:first-child { box-shadow: inset 3px 0 0 var(--o-action); }
.o-inline-form { padding: 0.75rem 0.25rem; }
.o-inline-form h3 { font-size: 0.95rem; font-weight: 500; margin-bottom: 0.85rem; }
.o-inline-help { font-size: 0.78rem; color: var(--o-muted); align-self: end; padding-bottom: 0.35rem; }

.o-cell-inline { display: flex; align-items: center; gap: 0.35rem; }
.o-cell-inline select { min-width: 150px; }

/* Empty state */
.o-nocontent { text-align: center; padding: 3rem 1rem; color: var(--o-muted); }
.o-nocontent .o-nocontent-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--o-brand-soft); color: var(--o-brand); margin-bottom: 0.75rem;
}
.o-nocontent strong { display: block; color: var(--o-heading); font-weight: 500; font-size: 1rem; margin-bottom: 0.25rem; }
.o-list-view tbody tr.o-nocontent-row:hover { background: transparent; }
.o-list-view tbody:has(.add-row, .user-edit-row) .o-nocontent-row { display: none; }

.o-loading-row td { color: var(--o-muted); padding: 1.25rem 0.75rem !important; }
.o-skeleton {
    display: inline-block; height: 10px; width: 100%; max-width: 420px; border-radius: 4px;
    background: linear-gradient(90deg, var(--o-border-light) 25%, var(--o-hover) 50%, var(--o-border-light) 75%);
    background-size: 200% 100%; animation: o-shimmer 1.2s infinite;
}

.infinite-scroll-trigger td { padding: 0 !important; border: 0 !important; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-flex; }

/* ===== BADGES & STATUS ===== */
.badge {
    display: inline-flex; align-items: center;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem; font-weight: 500;
    background: var(--o-border-light); color: var(--o-heading);
    text-transform: capitalize; white-space: nowrap;
}
.badge.superadmin { background: var(--o-brand); color: #fff; }
.badge.admin      { background: var(--o-brand-soft); color: var(--o-brand); }
.badge.user       { background: var(--o-action-soft); color: var(--o-action); }
.badge-xmlrpc     { background: #eef0f3; color: #4b5563; text-transform: none; }
.badge-json2      { background: var(--o-info-soft); color: #0b6880; text-transform: none; }

.status { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.825rem; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.status.active   { color: var(--o-success-text); }
.status.active::before   { background: var(--o-success); }
.status.inactive { color: var(--o-muted); }
.status.inactive::before { background: var(--o-subtle); }

/* ===== ALERTS (returned by HTMX endpoints) ===== */
.error, .error-message, .success, .message, .o-alert {
    display: flex; align-items: flex-start; gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    border-radius: var(--o-radius);
    font-size: 0.875rem;
    border: 1px solid transparent;
}
.error, .error-message, .message.error, .o-alert-danger {
    background: var(--o-danger-soft); color: var(--o-danger-text); border-color: #f1c2c5;
}
.success, .message.success, .o-alert-success {
    background: var(--o-success-soft); color: var(--o-success-text); border-color: #c3e6cb;
}
.message.warning, .o-alert-warning { background: var(--o-warning-soft); color: #7a5300; border-color: #ffe69c; }
.o-alert-info { background: var(--o-info-soft); color: #0b5468; border-color: #b6e0ec; }
td .error, td .success { display: inline-flex; padding: 0.15rem 0.5rem; font-size: 0.78rem; margin-left: 0.35rem; }
#timesheet-form-error:empty, #passwordMessage:empty, #successMessage:empty { display: none; }
#timesheet-form-error { margin-bottom: 0.75rem; }

/* ===== PROJECTS (search panel + content) ===== */
.o-searchpanel-layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - var(--o-navbar-h) - 58px); }
.o-searchpanel {
    background: var(--o-surface);
    border-right: 1px solid var(--o-border-light);
    padding: 1rem 0.5rem;
    overflow-y: auto;
}
.o-searchpanel h3 {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0 0.75rem 0.5rem;
    font-size: 0.75rem; font-weight: 700; color: var(--o-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.o-searchpanel ul { list-style: none; }
.o-searchpanel li {
    padding: 0.4rem 0.75rem; border-radius: var(--o-radius);
    cursor: pointer; color: var(--o-text);
    transition: background var(--o-transition);
}
.o-searchpanel li:hover { background: var(--o-hover); }
.o-searchpanel li.active { background: var(--o-action-soft); color: var(--o-action); font-weight: 500; }
.o-searchpanel-content { padding: 1rem; }
.o-task-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.75rem; }
.o-task-list li {
    background: var(--o-surface);
    border: 1px solid var(--o-border-light);
    border-left: 3px solid var(--o-brand);
    border-radius: var(--o-radius);
    padding: 0.75rem 0.85rem;
    box-shadow: var(--o-shadow-sm);
}

/* ===== AUTH PAGES (login / forgot / reset) ===== */
.o-auth {
    flex: 1;
    display: grid; grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
    background: var(--o-surface);
}
.o-auth-brand {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 2.5rem 3rem;
    color: #fff;
    background: var(--o-brand);
}
.o-auth-brand::after {
    content: ""; position: absolute; right: -120px; bottom: -120px;
    width: 380px; height: 380px; border-radius: 50%;
    border: 56px solid rgba(255, 255, 255, 0.07);
}
.o-auth-logo { display: flex; align-items: center; gap: 0.75rem; font-size: 1.1rem; font-weight: 500; color: #fff; }
.o-auth-logo img { width: 40px; height: 40px; border-radius: 8px; background: #fff; padding: 4px; object-fit: contain; }
.o-auth-pitch { position: relative; z-index: 1; max-width: 460px; }
.o-auth-pitch .o-eyebrow {
    display: inline-block; margin-bottom: 1rem;
    padding: 0.2rem 0.65rem; border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.o-auth-pitch h2 { color: #fff; font-size: 2.1rem; font-weight: 500; line-height: 1.2; margin-bottom: 1rem; text-wrap: balance; }
.o-auth-pitch p { color: rgba(255, 255, 255, 0.82); font-size: 1rem; line-height: 1.6; }
.o-auth-points { list-style: none; margin-top: 1.75rem; display: grid; gap: 0.6rem; }
.o-auth-points li { display: flex; align-items: center; gap: 0.6rem; color: rgba(255, 255, 255, 0.92); }
.o-auth-points .o-icon { color: #7fd3d6; }
.o-auth-foot { position: relative; z-index: 1; font-size: 0.8rem; color: rgba(255, 255, 255, 0.6); }

.o-auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem; background: var(--o-bg); }
.o-auth-card {
    width: 100%; max-width: 400px;
    background: var(--o-surface);
    border: 1px solid var(--o-border-light);
    border-radius: var(--o-radius-lg);
    box-shadow: var(--o-shadow);
    padding: 2.25rem 2rem;
}
.o-auth-card-logo { display: none; justify-content: center; margin-bottom: 1.25rem; }
.o-auth-card-logo img { width: 56px; height: 56px; object-fit: contain; }
.o-auth-card h1 { font-size: 1.5rem; font-weight: 500; margin-bottom: 0.35rem; }
.o-auth-card .o-auth-lead { color: var(--o-muted); margin-bottom: 1.5rem; font-size: 0.9rem; }

.o-auth-field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.o-auth-field label { font-weight: 500; color: var(--o-heading); font-size: 0.875rem; }
.o-auth-field-row { display: flex; justify-content: space-between; align-items: baseline; }
.o-auth-field-row a { font-size: 0.8rem; }
.o-auth input:not([type="checkbox"]):not([type="hidden"]) {
    border: 1px solid var(--o-border);
    border-radius: var(--o-radius);
    padding: 0.55rem 0.75rem;
    background: var(--o-surface);
}
.o-auth input:focus { border-color: var(--o-action); box-shadow: 0 0 0 3px var(--o-action-soft); }
.o-auth button[type="submit"] { width: 100%; padding: 0.6rem 1rem; font-size: 0.95rem; margin-top: 0.5rem; }
.o-auth-message { margin: 0.25rem 0 0.75rem; }
.o-auth-message:empty { display: none; }
.o-auth-alt { text-align: center; margin-top: 1.5rem; font-size: 0.875rem; color: var(--o-muted); }
.o-auth-powered { text-align: center; margin-top: 1.25rem; font-size: 0.75rem; color: var(--o-subtle); }
.o-auth-powered strong { color: var(--o-brand); font-weight: 500; }

/* ===== ANIMATIONS ===== */
@keyframes o-spin { to { transform: rotate(360deg); } }
@keyframes o-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes o-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.o-list-view tbody tr, .o-form-sheet, .o-auth-card { animation: o-fade-in 180ms ease; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c9ccd1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--o-subtle); }

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
    .o-auth { grid-template-columns: 1fr; }
    .o-auth-brand { display: none; }
    .o-auth-card-logo { display: flex; }
    .o-groups { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .o-navbar-toggle { display: inline-flex; }
    .o-navbar-brand .o-apps-icon { display: none; }
    .o-menu {
        display: none;
        position: absolute; top: var(--o-navbar-h); left: 0; right: 0;
        flex-direction: column; height: auto;
        background: var(--o-brand-hover);
        box-shadow: var(--o-shadow-lg);
    }
    .o-menu.open { display: flex; }
    .o-menu-item { padding: 0.8rem 1.25rem; }
    .o-db-chip, .o-user-name { display: none; }

    .o-control-panel { padding: 0.6rem 0.75rem; }
    .o-cp-right { flex-basis: 100%; }
    .o-searchbar { max-width: none; }
    .o-filter { flex: 1 1 140px; min-width: 0; }

    .o-content, .o-form-view { padding: 0.75rem; }
    .o-form-sheet { padding: 1.25rem; }
    .o-group { grid-template-columns: 1fr; gap: 0.25rem; }
    .o-group > label { margin-top: 0.6rem; }

    .o-searchpanel-layout { grid-template-columns: 1fr; }
    .o-searchpanel { border-right: 0; border-bottom: 1px solid var(--o-border-light); }
}
