/* ========== LOGIN PAGE ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at top right, var(--primary-glow) 0%, transparent 50%),
        radial-gradient(ellipse at bottom left, var(--primary-subtle) 0%, transparent 50%),
        var(--bg-primary);
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.logo {
    text-align: center;
    margin-bottom: 36px;
}

.logo img {
    height: 52px;
    width: auto;
    margin-bottom: 12px;
}

.logo h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo p {
    color: var(--text-muted);
    margin-top: 6px;
    font-size: 14px;
    font-weight: 400;
}

/* ========== DASHBOARD LAYOUT ========== */
.dashboard {
    display: none;
    min-height: 100vh;
    background: var(--bg-primary);
}

.dashboard.active {
    display: block;
}

/* ========== HEADER ========== */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    padding: 0 24px;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary));
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left img {
    height: 36px;
    width: auto;
}

.header-left h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.agency-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--text-on-primary);
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-gold);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-light);
}

.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

.connection-dot.reconnecting {
    background: var(--warning);
}

.connection-dot.offline {
    background: var(--error);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========== 3-COLUMN LAYOUT ========== */
.main-content {
    display: grid;
    grid-template-columns: 300px 1fr 340px;
    height: calc(100vh - 64px);
}

/* ========== LEFT SIDEBAR - GROUPS ========== */
.groups-sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-light);
    overflow-y: auto;
    padding: 20px 16px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========== MAP CONTAINER ========== */
.map-container {
    position: relative;
    height: 100%;
}

#map {
    height: 100%;
    width: 100%;
    background: var(--bg-primary);
}

.refresh-btn {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    padding: 12px 22px;
    border-radius: var(--radius-md);
    color: var(--text-on-primary);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-gold);
    transition: var(--transition);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(217, 170, 30, 0.3);
}

.refresh-btn:active {
    transform: translateY(0);
}

.last-update {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1000;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
}

/* ========== RIGHT SIDEBAR - USERS ========== */
.users-sidebar {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-light);
    overflow-y: auto;
    padding: 20px 16px;
}

.stats-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 12px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.stat-card.highlight {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary-subtle), transparent);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.user-search-wrap {
    margin-bottom: 12px;
}

.user-search-wrap input {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: var(--transition);
}

.user-search-wrap input::placeholder {
    color: var(--text-muted);
}

.user-search-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}

.no-data {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.no-data p {
    margin-top: 8px;
    font-size: 14px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 260px 1fr 300px;
    }
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 50vh auto;
        height: auto;
    }

    .groups-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        max-height: 250px;
        order: 1;
    }

    .map-container {
        order: 2;
        min-height: 50vh;
    }

    .users-sidebar {
        border-left: none;
        border-top: 1px solid var(--border-light);
        order: 3;
        max-height: 300px;
    }

    .header-left h2 {
        font-size: 14px;
    }

    .header-left img {
        height: 28px;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 0 16px;
        height: 56px;
    }

    .login-card {
        padding: 32px 24px;
    }

    .stats-row {
        gap: 8px;
    }

    .stat-card {
        padding: 10px 8px;
    }

    .stat-value {
        font-size: 20px;
    }

    .logo-dual img:first-child {
        height: 36px;
    }

    .logo-dual .logo-hajjesim {
        height: 24px;
    }

    .header-left .logo-dual img:first-child {
        height: 26px;
    }

    .header-left .logo-dual .logo-hajjesim {
        height: 20px;
    }
}

/* ========== DUAL LOGO (Partner x HajjeSIM) ========== */
.logo-dual {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.logo-dual img:first-child {
    height: 48px;
    width: auto;
}

.logo-dual .logo-hajjesim {
    height: 32px;
    width: auto;
}

.logo-separator {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    user-select: none;
}

/* Header dual logo - smaller */
.header-left .logo-dual {
    gap: 8px;
}

.header-left .logo-dual img:first-child {
    height: 32px;
    width: auto;
}

.header-left .logo-dual .logo-hajjesim {
    height: 24px;
    width: auto;
}
