/* ═══════════════════════════════════════════════════════════════
   SyxERP — Odoo-inspired Design System
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* Odoo 17 color palette */
    --o-brand-primary: #4A6FA5;
    --o-brand-secondary: #017E84;
    --o-navbar-bg: #1B1B2F;
    --o-navbar-text: #fff;
    --o-bg: #F1F0F5;
    --o-surface: #fff;
    --o-surface-hover: #F8F8FA;
    --o-border: #DEE2E6;
    --o-border-light: #ECECEC;
    --o-text: #212529;
    --o-text-muted: #6C757D;
    --o-text-light: #9A9A9A;
    --o-success: #00A09D;
    --o-warning: #E9AB17;
    --o-danger: #DC3545;
    --o-info: #17A2B8;
    --o-link: #4A6FA5;
    --o-shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --o-shadow: 0 2px 8px rgba(0,0,0,.1);
    --o-shadow-lg: 0 8px 30px rgba(0,0,0,.12);
    --o-radius: 6px;
    --o-radius-lg: 10px;
    --o-transition: .2s ease;
    --o-font: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --o-font-mono: 'Cascadia Code', 'Fira Code', monospace;
    --o-navbar-h: 46px;
    --o-cp-h: auto;
    /* Kanban */
    --o-kanban-gap: 12px;
    --o-kanban-card-w: 240px;
}

/* Dark mode */
html.dark-mode {
    --o-bg: #1a1a2e;
    --o-surface: #16213e;
    --o-surface-hover: #1f2b47;
    --o-border: #2a2a4a;
    --o-border-light: #252545;
    --o-text: #E0E0E0;
    --o-text-muted: #8E8EA0;
    --o-text-light: #6B6B80;
    --o-shadow-sm: 0 1px 3px rgba(0,0,0,.3);
    --o-shadow: 0 2px 8px rgba(0,0,0,.4);
    --o-navbar-bg: #0f0f23;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--o-font);
    background: var(--o-bg);
    color: var(--o-text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}
a { color: var(--o-link); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
img { max-width: 100%; }

/* ═══ NAVBAR ═══ */
.o-navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: var(--o-navbar-h);
    background: var(--o-navbar-bg);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.o-navbar-left, .o-navbar-right {
    display: flex; align-items: center; gap: 6px;
}
.o-navbar-toggler {
    background: none; border: none; color: var(--o-navbar-text); cursor: pointer;
    width: 34px; height: 34px; border-radius: var(--o-radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; transition: background var(--o-transition);
}
.o-navbar-toggler:hover { background: rgba(255,255,255,.12); }
.o-navbar-brand {
    color: var(--o-navbar-text); font-size: 1.15rem; font-weight: 700;
    margin: 0 10px 0 4px; letter-spacing: -.3px;
    text-decoration: none !important;
}
.brand-syx { color: #fff; }
.brand-erp { color: #D4A5C9; }
.o-navbar-modules {
    display: flex; align-items: center; gap: 2px;
}
.o-navbar-module {
    color: rgba(255,255,255,.7); padding: 6px 12px; border-radius: var(--o-radius);
    font-size: .85rem; font-weight: 500; transition: all var(--o-transition);
    text-decoration: none !important; white-space: nowrap;
}
.o-navbar-module:hover { color: #fff; background: rgba(255,255,255,.1); }
.o-navbar-module.active {
    color: #fff; background: rgba(255,255,255,.15);
    box-shadow: inset 0 -2px 0 var(--o-brand-primary);
}

/* Navbar dropdown submenus */
.o-navbar-module-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.o-navbar-module-wrap:hover .o-navbar-submenu {
    display: block;
}
.o-navbar-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--o-surface);
    border: 1px solid var(--o-border);
    border-radius: 0 0 var(--o-radius-lg) var(--o-radius-lg);
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    min-width: 200px;
    z-index: 1100;
    padding: 4px 0;
}
.o-navbar-submenu-item {
    display: block;
    padding: 8px 16px;
    font-size: .82rem;
    color: var(--o-text);
    text-decoration: none !important;
    transition: background .15s;
    white-space: nowrap;
}
.o-navbar-submenu-item:hover {
    background: var(--o-surface-hover);
    color: var(--o-brand-primary);
}

.o-navbar-search-wrap {
    position: relative; margin-right: 8px;
}
.o-navbar-search-wrap i {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,.4); font-size: .8rem;
}
.o-navbar-search {
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.1);
    color: #fff; padding: 5px 10px 5px 30px; border-radius: 20px;
    font-size: .82rem; width: 200px; transition: all var(--o-transition);
    outline: none;
}
.o-navbar-search::placeholder { color: rgba(255,255,255,.4); }
.o-navbar-search:focus {
    width: 280px; background: rgba(255,255,255,.15);
    border-color: rgba(255,255,255,.2);
}
.o-navbar-user {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 4px 8px; border-radius: var(--o-radius); position: relative;
    color: var(--o-navbar-text); transition: background var(--o-transition);
}
.o-navbar-user:hover { background: rgba(255,255,255,.1); }
.o-navbar-username { font-size: .82rem; font-weight: 500; }
.o-avatar-sm {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: .75rem; font-weight: 700;
    flex-shrink: 0; overflow: hidden;
}
.o-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

/* ─── Dropdown ─── */
.o-dropdown {
    position: absolute; top: 100%; right: 0; margin-top: 6px;
    background: var(--o-surface); border: 1px solid var(--o-border);
    border-radius: var(--o-radius-lg); box-shadow: var(--o-shadow-lg);
    min-width: 220px; padding: 6px 0; z-index: 1100;
    display: none; animation: dropIn .15s ease;
}
.o-dropdown.show { display: block; }
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.o-dropdown-header {
    padding: 10px 14px; display: flex; flex-direction: column;
}
.o-dropdown-header strong { font-size: .9rem; color: var(--o-text); }
.o-dropdown-header small { font-size: .75rem; color: var(--o-text-muted); }
.o-dropdown-divider { height: 1px; background: var(--o-border-light); margin: 4px 0; }
.o-dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 14px; color: var(--o-text); font-size: .85rem;
    transition: background var(--o-transition); text-decoration: none !important;
}
.o-dropdown-item:hover { background: var(--o-surface-hover); }
.o-dropdown-item i { width: 16px; text-align: center; color: var(--o-text-muted); }
.text-danger { color: var(--o-danger) !important; }

/* ═══ APP DRAWER ═══ */
.o-app-drawer { display: none; }
.o-app-drawer.open { display: block; }
.o-app-drawer-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1050;
    animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.o-app-drawer-panel {
    position: fixed; top: var(--o-navbar-h); left: 0;
    width: 320px; max-height: calc(100vh - var(--o-navbar-h));
    background: var(--o-surface); z-index: 1060; overflow-y: auto;
    box-shadow: var(--o-shadow-lg); border-radius: 0 0 var(--o-radius-lg) 0;
    padding: 20px; animation: slideRight .2s ease;
}
@keyframes slideRight {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
.o-app-drawer-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.o-app-tile {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 14px 8px; border-radius: var(--o-radius-lg); cursor: pointer;
    transition: background var(--o-transition); text-decoration: none !important;
}
.o-app-tile:hover { background: var(--o-surface-hover); }
.o-app-tile.disabled { opacity: .4; pointer-events: none; }
.o-app-tile.current .o-app-tile-icon { box-shadow: 0 0 0 3px var(--o-brand-primary); }
.o-app-tile-icon {
    width: 48px; height: 48px; border-radius: var(--o-radius-lg);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.3rem;
}
.o-app-tile-name {
    font-size: .72rem; font-weight: 600; color: var(--o-text);
    text-align: center; line-height: 1.2;
}

/* ═══ MAIN ═══ */
.o-main {
    margin-top: var(--o-navbar-h);
    min-height: calc(100vh - var(--o-navbar-h));
}

/* ═══ CONTROL PANEL (Odoo-style) ═══ */
.o-cp {
    background: var(--o-surface);
    border-bottom: 1px solid var(--o-border);
    padding: 8px 20px;
    position: sticky; top: var(--o-navbar-h); z-index: 100;
    box-shadow: var(--o-shadow-sm);
}
.o-cp-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
}
.o-cp-left { display: flex; align-items: center; gap: 10px; flex: 1; overflow: visible; }
.o-cp-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.o-breadcrumb {
    display: flex; align-items: center; gap: 6px; font-size: .9rem;
}
.o-breadcrumb-item { color: var(--o-text-muted); }
.o-breadcrumb-item.active { color: var(--o-text); font-weight: 600; }
.o-breadcrumb-sep { color: var(--o-text-light); font-size: .7rem; }

/* Search Box */
.o-search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--o-border);
    border-radius: var(--o-radius);
    background: var(--o-bg);
    transition: border-color .2s;
}
.o-search-box:focus-within {
    border-color: var(--o-brand-primary);
}
.o-search-box i {
    color: var(--o-text-light);
    font-size: .75rem;
}
.o-search-box input {
    border: none;
    outline: none;
    font-size: .82rem;
    background: transparent;
    color: var(--o-text);
    width: 140px;
}
.o-search-box input::placeholder {
    color: var(--o-text-light);
}

/* Buttons */
.o-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 16px; border-radius: var(--o-radius);
    font-size: .82rem; font-weight: 500; cursor: pointer;
    border: 1px solid transparent; transition: all var(--o-transition);
    white-space: nowrap; text-decoration: none !important;
    line-height: 1.4;
}
.o-btn i { font-size: .8rem; }
.o-btn-primary {
    background: var(--o-brand-primary); color: #fff; border-color: var(--o-brand-primary);
}
.o-btn-primary:hover { background: #5D3A56; border-color: #5D3A56; }
.o-btn-secondary {
    background: var(--o-surface); color: var(--o-text); border-color: var(--o-border);
}
.o-btn-secondary:hover { background: var(--o-surface-hover); }
.o-btn-success { background: var(--o-success); color: #fff; }
.o-btn-success:hover { background: #008B88; }
.o-btn-danger { background: var(--o-danger); color: #fff; }
.o-btn-danger:hover { background: #C82333; }
.o-btn-sm { padding: 4px 10px; font-size: .78rem; }
.o-btn-icon {
    width: 32px; height: 32px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--o-surface); border: 1px solid var(--o-border);
    border-radius: var(--o-radius); color: var(--o-text-muted); cursor: pointer;
    transition: all var(--o-transition);
}
.o-btn-icon:hover { background: var(--o-surface-hover); color: var(--o-text); }
.o-btn-icon.active { background: var(--o-brand-primary); color: #fff; border-color: var(--o-brand-primary); }
.o-btn-link {
    background: none; border: none; color: var(--o-link); padding: 4px 8px;
    cursor: pointer; font-size: .82rem;
}
.o-btn-link:hover { text-decoration: underline; }

/* Search bar */
.o-cp-search {
    display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap;
}
.o-search-input-wrap {
    position: relative; flex: 1; min-width: 200px;
}
.o-search-input-wrap i {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--o-text-light); font-size: .8rem;
}
.o-search-input {
    width: 100%; padding: 7px 10px 7px 32px;
    border: 1px solid var(--o-border); border-radius: var(--o-radius);
    background: var(--o-surface); color: var(--o-text);
    outline: none; transition: border-color var(--o-transition);
    font-size: .85rem;
}
.o-search-input:focus { border-color: var(--o-brand-primary); }
.o-filter-group {
    display: flex; align-items: center; gap: 4px;
}
.o-filter-btn {
    padding: 5px 12px; border: 1px solid var(--o-border); border-radius: var(--o-radius);
    background: var(--o-surface); color: var(--o-text-muted); cursor: pointer;
    font-size: .78rem; font-weight: 500; transition: all var(--o-transition);
    display: inline-flex; align-items: center; gap: 4px;
}
.o-filter-btn:hover { border-color: var(--o-brand-primary); color: var(--o-text); }
.o-filter-btn.active {
    background: #E2EBF7; border-color: var(--o-brand-primary); color: var(--o-brand-primary);
}
html.dark-mode .o-filter-btn.active { background: #3a2040; }
.o-active-filters {
    display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.o-filter-tag {
    display: inline-flex; align-items: center; gap: 4px;
    background: #E8F4F5; color: var(--o-brand-secondary);
    padding: 3px 8px; border-radius: 20px; font-size: .72rem; font-weight: 600;
}
.o-filter-tag .close {
    cursor: pointer; font-size: .8rem; opacity: .7; margin-left: 2px;
}
.o-filter-tag .close:hover { opacity: 1; }

/* Pager */
.o-pager {
    display: flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--o-text-muted);
}
.o-pager-btn {
    width: 26px; height: 26px; border: 1px solid var(--o-border); border-radius: var(--o-radius);
    background: var(--o-surface); color: var(--o-text-muted); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all var(--o-transition); font-size: .7rem;
}
.o-pager-btn:hover { background: var(--o-surface-hover); color: var(--o-text); }
.o-pager-btn:disabled { opacity: .3; cursor: default; }

/* View switcher */
.o-view-switch {
    display: flex; border: 1px solid var(--o-border); border-radius: var(--o-radius);
    overflow: hidden;
}
.o-view-switch .o-btn-icon { border: none; border-radius: 0; width: 30px; height: 28px; }
.o-view-switch .o-btn-icon + .o-btn-icon { border-left: 1px solid var(--o-border); }

/* ═══ KANBAN VIEW ═══ */
.o-kanban {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--o-kanban-card-w), 1fr));
    gap: var(--o-kanban-gap);
}
.o-kanban-card {
    background: var(--o-surface); border: 1px solid var(--o-border);
    border-radius: var(--o-radius-lg); padding: 14px;
    cursor: pointer; transition: all var(--o-transition); position: relative;
}
.o-kanban-card:hover {
    box-shadow: var(--o-shadow); border-color: #C8C0D0;
    transform: translateY(-1px);
}
.o-kanban-card-top {
    display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px;
}
.o-kanban-avatar {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 700; color: #fff;
    overflow: hidden;
}
.o-kanban-avatar img { width: 100%; height: 100%; object-fit: cover; }
.o-kanban-info { flex: 1; min-width: 0; }
.o-kanban-name {
    font-weight: 600; font-size: .9rem; color: var(--o-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.o-kanban-sub {
    font-size: .75rem; color: var(--o-text-muted); margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.o-kanban-type-badge {
    position: absolute; top: 10px; right: 10px;
    font-size: .65rem; font-weight: 600; text-transform: uppercase;
    padding: 2px 6px; border-radius: 3px;
    letter-spacing: .3px;
}
.o-kanban-type-badge.company { background: #E8F4F5; color: var(--o-brand-secondary); }
.o-kanban-type-badge.individual { background: #E2EBF7; color: var(--o-brand-primary); }
.o-kanban-details {
    font-size: .78rem; color: var(--o-text-muted);
    display: flex; flex-direction: column; gap: 3px; margin-top: 6px;
}
.o-kanban-details > div {
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.o-kanban-details i { width: 14px; text-align: center; font-size: .72rem; color: var(--o-text-light); }
.o-kanban-tags {
    display: flex; flex-wrap: wrap; gap: 3px; margin-top: 8px;
}
.o-tag {
    font-size: .65rem; font-weight: 600; padding: 2px 8px;
    border-radius: 20px; color: #fff; letter-spacing: .2px;
}
.o-kanban-card .o-checkbox { position: absolute; top: 12px; left: -6px; opacity: 0; transition: opacity .15s; }
.o-kanban-card:hover .o-checkbox { opacity: 1; }

/* ═══ LIST VIEW ═══ */
.o-list-wrap { padding: 0 20px 20px; }
.o-list, .o-list-table {
    width: 100%; border-collapse: collapse; background: var(--o-surface);
    border: 1px solid var(--o-border); border-radius: var(--o-radius-lg);
    overflow: hidden;
}
.o-list th, .o-list-table th {
    background: var(--o-surface-hover); border-bottom: 2px solid var(--o-border);
    padding: 8px 12px; text-align: left; font-size: .75rem;
    font-weight: 600; color: var(--o-text-muted); text-transform: uppercase;
    letter-spacing: .3px; cursor: pointer; white-space: nowrap;
    user-select: none; transition: color var(--o-transition);
}
.o-list th:hover, .o-list-table th:hover { color: var(--o-text); }
.o-list th.sorted, .o-list-table th.sorted { color: var(--o-brand-primary); }
.o-list th .sort-icon, .o-list-table th .sort-icon { margin-left: 4px; font-size: .65rem; }
.o-list td, .o-list-table td {
    padding: 8px 12px; border-bottom: 1px solid var(--o-border-light);
    font-size: .82rem; color: var(--o-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 200px;
}
.o-list tr, .o-list-table tr { transition: background var(--o-transition); cursor: pointer; }
.o-list tbody tr:hover, .o-list-table tbody tr:hover { background: #FAFAFA; }
html.dark-mode .o-list tbody tr:hover, html.dark-mode .o-list-table tbody tr:hover { background: var(--o-surface-hover); }
.o-list tr.selected, .o-list-table tr.selected { background: #E2EBF7 !important; }
.o-list .cell-name, .o-list-table .cell-name {
    display: flex; align-items: center; gap: 8px; font-weight: 500;
}
.o-list .cell-avatar {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .65rem; font-weight: 700; color: #fff; overflow: hidden;
}
.o-list .cell-avatar img { width: 100%; height: 100%; object-fit: cover; }
.o-list .cell-tags { display: flex; gap: 3px; flex-wrap: nowrap; }
.o-checkbox {
    width: 16px; height: 16px; accent-color: var(--o-brand-primary);
    cursor: pointer;
}

/* ═══ FORM VIEW — Odoo two-column: form left + chatter right ═══ */
.o-form-view {
    display: flex; gap: 0; animation: formIn .25s ease;
    min-height: calc(100vh - var(--o-navbar-h) - 60px);
}
@keyframes formIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.o-form-main {
    flex: 1; min-width: 0; padding: 0 20px 40px; overflow-y: auto;
}
.o-form-sheet {
    background: var(--o-surface);
    border: 1px solid var(--o-border);
    border-radius: var(--o-radius-lg);
    padding: 24px 28px;
    box-shadow: var(--o-shadow-sm);
    margin-top: 12px;
}
/* Smart buttons bar */
.o-smart-buttons {
    display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
    padding: 6px 0; margin-bottom: 4px;
    border-bottom: 1px solid var(--o-border-light);
}
.o-smart-btn {
    display: flex; flex-direction: column; align-items: center;
    padding: 6px 18px; border: 1px solid var(--o-border); border-radius: var(--o-radius);
    background: var(--o-surface); cursor: pointer; transition: all var(--o-transition);
    text-decoration: none !important; min-width: 90px;
}
.o-smart-btn:hover { background: var(--o-surface-hover); border-color: #C8C0D0; }
.o-smart-btn .sb-value { font-size: 1.1rem; font-weight: 700; color: var(--o-text); }
.o-smart-btn .sb-label { font-size: .65rem; color: var(--o-text-muted); text-transform: uppercase; letter-spacing: .3px; }
/* Action menu (gear dropdown) */
.o-action-menu { position: relative; display: inline-block; }
.o-action-dropdown {
    position: absolute; top: 100%; right: 0; left: auto; margin-top: 4px;
    background: var(--o-surface); border: 1px solid var(--o-border);
    border-radius: var(--o-radius); box-shadow: var(--o-shadow-lg);
    min-width: 240px; padding: 6px 0; z-index: 9000;
    display: none; animation: dropIn .15s ease;
}
.o-action-dropdown.show { display: block; }
.o-action-dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px; font-size: .82rem; color: var(--o-text);
    cursor: pointer; transition: background var(--o-transition);
}
.o-action-dropdown-item:hover { background: var(--o-surface-hover); }
.o-action-dropdown-item i { width: 16px; text-align: center; color: var(--o-text-muted); font-size: .8rem; }
.o-action-dropdown-item.danger { color: var(--o-danger); }
.o-action-dropdown-item.danger i { color: var(--o-danger); }
.o-action-dropdown-sep { height: 1px; background: var(--o-border-light); margin: 4px 0; }
.o-form-header {
    display: flex; align-items: flex-start; gap: 20px; margin-bottom: 20px;
}
.o-form-avatar-wrap {
    position: relative; flex-shrink: 0;
}
.o-form-avatar {
    width: 90px; height: 90px; border-radius: var(--o-radius-lg);
    background: #E8E4EC; display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem; font-weight: 700; color: var(--o-brand-primary);
    overflow: hidden; cursor: pointer; transition: opacity var(--o-transition);
}
.o-form-avatar img { width: 100%; height: 100%; object-fit: cover; }
.o-form-avatar:hover { opacity: .85; }
.o-form-avatar-edit {
    position: absolute; bottom: -4px; right: -4px;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--o-brand-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .6rem; cursor: pointer; border: 2px solid var(--o-surface);
}
.o-form-title-area { flex: 1; }
.o-form-type-switch {
    display: flex; gap: 0; margin-bottom: 8px;
}
.o-form-type-switch label {
    padding: 4px 14px; border: 1px solid var(--o-border); cursor: pointer;
    font-size: .78rem; font-weight: 600; color: var(--o-text-muted);
    transition: all var(--o-transition);
}
.o-form-type-switch label:first-child { border-radius: var(--o-radius) 0 0 var(--o-radius); }
.o-form-type-switch label:last-child { border-radius: 0 var(--o-radius) var(--o-radius) 0; border-left: 0; }
.o-form-type-switch input { display: none; }
.o-form-type-switch input:checked + label {
    background: var(--o-brand-primary); color: #fff; border-color: var(--o-brand-primary);
}
.o-form-name-input {
    width: 100%; padding: 6px 0; border: none; border-bottom: 2px solid var(--o-border-light);
    font-size: 1.6rem; font-weight: 700; color: var(--o-text); background: transparent;
    outline: none; transition: border-color var(--o-transition);
}
.o-form-name-input:focus { border-bottom-color: var(--o-brand-primary); }
.o-form-name-input::placeholder { color: var(--o-text-light); }
.o-form-company-link {
    margin-top: 4px; font-size: .82rem; color: var(--o-text-muted);
}

/* Form Fields Grid */
.o-form-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.o-form-group-col { padding: 0 12px; }
.o-form-group-col:first-child { border-right: 1px solid var(--o-border-light); padding-left: 0; }
.o-form-group-col:last-child { padding-right: 0; }
.o-form-field {
    display: flex; align-items: flex-start; padding: 6px 0; gap: 8px;
}
.o-form-label {
    width: 140px; flex-shrink: 0; text-align: right; padding-top: 5px;
    font-size: .82rem; font-weight: 500; color: var(--o-text-muted);
}
.o-form-value { flex: 1; }
.o-form-input {
    width: 100%; padding: 5px 8px; border: 1px solid transparent;
    border-radius: 4px; background: transparent; color: var(--o-text);
    outline: none; transition: all var(--o-transition); font-size: .85rem;
}
.o-form-input:hover { background: var(--o-surface-hover); }
.o-form-input:focus {
    border-color: var(--o-brand-primary); background: var(--o-surface);
    box-shadow: 0 0 0 1px var(--o-brand-primary);
}
.o-form-select {
    width: 100%; padding: 5px 8px; border: 1px solid transparent;
    border-radius: 4px; background: transparent; color: var(--o-text);
    outline: none; cursor: pointer; font-size: .85rem;
    transition: all var(--o-transition); appearance: auto;
}
.o-form-select:hover { background: var(--o-surface-hover); }
.o-form-select:focus { border-color: var(--o-brand-primary); background: var(--o-surface); }
.o-form-textarea {
    width: 100%; padding: 8px; border: 1px solid var(--o-border);
    border-radius: var(--o-radius); background: var(--o-surface); color: var(--o-text);
    outline: none; font-size: .85rem; resize: vertical; min-height: 80px;
    transition: border-color var(--o-transition);
}
.o-form-textarea:focus { border-color: var(--o-brand-primary); }
.o-form-checkbox-wrap {
    display: flex; align-items: center; gap: 8px; padding: 5px 0;
}
.o-form-checkbox-wrap label { font-size: .82rem; color: var(--o-text); cursor: pointer; }

/* Address block */
.o-address-block { display: flex; flex-direction: column; gap: 4px; }
.o-address-row { display: flex; gap: 6px; }
.o-address-row .o-form-input { flex: 1; }
.o-address-row .o-form-input.sm { max-width: 100px; }

/* Tags input */
.o-tags-input {
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
    padding: 3px 6px; border: 1px solid transparent; border-radius: 4px;
    min-height: 32px; cursor: text; transition: all var(--o-transition);
}
.o-tags-input:hover { background: var(--o-surface-hover); }
.o-tags-input:focus-within { border-color: var(--o-brand-primary); background: var(--o-surface); }
.o-tags-input .o-tag { cursor: default; }
.o-tags-input .o-tag .remove {
    cursor: pointer; margin-left: 3px; opacity: .7;
}
.o-tags-input .o-tag .remove:hover { opacity: 1; }
.o-tags-input input {
    border: none; outline: none; background: transparent;
    font-size: .82rem; color: var(--o-text); min-width: 60px; flex: 1;
    padding: 2px 0;
}
.o-tags-dropdown {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
    background: var(--o-surface); border: 1px solid var(--o-border);
    border-radius: var(--o-radius); box-shadow: var(--o-shadow-lg);
    max-height: 200px; overflow-y: auto; display: none;
}
.o-tags-dropdown.show { display: block; }
.o-tags-dropdown-item {
    padding: 6px 12px; cursor: pointer; font-size: .82rem;
    transition: background var(--o-transition);
}
.o-tags-dropdown-item:hover { background: var(--o-surface-hover); }

/* ═══ TABS (Odoo-style) ═══ */
.o-tabs { margin-top: 24px; border-top: 1px solid var(--o-border-light); }
.o-tabs-nav {
    display: flex; gap: 0; border-bottom: 1px solid var(--o-border);
    overflow-x: auto;
}
.o-tab-btn {
    padding: 10px 18px; background: none; border: none; cursor: pointer;
    font-size: .82rem; font-weight: 500; color: var(--o-text-muted);
    border-bottom: 2px solid transparent; transition: all var(--o-transition);
    white-space: nowrap;
}
.o-tab-btn:hover { color: var(--o-text); }
.o-tab-btn.active {
    color: var(--o-brand-primary); border-bottom-color: var(--o-brand-primary);
    font-weight: 600;
}
.o-tab-pane { display: none; padding: 16px 0; }
.o-tab-pane.active { display: block; }

/* Addresses table in tab */
.o-addresses-table {
    width: 100%; border-collapse: collapse;
}
.o-addresses-table th {
    text-align: left; padding: 6px 10px; font-size: .75rem; font-weight: 600;
    color: var(--o-text-muted); border-bottom: 1px solid var(--o-border);
    text-transform: uppercase; letter-spacing: .3px;
}
.o-addresses-table td {
    padding: 8px 10px; font-size: .82rem; border-bottom: 1px solid var(--o-border-light);
}
.o-addresses-table tr:hover { background: var(--o-surface-hover); }

/* ═══ CHATTER SIDEBAR (right panel, Odoo-style) ═══ */
.o-chatter-sidebar {
    width: 380px; flex-shrink: 0;
    border-left: 1px solid var(--o-border);
    background: var(--o-surface);
    display: flex; flex-direction: column;
    height: calc(100vh - var(--o-navbar-h) - 60px);
    position: sticky; top: calc(var(--o-navbar-h) + 60px);
}
.o-chatter-tabs {
    display: flex; align-items: center; gap: 0;
    padding: 10px 14px 0; border-bottom: 1px solid var(--o-border-light);
    flex-shrink: 0;
}
.o-chatter-tab {
    padding: 8px 14px; border: 1px solid var(--o-border); border-bottom: none;
    border-radius: var(--o-radius) var(--o-radius) 0 0;
    background: var(--o-surface); cursor: pointer;
    font-size: .78rem; font-weight: 600; color: var(--o-text-muted);
    transition: all var(--o-transition); margin-right: -1px;
}
.o-chatter-tab:hover { color: var(--o-text); }
.o-chatter-tab.active {
    background: var(--o-brand-primary); color: #fff; border-color: var(--o-brand-primary);
}
.o-chatter-tab.active-send {
    background: var(--o-brand-primary); color: #fff; border-color: var(--o-brand-primary);
}
.o-chatter-tab.active-note {
    background: var(--o-surface); color: var(--o-text); border-color: var(--o-border);
    font-weight: 600;
}
.o-chatter-icons {
    margin-left: auto; display: flex; gap: 8px; align-items: center;
    padding-bottom: 8px;
}
.o-chatter-icons button {
    background: none; border: none; color: var(--o-text-light); cursor: pointer;
    font-size: .9rem; padding: 4px; transition: color var(--o-transition);
}
.o-chatter-icons button:hover { color: var(--o-text); }
.o-chatter-icons .badge {
    position: relative; top: -6px; left: -4px;
    font-size: .55rem; background: var(--o-brand-primary); color: #fff;
    padding: 1px 4px; border-radius: 8px; font-weight: 700;
}
/* Compose area */
.o-chatter-compose {
    padding: 12px 14px; flex-shrink: 0;
    border-bottom: 1px solid var(--o-border-light);
    display: none;
}
.o-chatter-compose.open { display: block; }
.o-chatter-compose textarea {
    width: 100%; padding: 8px 12px; border: 1px solid var(--o-border);
    border-radius: var(--o-radius); font-size: .82rem; resize: none;
    outline: none; min-height: 70px; background: var(--o-surface); color: var(--o-text);
    font-family: var(--o-font);
}
.o-chatter-compose textarea:focus { border-color: var(--o-brand-primary); }
.o-chatter-compose-actions {
    display: flex; align-items: center; justify-content: space-between; margin-top: 8px;
}
.o-chatter-compose-actions .left { display: flex; gap: 6px; }
.o-chatter-compose-email-to {
    padding: 6px 0; font-size: .78rem; color: var(--o-text-muted);
}
.o-chatter-compose-email-to input {
    border: 1px solid var(--o-border); border-radius: 4px; padding: 4px 8px;
    font-size: .78rem; width: 200px; outline: none; margin-left: 4px;
    font-family: var(--o-font);
}
.o-chatter-compose-email-to input:focus { border-color: var(--o-brand-primary); }
/* Messages list */
.o-chatter-messages {
    flex: 1; overflow-y: auto; padding: 0 14px 14px;
}
.o-chatter-date-sep {
    text-align: center; padding: 16px 0 8px; font-size: .72rem;
    color: var(--o-text-light); position: relative;
}
.o-chatter-date-sep::before {
    content: ''; position: absolute; left: 0; right: 0; top: 50%;
    height: 1px; background: var(--o-border-light);
}
.o-chatter-date-sep span {
    background: var(--o-surface); padding: 0 10px; position: relative;
}
.o-chatter-msg {
    display: flex; gap: 10px; padding: 10px 0;
}
.o-chatter-msg-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .65rem; font-weight: 700; color: #fff; overflow: hidden;
}
.o-chatter-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.o-chatter-msg-body { flex: 1; min-width: 0; }
.o-chatter-msg-header {
    font-size: .78rem; margin-bottom: 3px;
}
.o-chatter-msg-header strong { color: var(--o-text); }
.o-chatter-msg-header time { color: var(--o-text-light); margin-left: 6px; font-size: .7rem; }
.o-chatter-msg-text {
    font-size: .82rem; color: var(--o-text-muted); line-height: 1.5;
    word-break: break-word;
}
.o-chatter-msg-text .change-arrow { color: var(--o-brand-primary); margin: 0 4px; }
.o-chatter-msg-text a { color: var(--o-brand-primary); }
.o-chatter-msg.system .o-chatter-msg-avatar { background: #5B5D6B; }
.o-chatter-msg.note { background: #FFFDE7; margin: 0 -14px; padding: 10px 14px; border-radius: var(--o-radius); }
.o-chatter-msg.email-msg .o-chatter-msg-text { color: var(--o-text); }
/* Empty chatter */
.o-chatter-empty {
    text-align: center; padding: 40px 20px; color: var(--o-text-light); font-size: .82rem;
}

/* Tag with X remove button (Odoo-style colored pills) */
.o-tag-removable {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: .72rem; font-weight: 600; padding: 3px 6px 3px 10px;
    border-radius: 20px; color: #fff; letter-spacing: .2px;
    cursor: default;
}
.o-tag-removable .tag-x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px; border-radius: 50%;
    background: rgba(255,255,255,.3); cursor: pointer; font-size: .6rem;
    transition: background var(--o-transition); line-height: 1;
}
.o-tag-removable .tag-x:hover { background: rgba(255,255,255,.5); }

/* ═══ MODAL ═══ */
.o-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn .15s ease; padding: 20px;
}
.o-modal {
    background: var(--o-surface); border-radius: var(--o-radius-lg);
    box-shadow: var(--o-shadow-lg); width: 100%; max-width: 540px;
    max-height: 90vh; overflow-y: auto;
    animation: modalIn .2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(.95); }
    to { opacity: 1; transform: scale(1); }
}
.o-modal-header {
    padding: 16px 20px; border-bottom: 1px solid var(--o-border);
    display: flex; align-items: center; justify-content: space-between;
}
.o-modal-header h3 { font-size: 1rem; font-weight: 600; }
.o-modal-close {
    background: none; border: none; font-size: 1.2rem; cursor: pointer;
    color: var(--o-text-muted); padding: 4px;
}
.o-modal-close:hover { color: var(--o-text); }
.o-modal-body { padding: 20px; }
.o-modal-footer {
    padding: 12px 20px; border-top: 1px solid var(--o-border);
    display: flex; justify-content: flex-end; gap: 8px;
}

/* Modal form fields */
.s-field {
    margin-bottom: 14px;
}
.s-label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--o-text-muted);
    margin-bottom: 4px;
}
.s-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--o-border);
    border-radius: var(--o-radius);
    font-size: .85rem;
    background: var(--o-bg);
    color: var(--o-text);
    transition: border-color .2s;
    box-sizing: border-box;
}
.s-input:focus {
    outline: none;
    border-color: var(--o-brand-primary);
}
select.s-input {
    appearance: auto;
}

/* ═══ TOAST ═══ */
.o-toast-container {
    position: fixed; bottom: 20px; right: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
}
.o-toast {
    background: var(--o-surface); border: 1px solid var(--o-border);
    border-radius: var(--o-radius-lg); padding: 12px 16px;
    box-shadow: var(--o-shadow-lg); font-size: .82rem;
    display: flex; align-items: center; gap: 10px;
    animation: toastIn .3s ease; min-width: 280px;
    border-left: 4px solid var(--o-success);
}
.o-toast.error { border-left-color: var(--o-danger); }
.o-toast.warning { border-left-color: var(--o-warning); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ═══ LOADING ═══ */
.o-loading {
    display: flex; align-items: center; justify-content: center;
    padding: 60px; color: var(--o-text-muted);
}
.o-spinner {
    width: 28px; height: 28px; border: 3px solid var(--o-border);
    border-top-color: var(--o-brand-primary); border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ EMPTY STATE ═══ */
.o-empty {
    text-align: center; padding: 60px 20px; color: var(--o-text-muted);
}
.o-empty i { font-size: 3rem; margin-bottom: 12px; color: var(--o-text-light); }
.o-empty h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; color: var(--o-text); }
.o-empty p { font-size: .85rem; }

/* ═══ APPS PAGE ═══ */
.o-apps-page {
    margin-top: var(--o-navbar-h); padding: 40px 20px;
    max-width: 900px; margin-left: auto; margin-right: auto;
}
.o-apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.o-app-card {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 20px; background: var(--o-surface);
    border: 1px solid var(--o-border); border-radius: var(--o-radius-lg);
    transition: all var(--o-transition); cursor: pointer; position: relative;
    text-decoration: none !important;
}
.o-app-card:hover { box-shadow: var(--o-shadow); transform: translateY(-2px); }
.o-app-card.disabled { opacity: .5; pointer-events: none; }
.o-app-card-icon {
    width: 48px; height: 48px; border-radius: var(--o-radius-lg);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.2rem; flex-shrink: 0;
}
.o-app-card-info h3 { font-size: .9rem; font-weight: 600; color: var(--o-text); margin-bottom: 2px; }
.o-app-card-info p { font-size: .75rem; color: var(--o-text-muted); }
.o-app-badge {
    position: absolute; top: 8px; right: 8px; font-size: .6rem;
    background: var(--o-warning); color: #fff; padding: 2px 6px; border-radius: 3px;
    font-weight: 600; text-transform: uppercase;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1200px) {
    .o-chatter-sidebar { width: 320px; }
}
@media (max-width: 1024px) {
    .o-form-grid { grid-template-columns: 1fr; }
    .o-form-group-col:first-child { border-right: none; padding: 0; }
    .o-form-group-col:last-child { padding: 0; }
    .o-kanban { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .o-form-view { flex-direction: column; }
    .o-chatter-sidebar {
        width: 100%; height: auto; position: static;
        border-left: none; border-top: 1px solid var(--o-border);
        max-height: 500px;
    }
}
@media (max-width: 768px) {
    .o-navbar-modules { display: none; }
    .o-navbar-search { width: 140px; }
    .o-navbar-search:focus { width: 180px; }
    .o-navbar-username { display: none; }
    .o-cp { padding: 8px 12px; }
    .o-cp-top { flex-direction: column; align-items: stretch; }
    .o-cp-right { justify-content: space-between; }
    .o-kanban { padding: 12px; grid-template-columns: 1fr 1fr; gap: 8px; }
    .o-list-wrap { padding: 0 8px 12px; overflow-x: auto; }
    .o-form-main { padding: 0 12px 24px; }
    .o-form-sheet { padding: 16px; }
    .o-form-header { flex-direction: column; align-items: center; text-align: center; }
    .o-form-label { width: auto; text-align: left; }
    .o-form-field { flex-direction: column; gap: 3px; }
    .o-app-drawer-panel { width: 100%; border-radius: 0; }
    .o-smart-buttons { display: none; }
}
@media (max-width: 480px) {
    .o-kanban { grid-template-columns: 1fr; }
    .o-kanban-card-w { min-width: 100%; }
    .o-form-avatar { width: 70px; height: 70px; font-size: 1.6rem; }
}

/* ═══ CRM PIPELINE ═══ */
.crm-pipeline {
    display: flex; gap: 12px; padding: 16px;
    overflow-x: auto; min-height: calc(100vh - var(--o-navbar-h) - 80px);
    align-items: flex-start;
}
.crm-stage {
    min-width: 280px; max-width: 300px; flex-shrink: 0;
    background: var(--o-surface-hover); border-radius: var(--o-radius-lg);
    display: flex; flex-direction: column; max-height: calc(100vh - var(--o-navbar-h) - 100px);
    transition: box-shadow .2s;
}
.crm-stage.drag-over {
    box-shadow: inset 0 0 0 2px var(--o-brand-primary);
}
.crm-stage-add {
    background: transparent; border: 2px dashed var(--o-border); opacity: .6;
    min-height: 60px; justify-content: center;
}
.crm-stage-add:hover { opacity: 1; }
.crm-stage-add .o-form-input { background: var(--o-surface); }
.crm-stage-header {
    padding: 12px 14px 8px; flex-shrink: 0;
    border-bottom: 1px solid var(--o-border-light);
}
.crm-stage-title {
    display: flex; align-items: center; gap: 6px;
}
.crm-stage-name {
    font-size: .85rem; font-weight: 700; color: var(--o-text);
}
.crm-stage-count {
    background: var(--o-border); color: var(--o-text-muted);
    font-size: .65rem; font-weight: 700; padding: 1px 6px;
    border-radius: 10px;
}
.crm-stage-revenue {
    font-size: .75rem; color: var(--o-text-muted); margin-top: 2px; font-weight: 500;
}
.crm-stage-cards {
    flex: 1; overflow-y: auto; padding: 8px 10px;
    display: flex; flex-direction: column; gap: 8px;
}
.crm-card {
    background: var(--o-surface); border: 1px solid var(--o-border);
    border-radius: var(--o-radius); padding: 10px 12px;
    cursor: pointer; transition: all var(--o-transition);
    border-left: 3px solid transparent;
}
.crm-card:hover { box-shadow: var(--o-shadow); transform: translateY(-1px); }
.crm-card.overdue { border-left-color: var(--o-danger); }
.crm-card[draggable="true"] { cursor: grab; }
.crm-card[draggable="true"]:active { cursor: grabbing; }
.crm-card-top {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 6px;
}
.crm-card-name {
    font-size: .82rem; font-weight: 600; color: var(--o-text);
    word-break: break-word; line-height: 1.3;
}
.crm-card-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px;
}
.crm-card-dot.dot-normal { background: #CCC; }
.crm-card-dot.dot-done { background: var(--o-success); }
.crm-card-dot.dot-blocked { background: var(--o-danger); }
.crm-card-revenue {
    font-size: .9rem; font-weight: 700; color: var(--o-text); margin: 4px 0 2px;
}
.crm-card-contact {
    font-size: .72rem; color: var(--o-text-muted);
    display: flex; align-items: center; gap: 4px;
}
.crm-card-contact i { font-size: .65rem; }
.crm-card-deadline {
    font-size: .7rem; color: var(--o-text-light);
    display: flex; align-items: center; gap: 4px; margin-top: 3px;
}
.crm-card-deadline.overdue { color: var(--o-danger); font-weight: 600; }
.crm-card-bottom {
    display: flex; justify-content: space-between; align-items: center; margin-top: 6px;
}
.crm-card-prio {
    font-size: .7rem; color: #E9AB17; letter-spacing: 1px;
}
.crm-card-avatar {
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .55rem; font-weight: 700; color: #fff;
}
.crm-card-tags {
    display: flex; flex-wrap: wrap; gap: 2px; margin-top: 6px;
}
.crm-card-tags .o-tag { font-size: .58rem; padding: 1px 5px; }
.crm-add-btn {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    padding: 8px; margin: 4px 10px 10px;
    background: none; border: 1px dashed var(--o-border); border-radius: var(--o-radius);
    color: var(--o-text-light); cursor: pointer; font-size: .78rem;
    transition: all var(--o-transition);
}
.crm-add-btn:hover { border-color: var(--o-brand-primary); color: var(--o-brand-primary); background: rgba(113,75,103,.05); }
.crm-quick-add {
    padding: 8px; background: var(--o-surface); border: 1px solid var(--o-border);
    border-radius: var(--o-radius); margin: 0 0 4px;
}
.crm-quick-add .o-form-input { font-size: .82rem; padding: 5px 8px; border: 1px solid var(--o-border); background: var(--o-surface); }

@media (max-width: 768px) {
    .crm-pipeline { padding: 8px; gap: 8px; }
    .crm-stage { min-width: 240px; }
}

/* ═══ UTILITY ═══ */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.text-muted { color: var(--o-text-muted); }
.text-sm { font-size: .78rem; }
.fw-600 { font-weight: 600; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-1 { gap: 4px; }
.hidden { display: none !important; }

/* Drop zone for file upload */
.wiki-drop-zone {
    border: 2px dashed var(--o-border);
    border-radius: var(--o-radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    margin-top: 8px;
}
.wiki-drop-zone:hover, .wiki-drop-zone.dragover {
    border-color: var(--o-brand-primary);
    background: rgba(113, 75, 103, .05);
}

/* Kanban quick-add button */
.o-kanban-quick-add {
    padding: 10px 12px;
    text-align: center;
    font-size: .78rem;
    color: var(--o-text-light);
    cursor: pointer;
    border: 1px dashed var(--o-border);
    border-radius: var(--o-radius);
    transition: all .2s;
    margin: 4px 0;
}
.o-kanban-quick-add:hover {
    border-color: var(--o-brand-primary);
    color: var(--o-brand-primary);
    background: rgba(113, 75, 103, .05);
}
/* Pipeline drag-over */
/* Pipeline / Kanban Board */
.o-pipeline {
    display: flex;
    gap: 12px;
    padding: 0 16px 16px;
    overflow-x: auto;
    min-height: calc(100vh - 180px);
    align-items: flex-start;
}
.o-pipeline-column {
    flex: 1;
    min-width: 240px;
    max-width: 360px;
    background: var(--o-surface);
    border-radius: var(--o-radius-lg);
    border: 1px solid var(--o-border-light);
    display: flex;
    flex-direction: column;
}
.o-pipeline-header {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--o-radius-lg) var(--o-radius-lg) 0 0;
}
.o-pipeline-title {
    font-size: .82rem;
    font-weight: 700;
    color: var(--o-text);
}
.o-pipeline-count {
    font-size: .68rem;
    font-weight: 600;
    background: var(--o-border);
    color: var(--o-text-muted);
    padding: 1px 7px;
    border-radius: 10px;
}
.o-pipeline-cards {
    padding: 6px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 60px;
    flex: 1;
}
.o-pipeline-column.drag-over {
    background: rgba(113, 75, 103, .06);
}
.o-pipeline-column.drag-over .o-pipeline-cards {
    min-height: 120px;
}
.o-pipeline-cards .o-kanban-card {
    padding: 10px 12px;
    cursor: pointer;
}
.o-kanban-card-title {
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--o-text);
}

/* ─── Task Module Styles ─── */
.task-desc-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    border: 1px solid var(--o-border);
    border-bottom: none;
    border-radius: var(--o-radius) var(--o-radius) 0 0;
    background: var(--o-surface-hover);
}
.task-desc-toolbar button {
    background: none;
    border: none;
    padding: 4px 7px;
    border-radius: 3px;
    cursor: pointer;
    color: var(--o-text-muted);
    font-size: .75rem;
}
.task-desc-toolbar button:hover {
    background: var(--o-surface);
    color: var(--o-text);
}
.task-desc-editor {
    border: 1px solid var(--o-border);
    border-radius: 0 0 var(--o-radius) var(--o-radius);
    padding: 12px 14px;
    min-height: 120px;
    font-size: .85rem;
    line-height: 1.6;
    outline: none;
    color: var(--o-text);
    background: var(--o-bg);
    overflow-y: auto;
    max-height: 300px;
}
.task-desc-editor:focus {
    border-color: var(--o-brand-primary);
}
.task-desc-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--o-text-light);
    font-style: italic;
}
.task-desc-editor h3 { font-size: 1rem; margin: 10px 0 4px; }
.task-desc-editor ul, .task-desc-editor ol { padding-left: 20px; margin: 6px 0; }
.task-desc-editor pre { background: #1E1E2E; color: #CDD6F4; padding: 10px; border-radius: var(--o-radius); margin: 8px 0; font-size: .8rem; }
.task-desc-editor code { background: var(--o-surface-hover); padding: 1px 5px; border-radius: 3px; font-size: .8rem; }
.task-desc-editor pre code { background: none; padding: 0; }
.task-desc-editor a { color: var(--o-brand-primary); }

/* Better pipeline cards */
.o-pipeline-cards .o-kanban-card {
    background: var(--o-bg);
    border: 1px solid var(--o-border-light);
    border-radius: var(--o-radius);
    padding: 10px 12px;
    cursor: pointer;
    transition: box-shadow .15s, transform .1s;
}
.o-pipeline-cards .o-kanban-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    transform: translateY(-1px);
}
.o-pipeline-cards .o-kanban-card[draggable="true"] {
    cursor: grab;
}
.o-pipeline-cards .o-kanban-card[draggable="true"]:active {
    cursor: grabbing;
    opacity: .7;
}

/* Task form polish */
.task-stage-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.task-stage-pill {
    padding: 4px 14px;
    border-radius: 16px;
    font-size: .72rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--o-border);
    color: var(--o-text-light);
    transition: all .15s;
}
.task-stage-pill:hover { opacity: .85; }
.task-stage-pill.active { box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.task-title-input {
    border: none;
    outline: none;
    font-size: 1.4rem;
    font-weight: 700;
    width: 100%;
    background: transparent;
    color: var(--o-text);
    padding: 8px 0 16px;
    border-bottom: 2px solid transparent;
    transition: border-color .2s;
}
.task-title-input:focus {
    border-bottom-color: var(--o-brand-primary);
}
.task-title-input::placeholder {
    color: var(--o-text-light);
    font-weight: 400;
}

/* Sub-nav (tasks, accounting) */
.o-sub-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 10px;
    gap: 8px;
    flex-wrap: wrap;
}
.o-sub-nav-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.o-sub-nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
}
.o-filter-count {
    font-size: .62rem;
    opacity: .7;
    margin-left: 2px;
}
.o-mini-select {
    border: 1px solid var(--o-border);
    border-radius: var(--o-radius);
    padding: 4px 8px;
    font-size: .75rem;
    background: var(--o-surface);
    color: var(--o-text);
    cursor: pointer;
}
.o-mini-select:focus {
    border-color: var(--o-brand-primary);
    outline: none;
}

/* ─── Stat Cards (Helpdesk Dashboard) ─── */
.o-stat-card {
    background: var(--o-surface);
    border: 1px solid var(--o-border);
    border-radius: var(--o-radius-lg);
    padding: 20px;
    text-align: center;
    transition: all .15s;
}
.o-stat-card:hover {
    border-color: var(--o-brand-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* ═══ R29: DATA-TABLE (standardisierte Tabelle) ═══ */
.o-data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.o-data-table thead th {
    background: var(--o-surface-hover); padding: 8px 12px; text-align: left;
    font-weight: 600; font-size: .74rem; color: var(--o-text-muted);
    text-transform: uppercase; letter-spacing: .3px;
    border-bottom: 1px solid var(--o-border);
}
.o-data-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--o-border-light); }
.o-data-table tbody tr.clickable { cursor: pointer; }
.o-data-table tbody tr.clickable:hover { background: var(--o-surface-hover); }
.o-data-table tbody tr.selected { background: var(--o-surface-hover); }

/* ═══ R29: BADGES (semantic, dark-mode safe) ═══ */
.o-badge-solid, .o-badge-soft {
    display: inline-block; padding: 2px 10px; border-radius: 10px;
    font-size: .72rem; font-weight: 600; line-height: 1.4; white-space: nowrap;
}
.o-badge-solid           { color: #fff; background: #6C757D; }
.o-badge-solid.success   { background: #2E7D32; }
.o-badge-solid.danger    { background: #C62828; }
.o-badge-solid.warning   { background: #E65100; }
.o-badge-solid.info      { background: #1565C0; }
.o-badge-solid.muted     { background: #6C757D; }
.o-badge-solid.brand     { background: #4A6FA5; }
.o-badge-soft            { background: #F0F0F3; color: #6C757D; }
.o-badge-soft.success    { background: #E8F5E9; color: #2E7D32; }
.o-badge-soft.danger     { background: #FFEBEE; color: #C62828; }
.o-badge-soft.warning    { background: #FFF3E0; color: #E65100; }
.o-badge-soft.info       { background: #E3F2FD; color: #1565C0; }
.o-badge-soft.muted      { background: #F0F0F3; color: #6C757D; }
.o-badge-soft.brand      { background: #E2EBF7; color: #4A6FA5; }
html.dark-mode .o-badge-soft           { background: rgba(108,117,125,.2); color: #9A9A9A; }
html.dark-mode .o-badge-soft.success   { background: rgba(46,125,50,.22); color: #81C784; }
html.dark-mode .o-badge-soft.danger    { background: rgba(198,40,40,.22); color: #E57373; }
html.dark-mode .o-badge-soft.warning   { background: rgba(230,81,0,.22); color: #FFB74D; }
html.dark-mode .o-badge-soft.info      { background: rgba(21,101,192,.22); color: #64B5F6; }
html.dark-mode .o-badge-soft.muted     { background: rgba(108,117,125,.2); color: #9A9A9A; }
html.dark-mode .o-badge-soft.brand     { background: rgba(74,111,165,.28); color: #90B5E0; }


/* ═══ R34.2: Mail-Chatter Styles ═══ */
.r34-msg.outbound { background: rgba(74,111,165,.03); }
html.dark-mode .r34-msg.outbound { background: rgba(74,111,165,.08); }
.r34-msg.inbound { background: rgba(46,125,50,.03); }
html.dark-mode .r34-msg.inbound { background: rgba(46,125,50,.08); }
.r34-msg:hover { background: var(--o-surface-hover); }
.r34-compose input.s-input { width: 100%; box-sizing: border-box; }
.r34-compose textarea { resize: vertical; }

/* ═══ R90-F: Universal Toggle Switch ═══ */
.o-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px 0;
    -webkit-user-select: none;
    user-select: none;
}

.o-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.o-toggle-slider {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--o-border);
    border-radius: 22px;
    transition: background .2s ease;
    flex-shrink: 0;
}

.o-toggle-slider::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.o-toggle input[type="checkbox"]:checked + .o-toggle-slider {
    background: var(--o-success);
}

.o-toggle input[type="checkbox"]:checked + .o-toggle-slider::before {
    transform: translateX(18px);
}

.o-toggle input[type="checkbox"]:focus-visible + .o-toggle-slider {
    box-shadow: 0 0 0 3px rgba(0, 160, 157, .25);
}

.o-toggle input[type="checkbox"]:disabled + .o-toggle-slider {
    opacity: .45;
    cursor: not-allowed;
}

.o-toggle.is-disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}

.o-toggle-label {
    flex: 1;
    line-height: 1.45;
}

.o-toggle-label strong {
    font-weight: 600;
    color: var(--o-text);
}

.o-toggle-label .o-toggle-hint {
    display: block;
    font-size: .82rem;
    color: var(--o-text-muted);
    margin-top: 2px;
}

.o-toggle-nested {
    margin-left: 52px;
    margin-top: 4px;
}
