/* ====================================================
   BlackLovers Hair — Sistema de Gestão
   Aesthetic: Luxury Organic / Dark Warm Tones
   ==================================================== */

:root {
    --bg-deep: #0d0b0a;
    --bg-surface: #1a1614;
    --bg-card: #221e1b;
    --bg-card-hover: #2a2522;
    --bg-input: #161210;
    --border: #332d28;
    --border-focus: #c9a96e;

    --text-primary: #f5efe6;
    --text-secondary: #a89a8b;
    --text-muted: #6b5f54;
    --text-accent: #c9a96e;

    --gold: #c9a96e;
    --gold-bright: #e0c48a;
    --gold-dim: #8a7445;
    --green: #6abf69;
    --green-bg: rgba(106, 191, 105, 0.08);
    --red: #e05555;
    --red-bg: rgba(224, 85, 85, 0.08);
    --amber: #e0a030;
    --amber-bg: rgba(224, 160, 48, 0.08);

    --sidebar-w: 240px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.45);
    --shadow-glow: 0 0 20px rgba(201,169,110,0.12);
}

/* ── Reset ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Grain Overlay ────────────────────────── */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.022;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 180px;
}

/* ── Sidebar ──────────────────────────────── */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    padding: 24px 16px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 4px 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.brand-icon { width: 38px; height: 38px; color: var(--gold); flex-shrink: 0; }
.brand-icon svg { width: 100%; height: 100%; }
.brand-logo { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1.5px solid var(--gold-dim); background: #7c4a2d; }
.brand-text { display: flex; flex-direction: column; }
.brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.brand-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 500;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: rgba(201,169,110,0.06); color: var(--text-primary); }
.nav-item.active { background: rgba(201,169,110,0.1); color: var(--gold); font-weight: 600; }
.nav-item.active svg { stroke: var(--gold); }

.sidebar-footer { padding-top: 16px; border-top: 1px solid var(--border); margin-top: 8px; }
.import-btn { color: var(--gold-dim) !important; font-size: 0.82rem !important; }
.import-btn:hover { color: var(--gold) !important; background: rgba(201,169,110,0.08) !important; }

/* ── Main Content ─────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 32px 40px;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 60% at 70% 0%, rgba(201,169,110,0.03) 0%, transparent 60%),
        var(--bg-deep);
}

/* ── Tab Content ──────────────────────────── */
.tab-content { display: none; animation: fadeSlideIn 0.35s ease; }
.tab-content.active { display: block; }

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Page Header ──────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}
.page-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}
.page-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 400;
}
.header-date {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* ── Stats Grid ───────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    border-radius: 0 2px 2px 0;
}
.stat-products::before { background: var(--gold); }
.stat-sales::before { background: var(--green); }
.stat-purchases::before { background: var(--amber); }
.stat-profit::before { background: var(--gold-bright); }

.stat-card:hover {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}
.stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-products .stat-icon { background: rgba(201,169,110,0.1); color: var(--gold); }
.stat-sales .stat-icon { background: var(--green-bg); color: var(--green); }
.stat-purchases .stat-icon { background: var(--amber-bg); color: var(--amber); }
.stat-profit .stat-icon { background: rgba(224,196,138,0.08); color: var(--gold-bright); }
.stat-icon svg { width: 22px; height: 22px; }
.stat-info { display: flex; flex-direction: column; }
.stat-value {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

/* ── Dashboard Grid ───────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ── Cards ────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}
.card-body { padding: 18px 22px; max-height: 280px; overflow-y: auto; }
.empty-state {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 32px 0;
    font-style: italic;
}

/* ── Dashboard Items ──────────────────────── */
.low-stock-item, .recent-sale-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(51,45,40,0.5);
    font-size: 0.85rem;
}
.low-stock-item:last-child, .recent-sale-item:last-child { border-bottom: none; }
.low-stock-item .item-name, .recent-sale-item .item-name { color: var(--text-primary); font-weight: 500; }
.low-stock-item .item-code, .recent-sale-item .item-detail {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}
.low-stock-item .item-qty {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}
.item-qty.critical { background: var(--red-bg); color: var(--red); }
.item-qty.warning { background: var(--amber-bg); color: var(--amber); }
.recent-sale-item .item-value {
    font-family: var(--font-mono);
    color: var(--green);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ── Form Card ────────────────────────────── */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 24px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-group input,
.form-group select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    outline: none;
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group input:focus,
.form-group select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,169,110,0.1);
}
.readonly-field { opacity: 0.65; cursor: default; background: rgba(22,18,16,0.6) !important; }
.highlight-field { color: var(--gold-bright) !important; font-weight: 600; opacity: 1 !important; }
.profit-field { color: var(--green) !important; font-weight: 600; opacity: 1 !important; }
.input-hint { font-size: 0.72rem; color: var(--text-muted); min-height: 16px; }
.input-hint.found { color: var(--green); }
.input-hint.not-found { color: var(--red); }

/* ── Form Actions ─────────────────────────── */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* ── Buttons ──────────────────────────────── */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}
.btn-primary { background: var(--gold); color: var(--bg-deep); }
.btn-primary:hover {
    background: var(--gold-bright);
    box-shadow: 0 4px 16px rgba(201,169,110,0.25);
    transform: translateY(-1px);
}
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #c44; }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

.btn-icon {
    padding: 6px 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover { border-color: var(--border); color: var(--text-primary); }
.btn-icon.delete:hover { color: var(--red); border-color: rgba(224,85,85,0.3); }
.btn-icon.edit:hover { color: var(--gold); border-color: rgba(201,169,110,0.3); }
.btn-icon svg { width: 16px; height: 16px; }

/* ── Table Card ───────────────────────────── */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.table-header h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }

.search-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.82rem;
    outline: none;
    width: 220px;
    transition: all 0.2s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,169,110,0.08); }

.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
thead th {
    background: rgba(201,169,110,0.04);
    padding: 12px 16px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tbody td {
    padding: 12px 16px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(51,45,40,0.4);
    color: var(--text-primary);
    white-space: nowrap;
}
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(201,169,110,0.03); }
tbody tr:last-child td { border-bottom: none; }

td .mono { font-family: var(--font-mono); font-size: 0.82rem; }
td .currency { font-family: var(--font-mono); }
td .currency.positive { color: var(--green); }
td .currency.negative { color: var(--red); }
td .actions-cell { display: flex; gap: 4px; }

/* ── Filters Bar ──────────────────────────── */
.filters-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    display: flex;
    gap: 24px;
    align-items: flex-end;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-group label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.filter-group select,
.filter-group input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
}
.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,169,110,0.08);
}
.filter-group select { cursor: pointer; min-width: 180px; }
.filter-group input[type="number"] { width: 80px; }
.filter-group .search-input { width: 200px; }

/* ── Status Badges ────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.status-ok { background: var(--green-bg); color: var(--green); }
.status-ok::before { background: var(--green); }
.status-low { background: var(--amber-bg); color: var(--amber); }
.status-low::before { background: var(--amber); }
.status-out { background: var(--red-bg); color: var(--red); }
.status-out::before { background: var(--red); }

/* ── Toast ────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
}
.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    min-width: 280px;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--gold); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon { color: var(--red); }
.toast.info .toast-icon { color: var(--gold); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(30px); }
}

/* ── Modal ────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    min-width: 380px;
    max-width: 460px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; }
.modal-body { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

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

/* ── Table empty state ────────────────────── */
tbody .empty-row td {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 40px 16px;
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile Menu Button ───────────────────── */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 14px; left: 14px;
    z-index: 200;
    width: 42px; height: 42px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--gold);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.mobile-menu-btn svg { width: 22px; height: 22px; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
    z-index: 90;
}

/* ── Table Count Badge ────────────────────── */
.table-count {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 8px;
}

/* ── Vendas Filters ───────────────────────── */
.vendas-filters { margin-bottom: 18px; }
.filter-actions-group { display: flex; flex-direction: column; justify-content: flex-end; }

/* ── Pagination ───────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 22px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.page-btn:hover { border-color: var(--gold-dim); color: var(--text-primary); }
.page-btn.active { background: var(--gold); color: var(--bg-deep); border-color: var(--gold); font-weight: 600; }
.page-btn:disabled { opacity: 0.35; cursor: default; pointer-events: none; }
.page-info {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0 12px;
}

@media (max-width: 900px) {
    .sidebar { width: 64px; padding: 16px 8px; align-items: center; }
    .brand-text, .nav-item span, .sidebar-footer span { display: none; }
    .nav-item { justify-content: center; padding: 11px; }
    .brand-icon, .brand-logo { margin: 0; }
    .main-content { margin-left: 64px; padding: 24px 20px; }
    .stats-grid { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .filters-bar { flex-direction: column; align-items: stretch; }
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }
    .sidebar-overlay.open { display: block; }

    .sidebar {
        width: 260px;
        padding: 24px 16px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        align-items: stretch;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open ~ .sidebar-overlay { display: block; }

    /* Restore hidden text for open sidebar */
    .sidebar.open .brand-text,
    .sidebar.open .nav-item span,
    .sidebar.open .sidebar-footer span { display: inline; }
    .sidebar.open .nav-item { justify-content: flex-start; padding: 11px 14px; }

    .main-content {
        margin-left: 0;
        padding: 70px 16px 24px;
    }

    .page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .page-title { font-size: 1.5rem; }
    .header-date { align-self: flex-start; }

    .stats-grid { grid-template-columns: 1fr; gap: 12px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr !important; }
    .form-card { padding: 18px; }

    .filters-bar { flex-direction: column; align-items: stretch; gap: 14px; padding: 14px 16px; }
    .filter-group .search-input { width: 100%; }
    .filter-group select { min-width: auto; width: 100%; }

    .table-header { flex-direction: column; gap: 10px; align-items: stretch; padding: 14px 16px; }
    .table-header .search-input { width: 100%; }

    table { font-size: 0.78rem; }
    thead th { padding: 10px 10px; font-size: 0.68rem; }
    tbody td { padding: 10px 10px; }

    .toast-container { left: 12px; right: 12px; bottom: 12px; }
    .toast { min-width: auto; max-width: none; }

    .modal { min-width: auto; max-width: calc(100vw - 32px); margin: 16px; }

    .pagination { padding: 12px 16px; gap: 4px; }
    .page-btn { min-width: 32px; height: 32px; font-size: 0.75rem; }
}

/* ── Códigos Grid ─────────────────────────── */
.codigos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.codigos-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.codigos-category-header {
    padding: 14px 20px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.codigos-category-header .cat-count {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.85;
}
.codigos-list {
    padding: 0;
    margin: 0;
    list-style: none;
    max-height: 420px;
    overflow-y: auto;
}
.codigos-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(51,45,40,0.4);
    transition: background 0.15s;
    font-size: 0.85rem;
}
.codigos-item:last-child { border-bottom: none; }
.codigos-item:hover { background: rgba(201,169,110,0.04); }
.codigos-item .cod-num {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--gold);
    min-width: 40px;
    font-size: 0.82rem;
}
.codigos-item .cod-nome {
    color: var(--text-primary);
    font-weight: 400;
}
.codigos-filters { margin-bottom: 20px; }

@media (max-width: 768px) {
    .codigos-grid { grid-template-columns: 1fr; }
}
