/* ============================================
   ANTIPRECIOS — Premium Minimalist Design
   ============================================ */

:root {
    --sidebar-width: 240px;
    --sidebar-collapsed: 64px;
    --topbar-height: 60px;

    /* Color Palette — Deep Navy + Soft Accents */
    --primary: #1e293b;
    --primary-light: #334155;
    --primary-dark: #0f172a;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-soft: rgba(99, 102, 241, 0.08);
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.1);
    --info: #3b82f6;

    /* Neutrals */
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Mobile specific */
    --bottom-nav-height: 65px;
    --touch-target: 48px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 0;
}

@media (max-width: 768px) {
    body {
        padding-bottom: var(--bottom-nav-height);
    }
}

/* ============ LAYOUT ============ */

.app-layout {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============ SIDEBAR ============ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-dark);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
    overflow: hidden;
}

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

.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .sidebar-user span,
.sidebar.collapsed .badge-count {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-brand {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 65px;
}

.sidebar-brand i {
    font-size: 22px;
    color: var(--accent-light);
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
}

.sidebar-link:hover {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-link.active {
    color: white;
    background: var(--accent);
}

.sidebar-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.badge-count {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

.sidebar-user i {
    font-size: 18px;
    flex-shrink: 0;
}

.logout-link {
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 13px !important;
}

/* ============ MAIN CONTENT ============ */

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    transition: var(--transition);
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
}

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

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

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

/* ============ TOPBAR ============ */

.topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

@media (max-width: 768px) {
    .topbar {
        padding: 0 16px;
    }

    .btn-sidebar-toggle {
        display: none;
    }
}

.btn-sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-sidebar-toggle:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.topbar-title {
    flex: 1;
}

.topbar-title h1 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.2px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.anfitrion-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
}

.btn-icon {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text);
}

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

/* ============ PAGE CONTENT ============ */

.page-content {
    padding: 24px;
    max-width: calc(100vw - var(--sidebar-width) - 48px);
    overflow: hidden;
}

@media (max-width: 768px) {
    .page-content {
        padding: 16px;
        max-width: 100vw;
    }
}

.messages-container {
    margin-bottom: 20px;
}

/* ============ CARDS ============ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2,
.card-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.1px;
}

.card-body {
    padding: 20px;
}

/* ============ KPI CARDS ============ */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

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

    .kpi-card {
        padding: 12px;
    }

    .kpi-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
        margin-bottom: 8px;
    }

    .kpi-value {
        font-size: 20px;
    }
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 14px;
}

.kpi-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.kpi-icon.green {
    background: var(--success-soft);
    color: var(--success);
}

.kpi-icon.purple {
    background: var(--accent-soft);
    color: var(--accent);
}

.kpi-icon.orange {
    background: var(--warning-soft);
    color: var(--warning);
}

.kpi-icon.red {
    background: var(--danger-soft);
    color: var(--danger);
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

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

/* ============ TABLES ============ */

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.table {
    margin: 0;
    font-size: 13.5px;
}

.table.table-fixed {
    table-layout: fixed;
    width: 100%;
}

.table.table-fixed td,
.table.table-fixed th {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table.table-fixed td.wrap-cell {
    white-space: normal;
    word-break: break-word;
}

.table thead th {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

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

/* Host row highlight */
.row-anfitrion {
    background: #fefce8 !important;
    border-left: 3px solid var(--warning);
}

.row-anfitrion:hover {
    background: #fef9c3 !important;
}

/* ============ BADGES & PILLS ============ */

.badge-position {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-position.best {
    background: var(--success-soft);
    color: var(--success);
}

.badge-position.worst {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge-position.mid {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge-stock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
}

.badge-stock.in-stock {
    background: var(--success-soft);
    color: var(--success);
}

.badge-stock.out-of-stock {
    background: var(--danger-soft);
    color: var(--danger);
}

.price-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12.5px;
    font-weight: 600;
}

.price-change.up {
    color: var(--danger);
}

.price-change.down {
    color: var(--success);
}

.price-change.neutral {
    color: var(--text-muted);
}

/* Position bar */
.position-bar {
    width: 60px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.position-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.position-bar-fill.good {
    background: var(--success);
}

.position-bar-fill.bad {
    background: var(--danger);
}

.position-bar-fill.mid {
    background: var(--warning);
}

/* ============ BUTTONS ============ */

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 13.5px;
    padding: 8px 18px;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-secondary {
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    border-color: var(--border);
    color: var(--text-secondary);
}

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

.btn-sm {
    padding: 5px 12px;
    font-size: 12.5px;
}

.btn-icon-action {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-icon-action:hover {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--text-muted);
}

/* ============ FORMS ============ */

.form-control,
.form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    padding: 8px 14px;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

/* ============ SEARCH BAR ============ */

.search-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
}

.search-input-wrapper input {
    padding-left: 40px;
}

/* ============ PRODUCT DETAIL ============ */

.product-header {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.product-info {
    flex: 1;
}

.product-info h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 12px;
}

.product-meta {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.product-meta-item {
    display: flex;
    gap: 8px;
    font-size: 13px;
}

.product-meta-item .label {
    color: var(--text-muted);
    font-weight: 500;
    min-width: 100px;
}

.product-meta-item .value {
    color: var(--text);
    font-weight: 600;
}

.smart-price {
    text-align: right;
}

.smart-price .amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}

.smart-price .currency {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 500;
}

.smart-price .label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.competition-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 20px;
}

/* ============ CHART CONTAINER ============ */

.chart-container {
    position: relative;
    height: 300px;
    padding: 12px;
}

.chart-container-lg {
    height: 400px;
}

/* ============ MODAL ============ */

.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-light);
    padding: 18px 24px;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-light);
    padding: 14px 24px;
}

/* ============ UPLOAD AREA ============ */

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.upload-area i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.upload-area h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.upload-area p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============ ALERTS LIST ============ */

.alert-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.alert-item:hover {
    background: var(--bg-hover);
}

.alert-item:last-child {
    border-bottom: none;
}

.alert-type-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.alert-type-icon.up {
    background: var(--danger-soft);
    color: var(--danger);
}

.alert-type-icon.down {
    background: var(--success-soft);
    color: var(--success);
}

.alert-type-icon.any {
    background: var(--warning-soft);
    color: var(--warning);
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.notification-item:hover {
    background: var(--bg-hover);
}

.notification-item.unread {
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
}

.notification-item .time {
    font-size: 11.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ============ PAGINATION ============ */

.pagination {
    gap: 4px;
}

.page-link {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm) !important;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 6px 12px;
    transition: var(--transition);
}

.page-link:hover {
    background: var(--bg-hover);
    border-color: var(--border);
    color: var(--text);
}

.page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
}

/* ============ EMPTY STATE ============ */

.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

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

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

.empty-state p {
    font-size: 13.5px;
}

/* ============ SUPERMERCADO CARD ============ */

.super-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.super-card:hover {
    background: var(--bg-hover);
}

.super-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.super-info {
    flex: 1;
}

.super-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.super-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.host-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--warning-soft);
    color: var(--warning);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.competitor-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--success-soft);
    color: var(--success);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* ============ LOGIN ============ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #312e81 100%);
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-card .brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .brand i {
    font-size: 36px;
    color: var(--accent);
}

.login-card .brand h1 {
    font-size: 22px;
    font-weight: 700;
    margin-top: 8px;
    letter-spacing: -0.3px;
}

.login-card .brand p {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }

    .sidebar .sidebar-brand span,
    .sidebar .sidebar-link span,
    .sidebar .sidebar-user span,
    .sidebar .badge-count {
        display: none;
    }

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

    .page-content {
        padding: 16px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-header {
        flex-direction: column;
    }

    .search-filters {
        flex-direction: column;
    }
}

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

/* ============ UTILITY ============ */

.text-price {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.text-sm {
    font-size: 12.5px;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.flex-center {
    display: flex;
    align-items: center;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.card,
.kpi-card,
.table-container {
    animation: fadeIn 0.3s ease;
}

/* ============ MOBILE NAVIGATION ============ */

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 1000;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    flex: 1;
    height: 100%;
    gap: 4px;
    transition: var(--transition);
}

.bottom-nav-link i {
    font-size: 20px;
}

.bottom-nav-link span {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bottom-nav-link.active {
    color: var(--accent);
}

.bottom-nav-link.active i {
    transform: translateY(-2px);
}

/* ============ MOBILE CARDS ============ */

.mobile-cards-container {
    display: none;
}

@media (max-width: 768px) {
    .mobile-cards-container {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .desktop-table-container {
        display: none;
    }
}

.mobile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.mobile-card-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    line-height: 1.3;
}

.mobile-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mobile-card-item {
    display: flex;
    flex-direction: column;
}

.mobile-card-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.mobile-card-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.mobile-card-reveal {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

/* ============ BOTTOM SHEETS ============ */

@media (max-width: 768px) {
    .modal.fade .modal-dialog {
        transform: translateY(100%);
        transition: transform 0.3s ease-out;
    }

    .modal.show .modal-dialog {
        transform: translateY(0);
    }

    .modal-dialog {
        margin: 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100% !important;
    }

    .modal-content {
        border-radius: 20px 20px 0 0;
        border: none;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .modal-header::before {
        content: "";
        width: 40px;
        height: 4px;
        background: var(--border);
        border-radius: 2px;
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ============ TOUCH OPTIMIZATION ============ */

.btn,
.form-control,
.form-select,
.sidebar-link,
.bottom-nav-link,
.list-group-item {
    min-height: var(--touch-target);
    display: flex;
    align-items: center;
}

.btn,
.bottom-nav-link {
    justify-content: center;
}

.sidebar-link,
.list-group-item {
    justify-content: flex-start;
}

@media (max-width: 768px) {

    .search-filters {
        position: sticky;
        top: var(--topbar-height);
        background: var(--bg);
        z-index: 40;
        padding: 8px 0;
        margin-bottom: 12px;
    }
}

/* ============ MOBILE UTILITIES & REFINEMENTS ============ */
@media (max-width: 768px) {
    .w-100-mobile {
        width: 100% !important;
    }

    .mt-3-mobile {
        margin-top: 1rem !important;
    }

    .shadow-none-mobile {
        box-shadow: none !important;
    }

    .px-0-mobile {
        padding: 0 !important;
    }

    .page-content {
        padding: 12px !important;
    }

    .topbar-title h1 {
        font-size: 14px;
    }

    .btn-sm {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }

    .card-body {
        padding: 12px;
    }

    .mobile-card {
        border-radius: 12px;
        border: 1px solid var(--border);
        background: white;
        margin: 0 0 12px 0;
        padding: 16px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    .mobile-cards-container {
        padding: 0 4px;
    }

    .mobile-card-details {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .mobile-card-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }

    .mobile-card-grid .mobile-card-item {
        border-bottom: none !important;
        padding-bottom: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
    }

    .mobile-card-grid .mobile-card-item.text-end {
        align-items: flex-end !important;
    }

    .mobile-card-item {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-bottom: 1px solid var(--border-light);
        padding-bottom: 6px;
    }

    .mobile-card-label {
        font-size: 11px !important;
        color: var(--text-muted) !important;
        text-transform: uppercase !important;
        font-weight: 600 !important;
    }

    .mobile-card-value {
        font-size: 14px !important;
        font-weight: 700 !important;
        color: var(--text) !important;
    }
}