/**
 * =========================================================
 * OZPro ERP - Design System Premium
 * =========================================================
 * Tema escuro profissional com variáveis CSS
 * =========================================================
 */

/* ─── Google Fonts ────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── CSS Custom Properties ──────────────────────────── */
:root {
    /* Cores base - Linear/Vercel Obsidian SaaS */
    --bg-primary: #090d16;
    --bg-secondary: #0f1422;
    --bg-card: #121827;
    --bg-card-hover: #161e31;
    --bg-surface: #171f33;
    --bg-input: #0c101a;
    --bg-modal: #111726;

    /* Bordas */
    --border-color: rgba(255,255,255,0.08);
    --border-hover: rgba(255,255,255,0.16);
    --border-focus: var(--accent, #6366f1);

    /* Texto */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-heading: #ffffff;

    /* Cores de destaque */
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-muted: rgba(99,102,241,0.15);
    --accent-glow: rgba(99,102,241,0.3);

    /* Status */
    --success: #10b981;
    --success-bg: rgba(16,185,129,0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245,158,11,0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239,68,68,0.12);
    --info: #3b82f6;
    --info-bg: rgba(59,130,246,0.12);

    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, var(--accent, #6366f1) 0%, var(--accent-hover, #4f46e5) 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-card: linear-gradient(180deg, rgba(255,255,255,0.035) 0%, rgba(255,255,255,0) 60%), #121827;
    --gradient-sidebar: linear-gradient(180deg, rgba(18,24,39,0.94) 0%, rgba(10,13,22,0.96) 100%);

    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.35), 0 1px 3px rgba(0,0,0,0.15);
    --shadow-md: 0 4px 14px -2px rgba(0,0,0,0.45), 0 2px 6px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 22px 50px -15px rgba(0,0,0,0.75), 0 0 0 1px rgba(255,255,255,0.06);
    --shadow-glow: 0 0 24px var(--accent-glow, rgba(99,102,241,0.25));

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 78px;
    --header-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    /* Tipografia */
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Transições */
    --transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: all 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Tema Claro (Stripe Clean Porcelain) ─────────────────────────────────────── */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #fbfcfe;
    --bg-surface: #f1f5f9;
    --bg-input: #ffffff;
    --bg-modal: #ffffff;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-heading: #020617;
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.03);
    --shadow-md: 0 4px 14px -2px rgba(15,23,42,0.06), 0 2px 6px -1px rgba(15,23,42,0.04);
    --shadow-lg: 0 24px 50px -15px rgba(15,23,42,0.12), 0 0 0 1px rgba(15,23,42,0.05);
    --gradient-card: #ffffff;
    --gradient-sidebar: linear-gradient(180deg, rgba(255,255,255,0.94) 0%, rgba(255,255,255,0.90) 100%);
}

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

html {
    font-size: 14px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #090d16;
    background-color: var(--bg-primary, #090d16);
    color-scheme: dark;
}

html[data-theme="light"] {
    background-color: #f8fafc;
    background-color: var(--bg-primary, #f8fafc);
    color-scheme: light;
}

body {
    font-family: var(--font-body);
    background-color: #090d16;
    background: var(--bg-primary, #090d16);
    color: var(--text-primary, #f8fafc);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    /* PWA fullscreen feel */
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html[data-theme="light"] body {
    background-color: #f8fafc;
    background: var(--bg-primary, #f8fafc);
    color: var(--text-primary, #0f172a);
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

/* ─── Scrollbar Premium ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ─── Layout Principal ───────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ─── SIDEBAR ────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gradient-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition-slow);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

/* Sidebar backdrop shadow when open on desktop */
.sidebar:not(.collapsed) {
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}

.sidebar-brand {
    padding: 6px 14px;
    height: 56px;
    min-height: 56px;
    max-height: 56px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.sidebar-brand .brand-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md, 9px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
    overflow: hidden;
}

/* ── Sidebar Brand: sem background-image legada ── */
.sidebar-brand.has-logo,
.sidebar-brand {
    background-image: none !important;
}

.sidebar-brand .brand-logo-img,
.sidebar-brand #brandLogoImg {
    display: none !important;
}

/* Modo somente texto */
.sidebar-brand.text-only-mode {
    padding: 20px;
}

.sidebar-brand .brand-icon.no-bg {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0;
}

/* Elemento img oculto - não usado mais */
.sidebar-brand .brand-logo-img { display: none !important; }

.sidebar-brand .brand-text {
    white-space: nowrap;
    overflow: hidden;
    transition: var(--transition-slow);
}

.sidebar-brand .brand-text h1 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.sidebar-brand .brand-text span {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.sidebar.collapsed .brand-text { opacity: 0; width: 0; }

/* Menu */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.menu-section {
    padding: 8px 16px 4px;
    margin-top: 8px;
}

.menu-section-title {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .menu-section-title { opacity: 0; }

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin: 2px 8px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
}

.menu-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.menu-item.active {
    background: var(--accent-muted);
    color: var(--accent);
    font-weight: 600;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.menu-item i {
    width: 20px;
    font-size: 16px;
    text-align: center;
    flex-shrink: 0;
}

.menu-item .menu-text {
    overflow: hidden;
    transition: var(--transition-slow);
}

.sidebar.collapsed .menu-text { opacity: 0; width: 0; }

.menu-item .badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    background: var(--danger);
    color: #fff;
}

.menu-item .badge[style*="display:none"],
.menu-item .badge[style*="display: none"],
.menu-item .badge:empty,
#badgePedidos[style*="display:none"],
#badgePedidos[style*="display: none"],
.sidebar.collapsed .badge {
    display: none !important;
}

/* Sidebar Toggle */
.sidebar-toggle {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

.sidebar-toggle button {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle button:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

/* ─── MAIN CONTENT ───────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: var(--transition-slow);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* ─── HEADER ─────────────────────────────────────────── */
.header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 500;
    backdrop-filter: blur(12px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.3px;
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.header-breadcrumb span { color: var(--text-secondary); }

.header-search {
    position: relative;
    max-width: 360px;
    flex: 1;
    margin: 0 24px;
}

.header-search input {
    width: 100%;
    padding: 8px 16px 8px 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    transition: var(--transition);
}

.header-search input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.header-search input::placeholder { color: var(--text-muted); }

.header-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    z-index: 2;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-action {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 16px;
}

.header-action:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.header-action .notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 8px;
}

.header-avatar:hover { box-shadow: var(--shadow-glow); }

/* ─── PAGE CONTENT ───────────────────────────────────── */
.page-content {
    flex: 1;
    padding: 24px;
}

/* ─── CARDS ──────────────────────────────────────────── */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    border-color: color-mix(in srgb, var(--accent, #6366f1) 60%, var(--border-color, rgba(255, 255, 255, 0.22)));
    box-shadow: 0 10px 24px -4px rgba(0, 0, 0, 0.35), 0 0 0 1px color-mix(in srgb, var(--accent, #6366f1) 25%, transparent);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.2px;
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Stat Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: color-mix(in srgb, var(--accent, #6366f1) 60%, var(--border-color, rgba(255, 255, 255, 0.22)));
    transform: translateY(-2px);
    box-shadow: 0 10px 26px -4px rgba(0, 0, 0, 0.45), 0 0 0 1px color-mix(in srgb, var(--accent, #6366f1) 35%, transparent);
}

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

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 14px;
}

.stat-card .stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-card .stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-card .stat-icon.yellow { background: var(--warning-bg); color: var(--warning); }
.stat-card .stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-card .stat-icon.purple { background: var(--accent-muted); color: var(--accent); }

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.stat-card .stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: 6px;
}

.stat-change.up { background: var(--success-bg); color: var(--success); }
.stat-change.down { background: var(--danger-bg); color: var(--danger); }

/* ─── TABLES ─────────────────────────────────────────── */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
}

/* If table-container is inside a .card, don't double-border */
.card .table-container {
    border: none;
    border-radius: 0;
    background: transparent;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    padding: 14px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    background: var(--bg-surface);
}

.data-table thead th:first-child { padding-left: 24px; }
.data-table thead th:last-child { padding-right: 24px; }

.data-table tbody td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
}

.data-table tbody td:first-child { padding-left: 24px; }
.data-table tbody td:last-child { padding-right: 24px; }

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

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

/* Table inside card header titles */
.table-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.table-header h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Inline style h4 inside cards - override for consistency */
.card > h4, .table-container + h4, h4[style] {
    font-size: 14px;
    font-weight: 700;
}

/* ─── BUTTONS ────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 2px 10px var(--accent-glow, rgba(99,102,241,0.3));
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px var(--accent-glow, rgba(99,102,241,0.4));
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-success { background: var(--gradient-success); color: #fff; }
.btn-danger { background: var(--gradient-danger); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; }

/* ─── FORM ELEMENTS ──────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

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

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

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

/* Generic form elements inside form-group */
.form-group select,
.form-group textarea,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="datetime-local"],
.form-group input[type="url"],
.form-group input[type="search"],
.modal-body select,
.modal-body textarea,
.modal-body input[type="text"],
.modal-body input[type="email"],
.modal-body input[type="number"],
.modal-body input[type="tel"],
.modal-body input[type="date"],
.modal-body input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    transition: var(--transition);
}

/* Proteção Universal: Ícones dentro de inputs nunca sobrepõem o texto em formulários e modais */
.search-box input,
.toolbar-search input,
.header-search input,
.input-wrap:has(> i:not(.password-toggle i)) input,
.input-wrap > i:not(.password-toggle i) ~ input,
.uf-input-wrap:has(i.prefix-icon) input,
.uf-input-wrap:has(i.prefix-icon) .uf-input,
.uf-input-wrap i.prefix-icon ~ input,
.uf-input-wrap i.prefix-icon ~ .uf-input,
.uf-input-wrap:has(> i:not(.uf-btn-action i)) input,
.uf-input-wrap > i:not(.uf-btn-action i) ~ input,
.modal-body .search-box input,
.modal-body .toolbar-search input,
.modal-body .input-wrap:has(> i:not(.password-toggle i)) input,
.modal-body .input-wrap > i:not(.password-toggle i) ~ input,
.modal-body .uf-input-wrap:has(i.prefix-icon) input,
.modal-body .uf-input-wrap i.prefix-icon ~ input,
.modal .search-box input,
.modal .toolbar-search input,
.modal .input-wrap:has(> i:not(.password-toggle i)) input,
.modal .input-wrap > i:not(.password-toggle i) ~ input,
.modal .uf-input-wrap:has(i.prefix-icon) input,
.modal .uf-input-wrap i.prefix-icon ~ input {
    padding-left: 44px !important;
}

.search-box i,
.toolbar-search i,
.header-search i,
.input-wrap > i:not(.password-toggle i),
.uf-input-wrap i.prefix-icon {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
    z-index: 4 !important;
}

.form-group select:focus,
.form-group textarea:focus,
.form-group input:focus,
.modal-body select:focus,
.modal-body textarea:focus,
.modal-body input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.modal-body input::placeholder,
.modal-body textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    appearance: auto;
    cursor: pointer;
}

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

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

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

/* ─── BADGES & STATUS ────────────────────────────────── */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-active { background: var(--success-bg); color: var(--success); }
.badge-inactive { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.badge-pending { background: var(--warning-bg); color: var(--warning); }
.badge-cancelled { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }

.badge-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ─── MODAIS ─────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: transparent;
}

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ─── ALERTAS ────────────────────────────────────────── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

.alert-success { background: var(--success-bg); color: var(--success); border-left: 3px solid var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-left: 3px solid var(--warning); }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-left: 3px solid var(--danger); }
.alert-info { background: var(--info-bg); color: var(--info); border-left: 3px solid var(--info); }

/* ─── TOAST NOTIFICATIONS ────────────────────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 440px;
}

.toast {
    pointer-events: auto;
    padding: 12px 14px 12px 16px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    min-width: 280px;
    max-width: 440px;
    color: var(--text-primary, #fff);
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
    cursor: grab;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease, box-shadow 0.2s ease;
    animation: slideIn 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast:active {
    cursor: grabbing;
}
.toast-error {
    border-left: 4px solid var(--danger, #ef4444) !important;
}
.toast-success {
    border-left: 4px solid var(--success, #10b981) !important;
}
.toast-warning {
    border-left: 4px solid var(--warning, #f59e0b) !important;
}
.toast-info {
    border-left: 4px solid var(--info, #6366f1) !important;
}
.toast-badge {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 4px;
    flex-shrink: 0;
}
.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    font-size: 20px;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
    touch-action: manipulation;
}
.toast-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

html[data-theme="light"] .toast {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06) !important;
}
html[data-theme="light"] .toast .toast-msg {
    color: #0f172a !important;
}
html[data-theme="light"] .toast-badge {
    background: #f1f5f9 !important;
    color: #475569 !important;
}
html[data-theme="light"] .toast-close {
    color: #64748b !important;
}
html[data-theme="light"] .toast-close:hover {
    color: #0f172a !important;
    background: #f1f5f9 !important;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ─── SKELETON LOADING ───────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-card-hover) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 120px; }

/* ─── PAGINATION ─────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    font-size: 13px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-weight: 500;
    color: var(--text-muted);
}

.pagination-buttons {
    display: flex;
    gap: 4px;
}

.pagination-buttons button {
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.pagination-buttons button:hover {
    background: var(--bg-surface);
    border-color: var(--border-hover);
}

.pagination-buttons button.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ─── SEARCH & FILTERS ──────────────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.toolbar-search {
    position: relative;
    max-width: 320px;
    flex: 1;
}

.toolbar-search input {
    width: 100%;
    padding: 8px 14px 8px 38px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-body);
    transition: var(--transition);
}

.toolbar-search input:focus { outline: none; border-color: var(--border-focus); }
.toolbar-search input::placeholder { color: var(--text-muted); }

.toolbar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    z-index: 2;
}

/* ─── CHARTS AREA ────────────────────────────────────── */
.chart-container {
    position: relative;
    height: 300px;
    padding: 8px;
}

/* ─── EMPTY STATE ────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
    max-width: 400px;
    margin: 0 auto 20px;
}

/* ─── RESPONSIVE — TABLET / WINDOWS LAPTOP (1024px) ──── */
@media (max-width: 1024px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── RESPONSIVE — MOBILE (768px) ────────────────────── */
@media (max-width: 768px) {
    /* Sidebar hidden by default, slides in from left on mobile phones */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                    box-shadow 0.35s ease;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 8px 0 40px rgba(0,0,0,0.5);
    }
    .sidebar-toggle { display: none; }

    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }

    /* Mobile overlay with smooth transition */
    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.55);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: 999;
        display: none;
        opacity: 0;
        transition: opacity 0.35s ease;
    }
    .mobile-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Show mobile menu button */
    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Header adjustments */
    .header-search { max-width: 240px; }

    /* Modal full width */
    .modal { width: 95%; max-width: 95%; }

    /* Sidebar brand padding */
    .sidebar-brand {
        padding: 14px 16px;
    }
}

/* ─── RESPONSIVE — TABLET GRANDE (1000px) ───────────────── */
@media (max-width: 1000px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .stat-grid[style*="repeat(6,1fr)"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .stat-grid[style*="repeat(4,1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .header-search {
        max-width: 160px;
        flex: 1;
        min-width: 100px;
    }
    .card-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    .toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .toolbar-left {
        flex-wrap: wrap;
        gap: 6px;
    }
    .toolbar-right {
        flex-wrap: wrap;
        gap: 6px;
    }
}

/* ─── RESPONSIVE — TABLET MÉDIO (900px) ─────────────────── */
@media (max-width: 900px) {
    :root {
        --header-height: 54px;
    }
    .header {
        padding: 0 14px;
        gap: 8px;
    }
    .header-left h2 {
        font-size: 15px;
        max-width: 280px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header-search {
        max-width: 140px;
    }
    .header-action {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    .header-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    .stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .stat-grid[style*="repeat(6,1fr)"],
    .stat-grid[style*="repeat(4,1fr)"],
    .stat-grid[style*="repeat(3,1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .stat-card {
        padding: 12px 14px;
    }
    .stat-card .stat-icon {
        width: 34px;
        height: 34px;
        font-size: 14px;
        margin-bottom: 8px;
    }
    .stat-card .stat-value {
        font-size: 17px;
    }
    .stat-card .stat-label {
        font-size: 10px;
    }
    .card {
        padding: 14px;
        border-radius: 12px;
    }
    .card-header {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 12px;
    }
    .btn {
        min-height: 40px;
        touch-action: manipulation;
    }
    .form-grid {
        grid-template-columns: 1fr !important;
    }
    .form-row {
        grid-template-columns: 1fr !important;
    }
    .data-table td:last-child,
    .data-table th:last-child {
        position: sticky;
        right: 0;
        background: var(--bg-card);
        z-index: 1;
        box-shadow: -2px 0 6px rgba(0,0,0,0.1);
    }
    .data-table tbody tr:hover td:last-child {
        background: var(--bg-card-hover);
    }
}

/* ─── RESPONSIVE — MOBILE (768px) ────────────────────── */
@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }

    /* Header compact */
    .header {
        padding: 0 max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
        gap: 8px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.2);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
    .header-left {
        flex: 1;
        min-width: 0;
        gap: 10px;
    }
    .header-left h2 {
        font-size: 15px;
        max-width: 160px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header-breadcrumb { display: none; }
    .header-search { display: none; }
    .header-right {
        gap: 4px;
        flex-shrink: 0;
    }
    .header-action {
        width: 38px;
        height: 38px;
        font-size: 15px;
        min-height: 38px;
        touch-action: manipulation;
    }
    .header-avatar {
        width: 36px;
        height: 36px;
        font-size: 13px;
        min-height: 36px;
        margin-left: 4px;
        touch-action: manipulation;
    }

    /* Mobile menu button - larger touch target */
    .mobile-menu-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        font-size: 16px;
        touch-action: manipulation;
    }

    /* Page content tight padding */
    .page-content {
        padding: max(10px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-right));
        padding-top: 14px;
        padding-bottom: max(14px, env(safe-area-inset-bottom));
        overflow-x: clip;
    }

    /* Stat cards 2 columns */
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }
    .stat-card {
        padding: 14px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .stat-card .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
        margin-bottom: 0;
    }
    .stat-card .stat-value {
        font-size: 18px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        line-height: 1.2;
    }
    .stat-card .stat-label {
        font-size: 11px;
        line-height: 1.3;
    }
    .stat-card .stat-change {
        font-size: 10px;
        padding: 2px 6px;
        margin-top: 4px;
        white-space: nowrap;
    }

    /* Toolbar stacks vertically */
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 12px;
    }
    .toolbar-left {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    .toolbar-right {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }
    .toolbar-search { max-width: 100%; }
    .toolbar-select {
        min-width: auto;
        flex: 1;
        width: 100%;
        min-height: 42px;
        font-size: 16px;
    }

    /* Cards compact */
    .card {
        padding: 16px;
        border-radius: 12px;
    }
    .card-header {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 14px;
    }
    .card-title {
        font-size: 14px;
        flex: 1;
        min-width: 0;
    }

    /* Tables scroll horizontally */
    .table-container {
        border-radius: 12px;
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
    }
    .data-table {
        min-width: 560px;
        font-size: 12px;
    }
    .data-table thead th {
        padding: 10px 12px;
        font-size: 10px;
        white-space: nowrap;
    }
    .data-table thead th:first-child { padding-left: 14px; }
    .data-table thead th:last-child { padding-right: 14px; }
    .data-table tbody td {
        padding: 10px 12px;
        font-size: 12px;
    }
    .data-table tbody td:first-child { padding-left: 14px; }
    .data-table tbody td:last-child { padding-right: 14px; }

    /* Pagination compact */
    .pagination {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .pagination-info {
        font-size: 11px;
        width: 100%;
        text-align: center;
    }
    .pagination-buttons button,
    .pagination-btn {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        min-height: 32px;
        touch-action: manipulation;
    }

    /* Buttons compact with larger touch targets */
    .btn {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 42px;
        touch-action: manipulation;
    }
    .btn-sm {
        padding: 7px 12px;
        font-size: 11px;
        min-height: 32px;
    }
    .btn-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
        min-height: 36px;
    }

    /* Form grid single column */
    .form-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .form-control {
        font-size: 16px;
        min-height: 44px;
        touch-action: manipulation;
    }

    /* Modal full screen on mobile - bottom sheet */
    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 20px 20px 0 0;
        margin-top: auto;
        margin-bottom: 0;
    }
    .modal-header {
        padding: 16px 18px;
        position: relative;
    }
    .modal-header::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: rgba(255,255,255,0.2);
        border-radius: 4px;
        margin: 0 auto 12px;
    }
    .modal-header h3 { font-size: 15px; }
    .modal-body {
        padding: 18px;
        overflow-y: auto;
        max-height: 60vh;
        -webkit-overflow-scrolling: touch;
    }
    .modal-footer {
        padding: 12px 18px;
        gap: 8px;
    }
    .modal-footer .btn {
        flex: 1;
        justify-content: center;
        min-height: 46px;
    }

    /* Kanban scrolls horizontally */
    .kanban-board {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 12px;
        padding-bottom: 12px;
    }
    .kanban-col {
        min-width: 270px;
        max-width: 290px;
        scroll-snap-align: start;
        flex-shrink: 0;
    }

    /* Delivery grid single column */
    .delivery-grid { grid-template-columns: 1fr; gap: 12px; }
    .delivery-card { padding: 18px; }

    /* Caixa grid 2 columns */
    .caixa-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .caixa-payment-card { padding: 14px; }
    .caixa-payment-card .payment-value { font-size: 15px; }

    /* Two column to single */
    .two-col-grid { grid-template-columns: 1fr; }

    /* Report grid */
    .report-grid { grid-template-columns: 1fr; }

    /* Config grid */
    .config-grid { grid-template-columns: 1fr; }

    /* Motoboy grid */
    .motoboy-grid { grid-template-columns: 1fr; }

    /* Categorias grid 2 columns */
    .categorias-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .categoria-card { padding: 18px; }
    .categoria-icon { width: 48px; height: 48px; font-size: 22px; }

    /* Fluxo caixa */
    .fluxo-summary { grid-template-columns: 1fr; gap: 10px; }

    /* Search box full width */
    .search-box { max-width: 100%; }

    /* Badges smaller */
    .badge-status { font-size: 10px; padding: 3px 8px; }

    /* Safe areas for notch devices */
    .header {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
    .page-content {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    /* Smooth scrolling everywhere */
    .page-content,
    .kanban-board,
    .table-container,
    .sidebar-menu {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    /* Touch feedback nos botões e cards interativos */
    .btn, .btn-icon, .stat-card, .kanban-card, .menu-item,
    .header-action, .mobile-menu-btn, .cat-btn, .period-btn {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: default;
    }

    /* Active states for touch feedback */
    .btn:active { transform: scale(0.97); }
    .btn-icon:active { transform: scale(0.93); }
    .stat-card:active { transform: scale(0.98); }
    .kanban-card:active { transform: scale(0.98); }
    .menu-item:active { background: rgba(99,102,241,0.15); }
    .data-table tbody tr:active { background: rgba(99,102,241,0.06); }

    /* Bottom fixed bar for key actions (optional - used by specific pages) */
    .mobile-bottom-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px 16px;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        display: flex;
        gap: 10px;
        z-index: 800;
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
    .mobile-bottom-bar .btn { flex: 1; justify-content: center; }

    /* Hide scrollbars for cleaner look */
    .kanban-board::-webkit-scrollbar,
    .table-container::-webkit-scrollbar,
    .sidebar-menu::-webkit-scrollbar {
        display: none;
    }
    .kanban-board,
    .table-container,
    .sidebar-menu {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* ─── RESPONSIVE — SMALL MOBILE (480px) ──────────────── */
@media (max-width: 480px) {
    /* Stat cards single column-like layout */
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card {
        padding: 12px 14px;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    .stat-card .stat-icon { margin-bottom: 0; width: 38px; height: 38px; }
    .stat-card .stat-value { font-size: 16px; }
    .stat-card .stat-label { font-size: 10px; margin-top: 0; }

    /* Page content even tighter */
    .page-content { padding: 8px; }

    /* Caixa grid single column */
    .caixa-grid { grid-template-columns: 1fr; }

    /* Categorias single column */
    .categorias-grid { grid-template-columns: 1fr; }

    /* Kanban cards smaller */
    .kanban-col { min-width: 240px; }
    .kanban-card { padding: 12px; }
    .kanban-card-client { font-size: 13px; }
    .kanban-card-total { font-size: 14px; }

    /* Toolbar buttons stack */
    .toolbar-right {
        flex-direction: column;
    }
    .toolbar-right .btn { width: 100%; justify-content: center; }

    /* Product cell compact */
    .product-cell { gap: 8px; }
    .product-thumb { width: 30px; height: 30px; font-size: 10px; }

    /* Action buttons tighter */
    .actions-cell { gap: 4px; }
    .btn-icon { width: 30px; height: 30px; font-size: 12px; }
}

/* ─── RESPONSIVE — PWA-like touches ──────────────────── */
@media (max-width: 768px) {
    /* Safe areas for notch devices */
    .header {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
    .page-content {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }

    /* Smooth scrolling everywhere */
    .page-content,
    .kanban-board,
    .table-container,
    .sidebar-menu {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    /* Touch feedback nos botões e cards interativos */
    .btn, .btn-icon, .stat-card, .kanban-card, .menu-item,
    .header-action, .mobile-menu-btn, .cat-btn, .period-btn {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: default;
    }

    /* Active states for touch feedback */
    .btn:active { transform: scale(0.97); }
    .btn-icon:active { transform: scale(0.93); }
    .stat-card:active { transform: scale(0.98); }
    .kanban-card:active { transform: scale(0.98); }
    .menu-item:active { background: rgba(99,102,241,0.15); }
    .data-table tbody tr:active { background: rgba(99,102,241,0.06); }

    /* Prevent pull-to-refresh conflicts */
    /* 35.33 · sem overscroll "contain" no .page-content: no Android impedia a página de rolar */

    /* Bottom fixed bar for key actions (optional - used by specific pages) */
    .mobile-bottom-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px 16px;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
        background: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        display: flex;
        gap: 10px;
        z-index: 800;
        backdrop-filter: blur(12px);
    }
    .mobile-bottom-bar .btn { flex: 1; justify-content: center; }

    /* Hide scrollbars for cleaner look */
    .kanban-board::-webkit-scrollbar,
    .table-container::-webkit-scrollbar,
    .sidebar-menu::-webkit-scrollbar {
        display: none;
    }
    .kanban-board,
    .table-container,
    .sidebar-menu {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

/* ─── PDV SPECIFIC ───────────────────────────────────── */
.pdv-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 0;
    height: calc(100vh - var(--header-height));
}

.pdv-products {
    padding: 20px;
    overflow-y: auto;
}

.pdv-cart {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.pdv-cart-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.pdv-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.pdv-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: var(--transition);
}

.pdv-cart-item:hover { border-color: var(--border-hover); }

.pdv-cart-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

.pdv-total {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-heading);
    text-align: center;
    margin: 8px 0;
}

.pdv-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.pdv-product-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.pdv-product-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pdv-product-item .price {
    font-size: 16px;
    font-weight: 700;
    color: var(--success);
    margin-top: 8px;
}


/* ─── BADGE VARIANTS ─────────────────────────────────── */
.badge-success {
    background: rgba(16,185,129,0.12);
    color: #34d399;
}

.badge-danger {
    background: rgba(239,68,68,0.12);
    color: #f87171;
}

.badge-warning {
    background: rgba(245,158,11,0.12);
    color: #fbbf24;
}

/* ─── BTN OUTLINE ────────────────────────────────────── */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99,102,241,0.06);
}

/* ─── TOOLBAR RIGHT / SELECT ─────────────────────────── */
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-select {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    appearance: auto;
    min-width: 140px;
}

.toolbar-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

/* ─── SEARCH BOX ─────────────────────────────────────── */
.search-box {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.search-box input {
    width: 100%;
    padding: 8px 14px 8px 38px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
}

/* ─── STAT INFO (horizontal layout variant) ──────────── */
.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* When stat-card contains stat-info, make it horizontal */
.stat-card:has(.stat-info) {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card:has(.stat-info) .stat-icon {
    margin-bottom: 0;
}

.stat-info .stat-label {
    margin-top: 0;
    order: -1;
}

.stat-info .stat-value {
    font-size: 22px;
}

/* ─── FORM GRID ──────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-grid .form-group.full-width {
    grid-column: 1 / -1;
}

/* ─── PAGINATION CONTROLS & BUTTONS ──────────────────── */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.pagination-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99,102,241,0.06);
}

.pagination-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

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

/* ─── REPORT CARD (Relatórios) ───────────────────────── */
.report-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    cursor: pointer;
}

.report-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.report-card .report-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--accent-muted);
    color: var(--accent);
}

.report-card .report-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-heading);
}

.report-card .report-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ─── PERIOD BUTTONS (Dashboard) ─────────────────────── */
.period-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.period-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-surface);
}

.period-btn.active {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.16);
    color: #fff;
}

/* ─── MOBILE MENU BUTTON ─────────────────────────────── */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* ─── CONFIG SECTIONS ────────────────────────────────── */
.config-section {
    margin-bottom: 32px;
}

.config-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

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

.config-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.config-item .config-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.config-item .config-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-heading);
}

/* ─── TOGGLE SWITCH ──────────────────────────────────── */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 24px;
    cursor: pointer;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ─── MOTOBOY CARDS ──────────────────────────────────── */
.motoboy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.motoboy-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
}

.motoboy-card:hover {
    border-color: var(--border-hover);
}

.motoboy-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.motoboy-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.motoboy-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-heading);
}

.motoboy-phone {
    font-size: 12px;
    color: var(--text-muted);
}

.motoboy-stats {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.motoboy-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.motoboy-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.motoboy-stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading);
}

/* ─── AUDIT LOG ENTRIES ──────────────────────────────── */
.audit-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
}

.audit-action.create { background: rgba(16,185,129,0.12); color: #34d399; }
.audit-action.update { background: rgba(59,130,246,0.12); color: #60a5fa; }
.audit-action.delete { background: rgba(239,68,68,0.12); color: #f87171; }
.audit-action.login { background: rgba(139,92,246,0.12); color: #a78bfa; }
.audit-action.logout { background: rgba(245,158,11,0.12); color: #fbbf24; }

/* ─── FLUXO DE CAIXA ────────────────────────────────── */
.fluxo-chart-container {
    height: 300px;
    padding: 20px;
}

.fluxo-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.fluxo-summary-card {
    padding: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
}

.fluxo-summary-card .fluxo-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.fluxo-summary-card .fluxo-value {
    font-size: 22px;
    font-weight: 700;
}

.fluxo-value.positive { color: #34d399; }
.fluxo-value.negative { color: #f87171; }

/* ─── CONTAS A PAGAR/RECEBER ─────────────────────────── */
.conta-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
}

.conta-status.vencida { background: rgba(239,68,68,0.12); color: #f87171; }
.conta-status.hoje { background: rgba(245,158,11,0.12); color: #fbbf24; }
.conta-status.pendente { background: rgba(59,130,246,0.12); color: #60a5fa; }
.conta-status.paga { background: rgba(16,185,129,0.12); color: #34d399; }
.conta-status.recebida { background: rgba(16,185,129,0.12); color: #34d399; }

.btn-whatsapp {
    background: #25d366;
    border-color: #25d366;
    color: #fff;
}

.btn-whatsapp:hover {
    background: #20bd5a;
}

/* ─── CATEGORIAS GRID ────────────────────────────────── */
.categorias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.categoria-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.categoria-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.categoria-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 14px;
}

.categoria-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.categoria-count {
    font-size: 12px;
    color: var(--text-muted);
}

/* ─── KANBAN BOARD (Pedidos) ──────────────────────────── */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 500px;
}

.kanban-col {
    flex: 1;
    min-width: 260px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kanban-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    position: sticky;
    top: 0;
    z-index: 2;
}

.kanban-col-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-heading);
}

.kanban-col-title::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kanban-col:nth-child(1) .kanban-col-title::before { background: #6366f1; }
.kanban-col:nth-child(2) .kanban-col-title::before { background: #f59e0b; }
.kanban-col:nth-child(3) .kanban-col-title::before { background: #f97316; }
.kanban-col:nth-child(4) .kanban-col-title::before { background: #3b82f6; }
.kanban-col:nth-child(5) .kanban-col-title::before { background: #10b981; }

.kanban-count {
    background: rgba(255,255,255,0.08);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}

.kanban-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.kanban-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.kanban-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.kanban-card-id {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: #818cf8;
}

.kanban-card-time {
    font-size: 11px;
    color: var(--text-muted);
}

.kanban-card-client {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.kanban-card-items {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
}

.kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.kanban-card-total {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-heading);
}

.kanban-card-type {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.kanban-card-type.type-delivery {
    background: rgba(59,130,246,0.12);
    color: #60a5fa;
}

.kanban-card-type.type-pickup {
    background: rgba(16,185,129,0.12);
    color: #34d399;
}

.kanban-card-type.type-counter {
    background: rgba(139,92,246,0.12);
    color: #a78bfa;
}

.kanban-card-motoboy {
    font-size: 11px;
    color: #60a5fa;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ─── DELIVERY CARDS (Entregas) ──────────────────────── */
.delivery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
}

.delivery-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}

.delivery-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.delivery-card.status-rota {
    border-left: 3px solid #3b82f6;
}

.delivery-card.status-aguardando {
    border-left: 3px solid #f59e0b;
}

.delivery-status-trail {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 20px 0;
    position: relative;
}

.trail-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.trail-step::before,
.trail-step::after {
    display: none !important;
    content: none !important;
}

.trail-line {
    flex: 1;
    height: 2px;
    background: var(--border-color);
    min-width: 20px;
}

.trail-line.done {
    background: #10b981;
}

/* ─── CAIXA CARDS ────────────────────────────────────── */
.caixa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.caixa-payment-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}

.caixa-payment-card .payment-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 18px;
}

.caixa-payment-card .payment-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.caixa-payment-card .payment-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-heading);
}

.caixa-status-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.15);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.caixa-status-bar.closed {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.15);
}

/* ─── PRODUCT / CLIENT CELLS ─────────────────────────── */
.product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    line-height: 1.1;
}

.product-cell .product-info {
    display: flex;
    flex-direction: column;
}

.product-cell .product-name {
    font-weight: 600;
    color: var(--text-heading);
    font-size: 13px;
}

.product-cell .product-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* ─── ACTION CELLS ───────────────────────────────────── */
.actions-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
}

.btn-icon:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99,102,241,0.08);
}

.btn-icon.btn-whatsapp:hover {
    border-color: #25d366;
    color: #25d366;
    background: rgba(37,211,102,0.08);
}

.btn-icon.btn-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239,68,68,0.08);
}

/* ─── MOVIMENTAÇÕES BADGES ───────────────────────────── */
.mov-type {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
}

.mov-type.entrada { background: rgba(16,185,129,0.12); color: #34d399; }
.mov-type.saida { background: rgba(239,68,68,0.12); color: #f87171; }
.mov-type.ajuste { background: rgba(245,158,11,0.12); color: #fbbf24; }
.mov-type.perda { background: rgba(139,92,246,0.12); color: #a78bfa; }

.mov-qty { font-family: var(--font-mono); font-weight: 700; font-size: 13px; }
.mov-qty.positive { color: #34d399; }
.mov-qty.negative { color: #f87171; }

/* ─── ESTOQUE STATUS ─────────────────────────────────── */
.stock-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
}

.stock-status.normal { background: rgba(16,185,129,0.12); color: #34d399; }
.stock-status.baixo { background: rgba(245,158,11,0.12); color: #fbbf24; }
.stock-status.sem-estoque { background: rgba(239,68,68,0.12); color: #f87171; }

/* ─── COMPRAS STATUS ─────────────────────────────────── */
.compra-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
}

.compra-status.recebida { background: rgba(16,185,129,0.12); color: #34d399; }
.compra-status.pendente { background: rgba(245,158,11,0.12); color: #fbbf24; }
.compra-status.cancelada { background: rgba(239,68,68,0.12); color: #f87171; }

/* ─── CLIENTE/FORNECEDOR STATUS ──────────────────────── */
.client-status { font-size: 11px; font-weight: 600; }
.client-status.ativo { color: #34d399; }
.client-status.vip { color: #fbbf24; }
.client-status.inadimplente { color: #f87171; }
.client-status.inativo { color: var(--text-muted); }

/* ─── TWO COLUMN LAYOUT ─────────────────────────────── */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ─── TABLE CONTAINER ENHANCED ───────────────────────── */
.table-container .card {
    padding: 0;
}

.table-container .card .card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.table-container .card .data-table thead th:first-child,
.table-container .card .data-table tbody td:first-child {
    padding-left: 24px;
}

.table-container .card .data-table thead th:last-child,
.table-container .card .data-table tbody td:last-child {
    padding-right: 24px;
}

/* ─── RESPONSIVE OVERRIDES ───────────────────────────── */
/* ─── UTILITIES ──────────────────────────────────────── */
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.mono { font-family: var(--font-mono); }

/* =========================================================
   OZPro — BRANDING & LOGO UNIFICADO (Adaptive & Responsive)
   - Altura estrita de 56px padronizada
   - Sem duplicidade de logo (background-image: none)
   - Suporte perfeito para logos horizontais e quadradas
   - Modos: logo_only, logo_and_text, text_only
   ========================================================= */
.sidebar-brand {
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    padding: 6px 14px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    overflow: hidden !important;
    border-bottom: 1px solid var(--st-line, rgba(255, 255, 255, 0.08)) !important;
    position: relative !important;
    background-image: none !important;
    background-color: transparent !important;
}

.sidebar-brand .brand-logo-img,
.sidebar-brand #brandLogoImg {
    display: none !important;
}

/* Modo: Apenas Logo (Horizontal ou Quadrada) */
.sidebar-brand .dp-default-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 1 1 auto;
    width: auto;
    max-width: 190px;
    height: 42px;
    max-height: 44px;
    overflow: hidden;
}

.sidebar-brand .dp-default-logo img {
    display: block;
    width: auto;
    max-width: 185px;
    height: var(--logo-size, 34px);
    max-height: 44px;
    object-fit: contain;
    object-position: left center;
}

/* Modo: Logo + Texto / Apenas Texto */
.sidebar-brand .brand-icon {
    min-width: 36px;
    max-width: 64px;
    width: auto;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent !important;
    box-shadow: none !important;
    padding: 2px;
    margin: 0;
}

.sidebar-brand .brand-icon img {
    display: block;
    max-width: 60px;
    max-height: 36px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
}

.sidebar-brand .brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    line-height: 1.15;
    margin: 0;
    padding: 0;
}

.sidebar-brand .brand-text h1 {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: var(--text-primary, #ffffff) !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    letter-spacing: -0.2px !important;
}

.sidebar-brand .brand-text span {
    font-size: 9.5px !important;
    font-weight: 600 !important;
    color: var(--text-muted, #94a3b8) !important;
    margin: 1px 0 0 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
}

/* Alternância de visibilidade pelos Modos */
.sidebar-brand.mode-logo-only .dp-default-logo { display: flex !important; }
.sidebar-brand.mode-logo-only .brand-icon { display: none !important; }
.sidebar-brand.mode-logo-only .brand-text { display: none !important; }

.sidebar-brand.mode-logo-text .dp-default-logo { display: none !important; }
.sidebar-brand.mode-logo-text .brand-icon { display: flex !important; }
.sidebar-brand.mode-logo-text .brand-text { display: flex !important; }

.sidebar-brand.mode-text-only .dp-default-logo { display: none !important; }
.sidebar-brand.mode-text-only .brand-icon { display: flex !important; }
.sidebar-brand.mode-text-only .brand-text { display: flex !important; }

/* Sidebar recolhida (desktop) */
@media (min-width: 1025px) {
    .sidebar.collapsed .sidebar-brand,
    html.sidebar-is-collapsed .sidebar .sidebar-brand {
        height: 56px !important;
        min-height: 56px !important;
        padding: 0 !important;
        justify-content: center !important;
        align-items: center !important;
        background-image: none !important;
    }
    .sidebar.collapsed .sidebar-brand .dp-default-logo,
    html.sidebar-is-collapsed .sidebar .sidebar-brand .dp-default-logo,
    .sidebar.collapsed .sidebar-brand .brand-text,
    html.sidebar-is-collapsed .sidebar .sidebar-brand .brand-text {
        display: none !important;
    }
    .sidebar.collapsed .sidebar-brand .brand-icon,
    html.sidebar-is-collapsed .sidebar .sidebar-brand .brand-icon {
        display: flex !important;
        margin: 0 auto !important;
        width: 38px !important;
        max-width: 38px !important;
        height: 38px !important;
    }
    .sidebar.collapsed .sidebar-brand .brand-icon img,
    html.sidebar-is-collapsed .sidebar .sidebar-brand .brand-icon img {
        max-width: 34px !important;
        max-height: 34px !important;
    }
}


/* ─── OZ TOOLTIPS ENRIQUECIDOS (CARD COM FUNÇÃO E DESCRIÇÃO) ─── */
.oz-tooltip {
    position: fixed;
    z-index: 10000000;
    max-width: min(320px, calc(100vw - 20px));
    min-width: 175px;
    box-sizing: border-box;
    word-break: break-word;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(99, 102, 241, 0.25);
    border-radius: 10px;
    color: #f8fafc;
    font-family: var(--font-body, system-ui, -apple-system, sans-serif);
    font-size: 12px;
    line-height: 1.4;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px) scale(0.96);
    transition: opacity 0.14s cubic-bezier(0.16, 1, 0.3, 1), transform 0.14s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.14s;
}

[data-theme="light"] .oz-tooltip {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(99, 102, 241, 0.2);
    color: #0f172a;
}

.oz-tooltip.oz-tooltip-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.oz-tooltip::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #0f172a;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    pointer-events: none;
}

[data-theme="light"] .oz-tooltip::before {
    background: #ffffff;
    border-left-color: rgba(226, 232, 240, 0.9);
    border-top-color: rgba(226, 232, 240, 0.9);
}

.oz-tooltip[data-pos="bottom"]::before {
    top: -5px;
    left: var(--arrow-left, 20px);
    transform: rotate(45deg);
}

.oz-tooltip[data-pos="top"]::before {
    bottom: -5px;
    left: var(--arrow-left, 20px);
    transform: rotate(225deg);
}

.oz-tooltip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}

.oz-tooltip-title {
    font-weight: 700;
    font-size: 12px;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.2px;
}

[data-theme="light"] .oz-tooltip-title {
    color: #0f172a;
}

.oz-tooltip-title i {
    color: var(--accent, #6366f1);
    font-size: 11px;
}

.oz-tooltip-badge {
    background: var(--accent-muted, rgba(99, 102, 241, 0.25));
    border: 1px solid var(--accent-glow, rgba(99, 102, 241, 0.45));
    color: var(--accent, #c7d2fe);
    font-family: var(--font-mono, monospace);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    line-height: 1.2;
}

[data-theme="light"] .oz-tooltip-badge {
    background: var(--accent-muted, rgba(99, 102, 241, 0.12));
    border-color: var(--accent-glow, rgba(99, 102, 241, 0.3));
    color: var(--accent, #4f46e5);
}

.oz-tooltip-desc {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.35;
    font-weight: 400;
}

[data-theme="light"] .oz-tooltip-desc {
    color: #64748b;
}

@media (max-width: 768px) {
    .oz-tooltip {
        max-width: min(260px, 86vw);
    }
}

/* r:7F2D2AE77F0D9C82 */
