/* ===== LAYOUT ===== */
body {
    background: #f5f5f5;
    min-height: 100vh;
}

/* ===== TOOLTIPS ===== */
.tooltip {
    --bs-tooltip-bg: #1a1a1a;
    --bs-tooltip-color: #fff;
    --bs-tooltip-border-radius: 10px;
    --bs-tooltip-padding-x: 0.75rem;
    --bs-tooltip-padding-y: 0.45rem;
    --bs-tooltip-font-size: 0.8rem;
    --bs-tooltip-max-width: 260px;
    --bs-tooltip-opacity: 1;
}

.app-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== NAVBAR PILL ===== */
.navbar-pill {
    margin-top: 24px;
    margin-bottom: 32px;
    background: #fff;
    border-radius: 60px;
    padding: 8px 8px 8px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.navbar-pill .nav-brand {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a1a;
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-pill .nav-brand:hover {
    color: #1a1a1a;
}

/* ===== APP SWITCHER ===== */
.nav-brand-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-brand-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.nav-brand-toggle:hover {
    background: #f0f0f0;
    color: #1a1a1a;
}

.nav-brand-toggle.open {
    transform: rotate(180deg);
    color: #1a1a1a;
}

.app-switcher-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    padding: 6px;
    min-width: 230px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.app-switcher-dropdown.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.app-switcher-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: none;
    transition: background .15s;
}

.app-switcher-item:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.app-switcher-item img {
    border-radius: 6px;
    flex-shrink: 0;
}

.navbar-pill .nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.navbar-pill .nav-links a {
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    transition: all .2s;
}

.navbar-pill .nav-links a:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.navbar-pill .nav-links a.active {
    background: #1a1a1a;
    color: #fff;
}

.navbar-pill .nav-links a.nav-logout {
    color: #999;
}

.navbar-pill .nav-links a.nav-logout:hover {
    background: #fee;
    color: #d4566b;
}

/* ===== MOBILE BURGER ===== */
.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    padding: 8px;
    background: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background .2s;
    margin-left: auto;
}

.nav-burger:hover {
    background: #f0f0f0;
}

.nav-burger span {
    display: block;
    width: 18px;
    height: 2px;
    background: #1a1a1a;
    border-radius: 2px;
    transition: all .25s ease;
}

.nav-burger.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-burger.open span:nth-child(2) {
    opacity: 0;
}

.nav-burger.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .navbar-pill {
        flex-wrap: wrap;
        border-radius: 20px;
        padding: 12px 16px;
        gap: 0;
    }

    .nav-burger {
        display: flex;
    }

    .navbar-pill .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 2px;
        padding-top: 12px;
        margin-top: 12px;
        border-top: 1px solid #f0f0f0;
    }

    .navbar-pill .nav-links.open {
        display: flex;
    }

    .navbar-pill .nav-links a {
        border-radius: 12px;
        padding: 12px 16px;
        font-size: 15px;
    }

    .app-switcher-dropdown {
        left: -8px;
    }
}

/* ===== STORE CARDS GRID ===== */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.store-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 16px;
}

.store-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    transform: translateY(-2px);
    color: #1a1a1a;
}

.store-card .store-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 22px;
    color: #666;
}

.store-card .store-info {
    flex: 1;
    min-width: 0;
}

.store-card .store-name {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-card .store-arrow {
    color: #ccc;
    font-size: 18px;
    flex-shrink: 0;
    transition: transform .2s;
}

.store-card:hover .store-arrow {
    transform: translateX(4px);
    color: #999;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.page-header h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.page-header .btn-back {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    color: #666;
    text-decoration: none;
    transition: all .2s;
}

.page-header .btn-back:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    color: #1a1a1a;
}

/* ===== CONTENT CARD ===== */
.content-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    margin-bottom: 16px;
}

.content-card .card-section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #999;
    margin-bottom: 16px;
}

/* ===== CENTERED PAGE (error, select) ===== */
.centered-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.centered-box {
    text-align: center;
    max-width: 420px;
    width: 100%;
}

/* ===== MINIMAL BUTTONS ===== */
.btn-minimal {
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 14px;
    border: none;
    transition: all .2s;
}

.btn-minimal-primary {
    background: #1a1a1a;
    color: #fff;
}

.btn-minimal-primary:hover {
    background: #333;
    color: #fff;
}

.btn-minimal-secondary {
    background: #f0f0f0;
    color: #666;
}

.btn-minimal-secondary:hover {
    background: #e5e5e5;
    color: #1a1a1a;
}

/* ===== STORE NAV LINKS ===== */
.store-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 50px;
    background: #f0f0f0;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all .2s;
    white-space: nowrap;
}

.store-nav-link:hover {
    background: #e5e5e5;
    color: #1a1a1a;
}

.store-nav-link i {
    font-size: 14px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
    .navbar-pill {
        margin-top: 16px;
        margin-bottom: 24px;
        padding: 6px 6px 6px 16px;
        border-radius: 50px;
    }

    .navbar-pill .nav-links a {
        padding: 8px 14px;
        font-size: 13px;
    }

    .navbar-pill .nav-brand {
        font-size: 14px;
    }

    .store-grid {
        grid-template-columns: 1fr;
    }

    .app-wrapper {
        padding: 0 12px;
    }
}

/* ===== FORM OVERRIDES ===== */
.form-control,
.form-select {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    box-shadow: none;
    transition: border-color .2s;
}

.form-control:focus,
.form-select:focus {
    border-color: #ccc;
    box-shadow: 0 0 0 3px rgba(0,0,0,.04);
}

/* ===== CARD OVERRIDES ===== */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

/* ===== TABLE MINIMAL ===== */
.table {
    --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
    border-bottom-color: #f0f0f0;
}

.minimal-table-wrap {
    background: #fafafa;
    border-radius: 12px;
    overflow: hidden;
}

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

.minimal-table thead th {
    background: #f5f5f5;
    border-bottom: none;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: #999;
    padding: 10px 12px;
}

.minimal-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

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

.minimal-table tbody tr:hover {
    background: #f5f5f5;
}

.minimal-table tbody tr.table-active {
    background: #f0f4ff;
}

.minimal-table tfoot td {
    padding: 10px 12px;
    background: #f5f5f5;
    border-top: 1px solid #eee;
    border-bottom: none;
}

/* ===== NAV PILLS OVERRIDE ===== */
.nav-pills .nav-link {
    color: #666;
    font-weight: 500;
    font-size: 14px;
}

.nav-pills .nav-link.active {
    background: #1a1a1a;
    color: #fff;
}

/* ===== NAV TABS OVERRIDE ===== */
.nav-tabs {
    border-bottom: 1px solid #f0f0f0;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 0;
    color: #999;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-bottom: 2px solid transparent;
}

.nav-tabs .nav-link.active {
    color: #1a1a1a;
    border-bottom-color: #1a1a1a;
    background: none;
}

/* ===== BADGE OVERRIDE ===== */
.badge {
    font-weight: 500;
}

/* ===== LANGUAGE SWITCHER ===== */
.language-switcher {
    position: relative;
    display: inline-block;
}

.language-btn {
    background: #f0f0f0;
    border: none;
    border-radius: 50px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.language-btn i {
    font-size: 16px;
}

.language-btn:hover {
    background: #e5e5e5;
    color: #1a1a1a;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 6px;
    min-width: 160px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.language-dropdown.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.language-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    transition: background .15s;
    cursor: pointer;
}

.language-item:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.language-item.active {
    background: #f0f4ff;
    color: #4a7fff;
}

@media (max-width: 768px) {
    .language-switcher {
        width: 100%;
    }
    
    .language-btn {
        width: 100%;
        justify-content: center;
        border-radius: 12px;
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .language-dropdown {
        position: static;
        opacity: 1;
        transform: none;
        pointer-events: auto;
        box-shadow: none;
        background: #fafafa;
        display: none;
        margin-top: 8px;
    }
    
    .language-dropdown.open {
        display: block;
    }
}
