/* ==========================================================================
   PREMIUM ADMIN DASHBOARD DESIGN SYSTEM
   ========================================================================== */

:root {
    --primary-gradient: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
    --bg-dark: #0F172A;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: 1px solid rgba(255, 255, 255, 0.1);
    --text-main: #FFFFFF;
    --text-muted: #94A3B8;
    --accent-color: #3B82F6;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --danger-color: #EF4444;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --hover-transform: translateY(-2px);
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    min-height: 100vh;
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1400px;
    /* Wider for better dashboard view */
    margin: 40px auto;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

.header {
    background: var(--primary-gradient);
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.nav-links {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-links a.active {
    background: white;
    color: #1E40AF;
    /* Darker blue for contrast */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
}

.logout {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.logout:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   DASHBOARD CONTENT
   ========================================================================== */

.content {
    padding: 40px;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.kpi-card,
.metric-card,
.stat-card {
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 20px;
    padding: 32px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kpi-card:hover,
.metric-card:hover,
.stat-card:hover {
    transform: var(--hover-transform);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.3);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Card Content */
.kpi-label,
.metric-label,
.stat-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.kpi-value,
.metric-value,
.stat-value,
.stat-number {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFFFFF 0%, #E2E8F0 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

/* Funnel & Progress Bars */
.funnel-container {
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 40px;
}

.funnel-step {
    margin-bottom: 24px;
}

.funnel-bar-bg {
    background: rgba(255, 255, 255, 0.05);
    height: 48px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.funnel-bar {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6 0%, #60A5FA 100%);
    border-radius: 12px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.funnel-info {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 2;
}

.funnel-label {
    font-weight: 600;
    color: white;
    font-size: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.funnel-value {
    font-weight: 700;
    color: white;
    font-size: 18px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.conversion-rate {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin: 12px 0;
    font-weight: 500;
    opacity: 0.8;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
}

th {
    text-align: left;
    padding: 20px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

td {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 15px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 500;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .header {
        flex-direction: column;
        gap: 20px;
        padding: 24px;
    }

    .header-right {
        flex-direction: column;
        width: 100%;
        gap: 16px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .logout {
        width: 100%;
        text-align: center;
    }

    .content {
        padding: 24px;
    }
}

/* Quick Stats Bar */
.quick-stats {
    display: flex;
    justify-content: space-around;
    padding: 24px 32px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 24px;
}

.quick-stat {
    text-align: center;
}

.quick-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 4px;
}

.quick-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Section Styles */
.section {
    padding: 32px;
    background: var(--card-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    margin-top: 32px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Error Message */
.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    color: #FCA5A5;
    padding: 16px;
    border-radius: 12px;
    margin: 20px 0;
    font-size: 14px;
}

/* Retention Table Styles */
.retention-cell {
    font-weight: 700;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    width: 80px;
    margin: 0 auto;
}

.good {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.ok {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.bad {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

/* User List & Cards */
.user-list {
    padding: 32px;
}

.user-card {
    background: var(--card-bg);
    border: var(--card-border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
}

.user-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-name {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.user-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* Photos */
.photos-section,
.id-section {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.photo-item {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.photo-item:hover {
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.id-photo-wrapper {
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid var(--accent-color);
    cursor: pointer;
    transition: all 0.2s;
}

.id-photo-wrapper:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.id-photo-wrapper img {
    width: 100%;
    max-width: 400px;
    display: block;
}

/* Buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-approve {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.btn-reject {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}

.btn-details {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
}

/* Tabs */
.tabs-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tabs {
    display: flex;
    gap: 12px;
}

.tab {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.tab:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.tab.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Login Screen */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-dark);
}

.login-box {
    background: var(--card-bg);
    padding: 48px;
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    width: 100%;
    max-width: 420px;
    border: var(--card-border);
    backdrop-filter: blur(12px);
}

.login-box h2 {
    margin-bottom: 12px;
    color: white;
    font-size: 28px;
    font-weight: 800;
    text-align: center;
}

.login-box p {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 32px;
}

.login-box input {
    width: 100%;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 15px;
    background: rgba(0, 0, 0, 0.2);
    color: white;
    transition: all 0.2s;
}

.login-box input:focus {
    border-color: var(--accent-color);
    outline: none;
    background: rgba(0, 0, 0, 0.3);
}

.login-box button {
    width: 100%;
    padding: 16px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.login-box button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 20px;
    max-width: 90%;
    max-height: 90%;
    border: var(--card-border);
    box-shadow: var(--glass-shadow);
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}