/* ============================================
   Odoo-Style CSS — POS v2
   ============================================ */
:root {
    --o-primary: #714B67;
    --o-primary-dark: #5A3B52;
    --o-primary-light: #875A7B;
    --o-secondary: #00A09D;
    --o-secondary-dark: #007E7C;
    --o-success: #28A745;
    --o-danger: #DC3545;
    --o-warning: #F0AD4E;
    --o-info: #17A2B8;
    --o-bg: #F9F9F9;
    --o-surface: #FFFFFF;
    --o-surface-2: #F5F5F5;
    --o-border: #DEE2E6;
    --o-border-light: #EFEFEF;
    --o-text: #212529;
    --o-text-muted: #6C757D;
    --o-text-soft: #ADB5BD;
    --o-radius: 6px;
    --o-radius-lg: 10px;
    --o-shadow-sm: 0 1px 2px rgba(0,0,0,.06);
    --o-shadow: 0 2px 8px rgba(0,0,0,.08);
    --o-shadow-lg: 0 8px 24px rgba(0,0,0,.12);
    --o-transition: all .18s ease;
}
[data-theme="dark"] {
    --o-bg: #1A1A1A;
    --o-surface: #252525;
    --o-surface-2: #2E2E2E;
    --o-border: #3A3A3A;
    --o-border-light: #2F2F2F;
    --o-text: #E8E8E8;
    --o-text-muted: #A0A0A0;
    --o-shadow: 0 2px 8px rgba(0,0,0,.4);
}
* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px; line-height: 1.5; color: var(--o-text);
    background: var(--o-bg);
    -webkit-font-smoothing: antialiased;
}
.o-layout { display: flex; min-height: 100vh; }
.o-sidebar {
    width: 240px; background: #2B2B2B; color: #E8E8E8;
    display: flex; flex-direction: column; flex-shrink: 0;
    transition: width .25s ease;
}
[data-theme="dark"] .o-sidebar { background: #1A1A1A; }
.o-brand {
    padding: 18px 16px; background: var(--o-primary);
    display: flex; align-items: center; gap: 12px;
}
.o-brand-logo {
    width: 32px; height: 32px; background: rgba(255,255,255,.15);
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.o-brand-text { display: flex; flex-direction: column; }
.o-brand-text strong { font-size: 14px; color: #fff; }
.o-brand-text small { font-size: 11px; color: rgba(255,255,255,.7); }
.o-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.o-nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 18px; color: #C9C9C9; text-decoration: none;
    border-left: 3px solid transparent; transition: var(--o-transition);
    font-size: 14px;
}
.o-nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.o-nav-item.active {
    background: rgba(113,75,103,.28); color: #fff;
    border-left-color: var(--o-primary-light); font-weight: 500;
}
.o-nav-icon { font-size: 16px; width: 20px; text-align: center; }
.o-sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.o-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.o-topbar {
    height: 56px; background: var(--o-surface);
    border-bottom: 1px solid var(--o-border);
    display: flex; align-items: center; padding: 0 20px; gap: 16px;
    box-shadow: var(--o-shadow-sm); position: sticky; top: 0; z-index: 100;
}
.o-topbar-title { font-size: 17px; font-weight: 600; margin: 0; flex-shrink: 0; color: var(--o-text); }
.o-topbar-search { flex: 1; max-width: 380px; }
.o-topbar-search input {
    width: 100%; padding: 7px 12px 7px 32px;
    border: 1px solid var(--o-border); border-radius: var(--o-radius);
    background: var(--o-surface-2) url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\' width=\'14\' height=\'14\' viewBox=\'0 0 24 24\' fill=\'none\' stroke=\'%236C757D\' stroke-width=\'2\'><circle cx=\'11\' cy=\'11\' r=\'8\'/><path d=\'m21 21-4.3-4.3\'/></svg>") no-repeat 10px center;
    font-size: 13px; color: var(--o-text); transition: var(--o-transition);
}
.o-topbar-search input:focus {
    outline: none; border-color: var(--o-primary);
    box-shadow: 0 0 0 3px rgba(113,75,103,.12); background-color: var(--o-surface);
}
.o-topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.o-menu-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--o-text); padding: 4px 8px; }
.o-user { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 20px; cursor: pointer; transition: var(--o-transition); }
.o-user:hover { background: var(--o-surface-2); }
.o-avatar {
    width: 30px; height: 30px; background: var(--o-primary); color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 13px;
}
.o-user-name { font-size: 13px; color: var(--o-text); }
.o-content { padding: 20px; flex: 1; overflow-x: hidden; }
.o-card {
    background: var(--o-surface); border: 1px solid var(--o-border);
    border-radius: var(--o-radius-lg); box-shadow: var(--o-shadow-sm);
    padding: 20px; margin-bottom: 20px; transition: var(--o-transition);
}
.o-card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--o-border-light);
}
.o-card-title {
    margin: 0; font-size: 16px; font-weight: 600; color: var(--o-text);
    display: flex; align-items: center; gap: 8px;
}
.o-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px; border: 1px solid transparent; border-radius: var(--o-radius);
    font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer;
    transition: var(--o-transition); text-decoration: none; white-space: nowrap;
}
.o-btn:disabled { opacity: .5; cursor: not-allowed; }
.o-btn-sm { padding: 5px 10px; font-size: 12px; }
.o-btn-lg { padding: 12px 22px; font-size: 15px; }
.o-btn-primary { background: var(--o-primary); color: #fff; }
.o-btn-primary:hover:not(:disabled) { background: var(--o-primary-dark); }
.o-btn-success { background: var(--o-secondary); color: #fff; }
.o-btn-success:hover:not(:disabled) { background: var(--o-secondary-dark); }
.o-btn-danger { background: var(--o-danger); color: #fff; }
.o-btn-warning { background: var(--o-warning); color: #fff; }
.o-btn-ghost { background: transparent; border-color: var(--o-border); color: var(--o-text); }
.o-btn-ghost:hover:not(:disabled) { background: var(--o-surface-2); }
.o-input, .o-select {
    width: 100%; padding: 8px 12px;
    border: 1px solid var(--o-border); border-radius: var(--o-radius);
    background: var(--o-surface); font-size: 13px; font-family: inherit;
    color: var(--o-text); transition: var(--o-transition);
}
.o-input:focus, .o-select:focus {
    outline: none; border-color: var(--o-primary);
    box-shadow: 0 0 0 3px rgba(113,75,103,.12);
}
.o-input:disabled { background: var(--o-surface-2); cursor: not-allowed; }
.o-label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--o-text-muted); margin-bottom: 4px;
    text-transform: uppercase; letter-spacing: .3px;
}
.o-field { margin-bottom: 14px; }
.o-checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; user-select: none; }
.o-checkbox input { width: 16px; height: 16px; cursor: pointer; }
.o-table-wrap {
    border: 1px solid var(--o-border); border-radius: var(--o-radius);
    overflow: hidden; background: var(--o-surface);
}
.o-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.o-table th {
    background: var(--o-surface-2); color: var(--o-text-muted);
    text-align: left; padding: 10px 12px; font-weight: 600;
    font-size: 12px; text-transform: uppercase; letter-spacing: .3px;
    border-bottom: 1px solid var(--o-border); position: sticky; top: 0; z-index: 1;
}
.o-table td { padding: 10px 12px; border-bottom: 1px solid var(--o-border-light); color: var(--o-text); }
.o-table tbody tr { transition: background .1s; }
.o-table tbody tr:hover { background: var(--o-surface-2); }
.o-table tbody tr:last-child td { border-bottom: none; }
.o-table .text-right { text-align: right; }
.o-table .text-center { text-align: center; }
.o-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.o-kpi {
    background: var(--o-surface); border: 1px solid var(--o-border);
    border-radius: var(--o-radius-lg); padding: 18px 20px;
    position: relative; overflow: hidden;
}
.o-kpi::before { content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--o-primary); }
.o-kpi.kpi-success::before { background: var(--o-secondary); }
.o-kpi.kpi-danger::before { background: var(--o-danger); }
.o-kpi.kpi-warning::before { background: var(--o-warning); }
.o-kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--o-text-muted); font-weight: 600; margin-bottom: 6px; }
.o-kpi-value { font-size: 24px; font-weight: 700; color: var(--o-text); line-height: 1.1; }
.o-kpi-value.kpi-primary { color: var(--o-primary); }
.o-kpi-value.kpi-success { color: var(--o-secondary); }
.o-kpi-value.kpi-danger { color: var(--o-danger); }
.o-badge {
    display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 600;
    border-radius: 10px; text-transform: uppercase; letter-spacing: .3px;
}
.o-badge-success { background: rgba(0,160,157,.12); color: var(--o-secondary-dark); }
.o-badge-danger { background: rgba(220,53,69,.12); color: var(--o-danger); }
.o-badge-warning { background: rgba(240,173,78,.15); color: #B37A1E; }
.o-badge-info { background: rgba(23,162,184,.12); color: var(--o-info); }
.o-badge-muted { background: var(--o-surface-2); color: var(--o-text-muted); }
.o-toasts {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.o-toast {
    background: var(--o-surface); border-left: 4px solid var(--o-primary);
    border-radius: var(--o-radius); box-shadow: var(--o-shadow-lg);
    padding: 12px 16px; min-width: 260px; max-width: 380px;
    font-size: 13px; color: var(--o-text); pointer-events: auto;
    animation: o-toast-in .25s ease;
    display: flex; align-items: center; gap: 10px;
}
.o-toast.toast-success { border-left-color: var(--o-success); }
.o-toast.toast-danger { border-left-color: var(--o-danger); }
.o-toast.toast-warning { border-left-color: var(--o-warning); }
.o-toast.toast-info { border-left-color: var(--o-info); }
@keyframes o-toast-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.o-toast.out { animation: o-toast-out .25s ease forwards; }
@keyframes o-toast-out { to { transform: translateX(100%); opacity: 0; } }
.o-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 9000; padding: 20px; animation: o-fade-in .15s ease;
}
@keyframes o-fade-in { from { opacity: 0; } to { opacity: 1; } }
.o-modal {
    background: var(--o-surface); border-radius: var(--o-radius-lg);
    box-shadow: var(--o-shadow-lg); width: 100%; max-width: 520px;
    max-height: 90vh; display: flex; flex-direction: column;
    overflow: hidden; animation: o-modal-in .2s ease;
}
@keyframes o-modal-in { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.o-modal-header {
    padding: 16px 20px; border-bottom: 1px solid var(--o-border-light);
    display: flex; align-items: center; justify-content: space-between;
}
.o-modal-title { margin: 0; font-size: 15px; font-weight: 600; }
.o-modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--o-text-muted); padding: 2px 6px; border-radius: 4px; transition: var(--o-transition); }
.o-modal-close:hover { background: var(--o-surface-2); color: var(--o-text); }
.o-modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.o-modal-footer { padding: 14px 20px; border-top: 1px solid var(--o-border-light); display: flex; justify-content: flex-end; gap: 8px; background: var(--o-surface-2); }
.o-breadcrumb { font-size: 12px; color: var(--o-text-muted); margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.o-breadcrumb a { color: var(--o-text-muted); text-decoration: none; }
.o-breadcrumb a:hover { color: var(--o-primary); }
.o-breadcrumb .sep { color: var(--o-text-soft); }
.o-breadcrumb .current { color: var(--o-text); font-weight: 500; }
.o-grid { display: grid; gap: 16px; }
.o-grid-2 { grid-template-columns: 1fr 1fr; }
.o-flex { display: flex; gap: 10px; align-items: center; }
.o-flex-between { justify-content: space-between; }
.o-mt-1 { margin-top: 8px; } .o-mt-2 { margin-top: 16px; }
.o-mb-1 { margin-bottom: 8px; } .o-mb-2 { margin-bottom: 16px; }
.o-text-muted { color: var(--o-text-muted); }
.o-empty { text-align: center; padding: 40px 20px; color: var(--o-text-muted); font-size: 13px; }
.o-empty-icon { font-size: 40px; display: block; margin-bottom: 10px; opacity: .4; }
.o-spinner {
    display: inline-block; width: 12px; height: 12px;
    border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
    border-radius: 50%; animation: o-spin .6s linear infinite;
}
@keyframes o-spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) { .o-grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
    .o-sidebar { position: fixed; top: 0; left: 0; height: 100vh; z-index: 2000; transform: translateX(-100%); transition: transform .25s ease; }
    .o-sidebar.open { transform: translateX(0); box-shadow: var(--o-shadow-lg); }
    .o-menu-toggle { display: block; }
    .o-topbar-search { display: none; }
    .o-content { padding: 12px; }
    .o-user-name { display: none; }
    .o-kpi-value { font-size: 20px; }
}
@media print {
    .o-sidebar, .o-topbar, .o-btn, .o-toasts { display: none !important; }
    .o-content { padding: 0; }
    .o-card { box-shadow: none; border: none; padding: 0; margin: 0; }
    body { background: white; }
}
