@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0066FF;
    --primary-dark: #0052CC;
    --primary-light: #E6F0FF;
    --secondary: #00C853;
    --accent: #FF6B35;
    --dark: #1A1A2E;
    --gray-900: #111827;
    --gray-800: #1F2937;
    --gray-700: #374151;
    --gray-600: #4B5563;
    --gray-500: #6B7280;
    --gray-400: #9CA3AF;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --gray-50: #F9FAFB;
    --white: #FFFFFF;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --gradient-1: linear-gradient(135deg, #0066FF 0%, #00C853 100%);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --sidebar-width: 260px;
    --header-height: 70px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.admin-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 1000;
    border-bottom: 1px solid var(--gray-200);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h2 {
    font-size: 22px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--gray-600);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: none;
}

.sidebar-toggle:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 14px;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    z-index: 999;
}

.sidebar-nav {
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* Main Content */
.dashboard-container {
    display: flex;
    padding-top: var(--header-height);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: calc(100vh - var(--header-height));
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
}

.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.page-title h1 i {
    color: var(--primary);
    font-size: 24px;
}

.page-subtitle {
    color: var(--gray-500);
    font-size: 14px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-total::before { background: var(--primary); }
.stat-pending::before { background: var(--warning); }
.stat-progress::before { background: #3B82F6; }
.stat-success::before { background: var(--success); }
.stat-expired::before { background: var(--error); }

.stat-icon-wrapper .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--white);
}

.stat-total .stat-icon { background: var(--primary); }
.stat-pending .stat-icon { background: var(--warning); }
.stat-progress .stat-icon { background: #3B82F6; }
.stat-success .stat-icon { background: var(--success); }
.stat-expired .stat-icon { background: var(--error); }

.stat-info {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 24px;
}

.dashboard-main {
    min-width: 0;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--primary);
    font-size: 18px;
}

.card-title h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
}

.card-body {
    padding: 20px;
}

/* Briefings List */
.briefings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.briefing-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.briefing-item:hover {
    background: var(--primary-light);
}

.briefing-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-1);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.briefing-info {
    flex: 1;
    min-width: 0;
}

.briefing-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.briefing-email {
    font-size: 12px;
    color: var(--gray-500);
}

.briefing-status {
    flex-shrink: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.status-pending { background: #FEF3C7; color: #92400E; }
.status-progress { background: #DBEAFE; color: #1E40AF; }
.status-success { background: #D1FAE5; color: #065F46; }
.status-expired { background: #FEE2E2; color: #991B1B; }

.briefing-date {
    color: var(--gray-500);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.briefing-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    text-decoration: none;
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-icon-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.btn-icon-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 12px;
}

.activity-icon {
    width: 8px;
    height: 8px;
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-icon i {
    font-size: 8px;
    color: var(--primary);
}

.activity-content p {
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.4;
    margin-bottom: 2px;
}

.activity-time {
    font-size: 11px;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* AI Status */
.ai-status-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.ai-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 16px;
}

.ai-logo.gemini { background: linear-gradient(135deg, #4285F4, #34A853); }
.ai-logo.perplexity { background: linear-gradient(135deg, #0066FF, #7C3AED); }

.ai-info {
    flex: 1;
}

.ai-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1px;
}

.ai-info span {
    font-size: 11px;
    color: var(--gray-500);
}

.ai-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
}

.ai-indicator.online { color: var(--success); }

.ai-indicator .pulse {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.btn-glow {
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.35);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 48px 20px;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-icon i {
    font-size: 24px;
    color: var(--gray-400);
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 16px;
    font-size: 14px;
}

.empty-state-small {
    text-align: center;
    padding: 24px;
    color: var(--gray-500);
    font-size: 13px;
}

.empty-state-small i {
    font-size: 20px;
    margin-bottom: 8px;
    display: block;
    color: var(--gray-400);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    border-left: 3px solid var(--primary);
    font-size: 14px;
}

.toast.show { transform: translateX(0); }
.toast-success { border-left-color: var(--success); }
.toast-success i { color: var(--success); }
.toast-error { border-left-color: var(--error); }
.toast-error i { color: var(--error); }

/* Responsive */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .dashboard-sidebar .card {
        flex: 1;
        min-width: 280px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .admin-header {
        padding: 0 16px;
    }
    
    .main-content {
        padding: 20px 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .page-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .briefing-item {
        flex-wrap: wrap;
    }
    
    .briefing-date,
    .briefing-actions {
        width: 100%;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
