/**
 * 4Brand Dashboard CSS — Modern App UI
 */

/* ========================================
   LAYOUT BASE
   ======================================== */
.dash-layout {
    min-height: 100vh;
    background: linear-gradient(180deg, #F8F9FC 0%, #F0F2F8 100%);
}

/* ========================================
   SIDEBAR
   ======================================== */
.dash-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s var(--ease-smooth);
}

.dash-sidebar-header {
    padding: 24px;
    padding-top: max(24px, env(safe-area-inset-top, 24px));
    border-bottom: 1px solid var(--border-color);
}

.dash-sidebar-logo {
    height: 32px;
    width: auto;
}

.dash-sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.dash-nav-section {
    margin-bottom: 8px;
}

.dash-nav-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    padding: 8px 12px 6px;
}

.dash-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.2s var(--ease-smooth);
}

.dash-nav-link:hover {
    background: linear-gradient(135deg, rgba(45, 74, 124, 0.06), rgba(45, 74, 124, 0.02));
    color: var(--brand-blue);
}

.dash-nav-link.active {
    background: linear-gradient(135deg, rgba(45, 74, 124, 0.1), rgba(45, 74, 124, 0.05));
    color: var(--brand-blue);
    font-weight: 600;
}

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

.dash-sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.dash-logout-link {
    margin-top: 8px;
    color: var(--text-light) !important;
    font-size: 13px !important;
}

.dash-logout-link:hover {
    color: #e74c3c !important;
    background: rgba(231, 76, 60, 0.06);
}

.dash-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    transition: background 0.2s var(--ease-smooth);
}

.dash-user-info:hover {
    background: rgba(45, 74, 124, 0.04);
}

.dash-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.dash-user-details {
    flex: 1;
    min-width: 0;
}

.dash-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-user-email {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.dash-main {
    margin-left: 260px;
    min-height: 100vh;
}

.dash-header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 18px 32px;
    padding-top: max(18px, env(safe-area-inset-top, 18px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
}

.dash-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dash-mobile-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 20px;
    transition: all 0.2s var(--ease-smooth);
}

.dash-mobile-toggle:hover {
    background: rgba(45, 74, 124, 0.06);
    color: var(--brand-blue);
}

.dash-page-title {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.dash-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-header-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 18px;
    position: relative;
    transition: all 0.2s var(--ease-smooth);
}

.dash-header-btn:hover {
    background: rgba(45, 74, 124, 0.06);
    color: var(--brand-blue);
}

.dash-content {
    padding: 28px 32px;
}

/* ========================================
   WELCOME BANNER
   ======================================== */
.dash-welcome {
    background: linear-gradient(135deg, var(--brand-blue) 0%, #3A5F9A 50%, var(--brand-blue-dark) 100%);
    border-radius: var(--radius-xl);
    padding: 36px;
    margin-bottom: 28px;
    color: white;
    position: relative;
    overflow: hidden;
}

.dash-welcome::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -15%;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(212, 168, 75, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.dash-welcome::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.dash-welcome-content {
    position: relative;
    z-index: 1;
}

.dash-welcome h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.dash-welcome p {
    font-size: 15px;
    opacity: 0.85;
    max-width: 500px;
}

/* ========================================
   AGENTS GRID
   ======================================== */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.agent-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.agent-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--agent-color, var(--brand-blue));
    opacity: 0;
    transition: opacity 0.3s var(--ease-smooth);
}

.agent-card:hover {
    border-color: transparent;
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--agent-color, var(--brand-blue));
    transform: translateY(-3px);
}

.agent-card:hover::before {
    opacity: 1;
}

.agent-card:active {
    transform: translateY(-1px);
    transition-duration: 0.1s;
}

.agent-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.agent-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    background: var(--agent-bg, rgba(45, 74, 124, 0.08));
    color: var(--agent-color, var(--brand-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
    transition: transform 0.3s var(--ease-bounce);
}

.agent-card:hover .agent-icon {
    transform: scale(1.08);
}

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

.agent-name {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.agent-category {
    font-size: 12px;
    color: var(--text-light);
}

.agent-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.agent-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.agent-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-light);
}

.agent-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34D399;
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.4);
}

.agent-action {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-blue);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.3s var(--ease-smooth);
}

.agent-card:hover .agent-action {
    opacity: 1;
    transform: translateX(0);
}

/* ========================================
   BOTTOM NAV (Mobile App Feel)
   ======================================== */
.dash-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    z-index: 200;
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
}

.dash-bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    max-width: 400px;
    margin: 0 auto;
}

.dash-bottom-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 16px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 10px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: color 0.2s;
}

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

.dash-bottom-link.active {
    color: var(--brand-blue);
}

.dash-bottom-link:active {
    background: rgba(45, 74, 124, 0.06);
}

/* ========================================
   EMPTY STATE
   ======================================== */
.dash-empty {
    text-align: center;
    padding: 64px 32px;
    background: var(--bg-primary);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-xl);
}

.dash-empty-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(45, 74, 124, 0.08), rgba(45, 74, 124, 0.03));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
    color: var(--text-light);
}

.dash-empty h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.dash-empty p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .dash-sidebar {
        transform: translateX(-100%);
    }

    .dash-sidebar.open {
        transform: translateX(0);
    }

    .dash-main {
        margin-left: 0;
    }

    .dash-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .dash-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(2px);
        z-index: 99;
    }

    .dash-overlay.show {
        display: block;
    }

    /* Show bottom nav on tablet/mobile */
    .dash-bottom-nav {
        display: block;
    }

    .dash-main {
        padding-bottom: 72px;
    }
}

@media (max-width: 768px) {
    .dash-content {
        padding: 20px;
    }

    .dash-header {
        padding: 14px 20px;
    }

    .dash-welcome {
        padding: 24px;
        border-radius: var(--radius-lg);
    }

    .dash-welcome h2 {
        font-size: 20px;
    }

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

    .dash-sidebar {
        width: 240px;
    }
}

@media (max-width: 480px) {
    .dash-page-title {
        font-size: 17px;
    }

    .dash-content {
        padding: 16px;
    }

    .dash-welcome {
        padding: 20px;
    }

    .dash-welcome h2 {
        font-size: 18px;
    }

    .agents-grid {
        gap: 12px;
    }

    .agent-card {
        padding: 20px;
    }
}
