/* Yandex Market Loyalty System - Premium Yellow, Charcoal Black & Mobile Ultra-Responsive CSS */
:root {
    /* Brand Yandex Colors */
    --ym-yellow: #ffcc00;
    --ym-yellow-hover: #e6b800;
    --ym-yellow-light: #fff9e6;
    --ym-yellow-glow: rgba(255, 204, 0, 0.25);
    
    /* Dark Palette (Charcoal - Eye Soothing) */
    --ym-dark-bg: #181920;
    --ym-dark-card: #22232d;
    --ym-dark-border: #2d2e3a;
    --ym-text-light: #f1f5f9;
    --ym-text-muted: #94a3b8;

    /* Light Theme Body & Cards */
    --bg-body: #f5f7fa;
    --card-bg: #ffffff;
    --card-border: #e8ecf1;
    --card-shadow: 0 8px 24px rgba(25, 25, 33, 0.04);
    --border-radius: 14px;

    --sidebar-width: 270px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: #1e293b;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
}

.font-mono {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.font-bold {
    font-weight: 700;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - Deep Charcoal Black */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--ym-dark-bg);
    color: var(--ym-text-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1050;
    padding: 1.2rem 1rem;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.brand-badge {
    background: var(--ym-yellow);
    color: #111;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    box-shadow: 0 4px 14px var(--ym-yellow-glow);
}

.brand-title {
    display: block;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.brand-sub {
    font-size: 0.72rem;
    color: var(--ym-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.location-badge-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 204, 0, 0.25);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    color: #e2e8f0;
    margin-bottom: 1.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-link:hover {
    color: var(--ym-yellow);
    background: rgba(255, 204, 0, 0.1);
}

.nav-link.active {
    background: var(--ym-yellow);
    color: #111118;
    font-weight: 800;
    box-shadow: 0 4px 16px var(--ym-yellow-glow);
}

.nav-link.highlight-link {
    background: linear-gradient(135deg, #ffcc00 0%, #ffb700 100%);
    color: #111118;
    font-weight: 800;
}

.menu-divider {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 800;
    padding: 14px 12px 4px;
    letter-spacing: 1px;
}

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

.user-info-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: #2a2b38;
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ym-yellow);
}

.user-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    font-weight: 600;
    border-radius: 8px;
    padding: 6px;
}

/* Main Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 1.5rem;
    width: calc(100% - var(--sidebar-width));
}

.top-header {
    margin-bottom: 0.75rem !important;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.3px;
    margin-bottom: 2px;
}

/* Content Cards */
.content-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
    overflow: hidden;
}

.card-header-custom {
    padding: 1rem 1.25rem;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

.card-body-custom {
    padding: 1.25rem;
}

/* Tables */
.custom-table th {
    background-color: #f8fafc;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    font-weight: 700;
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
}

.custom-table td {
    padding: 11px 14px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

/* Buttons */
.btn-warning {
    background-color: var(--ym-yellow) !important;
    border-color: var(--ym-yellow) !important;
    color: #111118 !important;
    font-weight: 700 !important;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 8px 12px;
    font-size: 0.92rem;
    color: #1e293b;
    min-height: 42px;
}

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

/* Printable QR Code Container for A4 Top-Left Corner Print */
.printable-qr-card {
    display: none;
}

@media print {
    body * {
        visibility: hidden !important;
    }
    .printable-qr-card, .printable-qr-card * {
        visibility: visible !important;
    }
    .printable-qr-card {
        display: block !important;
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        width: 170px !important;
        text-align: center !important;
        padding: 5px !important;
        background: #ffffff !important;
    }
    .printable-qr-card img {
        width: 150px !important;
        height: 150px !important;
        display: block !important;
        margin: 0 auto 5px auto !important;
    }
    .print-id-text {
        font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
        font-size: 15pt !important;
        font-weight: 800 !important;
        color: #000000 !important;
        text-align: center !important;
    }
}

/* Mobile Sidebar & Ultra Compact Layout (< 992px) */
@media (max-width: 991px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    .sidebar.show-mobile {
        transform: translateX(0);
    }
    .mobile-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1040;
        display: none;
        backdrop-filter: blur(2px);
    }
    .mobile-sidebar-overlay.show {
        display: block;
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 0.75rem;
    }
    .page-title {
        font-size: 1.15rem !important;
    }
    .top-header p {
        font-size: 0.78rem !important;
    }
}
