/* =============================================
   Dashboard.css — Dalel Kuwait Admin
   ============================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: #F4F6FA;
    color: #1a1a1a;
    overflow-x: hidden;
}

/* --- Layout Structure --- */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.admin-main {
    margin-left: 220px; /* Offset for the sidebar width */
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #F4F6FA;
    overflow-x: hidden;
}

/* --- Top Navigation Bar --- */
.dash-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 16px 28px;
    border-bottom: 1px solid #EFEFEF;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px;
    width: 100%;
}

.dash-page-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px 0;
}

.dash-page-subtitle {
    font-size: 13px;
    color: #999999;
    margin-top: 2px;
}

.dash-navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* Language Switcher */
.lang-toggle {
    display: flex;
    background: #F4F6FA;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.lang-btn {
    padding: 7px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}

    .lang-btn.active {
        background: #FF4B00;
        color: #ffffff;
        font-weight: 700;
    }

/* Admin Profile & Dropdown */
.admin-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
    padding: 6px 10px;
    border-radius: 10px;
    transition: background 0.2s;
    flex-shrink: 0;
}

    .admin-profile:hover {
        background: #F4F6FA;
    }

.admin-avatar-container {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0f0;
    border: 1px solid #EFEFEF;
}

.admin-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.admin-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-role {
    font-size: 12px;
    color: #999;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #EFEFEF;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    min-width: 160px;
    z-index: 300;
    overflow: hidden;
}

    .profile-dropdown.show {
        display: block;
    }

    .profile-dropdown a {
        display: block;
        padding: 12px 18px;
        font-size: 14px;
        color: #333;
        text-decoration: none;
        transition: background 0.15s;
    }

        .profile-dropdown a:hover {
            background: #F4F6FA;
        }

    .profile-dropdown .logout-link {
        color: #FF4B00;
        font-weight: 600;
    }

/* --- Dashboard Main Content --- */
.dash-content {
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

/* Statistic Cards Grid */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px 18px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
}

    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 12px;
    color: #888;
    text-overflow: ellipsis;
    overflow: hidden;
}

.stat-value-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
}

    .stat-badge.up {
        color: #24D164;
    }

    .stat-badge.down {
        color: #D12427;
    }

    .stat-badge .arrow-icon {
        width: 16px;
        height: 16px;
        stroke: currentColor;
    }

.stat-sub {
    font-size: 12px;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

    .dot.green {
        background: #22C55E;
    }

    .dot.red {
        background: #EF4444;
    }

/* --- Charts Layout --- */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 16px;
}

.charts-row-bottom {
    grid-template-columns: repeat(2, 1fr);
}

.chart-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    overflow: hidden;
    min-width: 0;
}

.chart-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}

.chart-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.chart-value {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-badge-up {
    font-size: 12px;
    font-weight: 600;
    color: #22C55E;
    background: #EDFAF3;
    padding: 2px 8px;
    border-radius: 20px;
}

.chart-select {
    border: 1px solid #EFEFEF;
    border-radius: 8px;
    padding: 7px 28px 7px 12px;
    font-size: 13px;
    background: #fff 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='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    cursor: pointer;
}

/* Category Filter Dropdown */
.category-dropdown-wrap {
    position: relative;
}

.category-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
}

.category-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1px solid #EFEFEF;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    min-width: 140px;
    z-index: 200;
}

    .category-dropdown-menu.show {
        display: block;
    }

.cat-option {
    padding: 11px 16px;
    font-size: 14px;
    cursor: pointer;
}

    .cat-option:hover {
        background: #FFF3ED;
        color: #FF4B00;
    }

.chart-wrap {
    position: relative;
    height: 210px;
}

/* --- Business List Section --- */
.section-title {
    font-size: 17px;
    font-weight: 700;
}

.biz-search-wrap {
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
}

.biz-search-input {
    width: 0;
    opacity: 0;
    border: none;
    font-size: 14px;
    background: #F4F6FA;
    height: 38px;
    transition: all 0.3s ease;
    pointer-events: none;
}

.biz-search-wrap.expanded .biz-search-input {
    width: 200px;
    opacity: 1;
    padding: 0 12px;
    pointer-events: all;
    border: 1px solid #EFEFEF;
}

.icon-btn {
    background: #F4F6FA;
    border: none;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.biz-search-wrap.expanded .icon-btn {
    background: #FF4B00;
    border-radius: 0 8px 8px 0;
}

.biz-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 8px;
    border-bottom: 1px solid #F4F6FA;
    cursor: pointer;
}

.biz-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.biz-info {
    flex: 1;
    min-width: 0;
}

.biz-name {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.biz-cat {
    font-size: 12px;
    color: #aaa;
}

.biz-views {
    text-align: right;
}

.biz-views-num {
    font-size: 15px;
    font-weight: 700;
}

.biz-views-label {
    font-size: 11px;
    color: #aaa;
}

/* --- Responsive Media Queries --- */
@media (max-width: 1280px) {
    .charts-row {
        grid-template-columns: 1fr 320px;
    }
}

@media (max-width: 992px) {
    .admin-main {
        margin-left: 0;
    }

    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-row, .charts-row-bottom {
        grid-template-columns: 1fr !important;
    }

    .dash-content {
        padding: 20px 16px;
    }
}

@media (max-width: 480px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }

    .dash-content {
        padding: 16px 12px;
    }
}
