@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-main: #F1F5F9;
    --bg-surface: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FAFAFA;
    --border-color: #E2E8F0;
    --border-glow: rgba(99, 102, 241, 0.2);
    
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-glow: rgba(79, 70, 229, 0.15);
    
    --accent: #7C3AED;
    --accent-glow: rgba(124, 58, 237, 0.15);
    
    --success: #10B981;
    --success-bg: #ECFDF5;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --danger: #EF4444;
    --danger-bg: #FEF2F2;
    --info: #06B6D4;
    --info-bg: #ECFEFF;

    --text-main: #0F172A;
    --text-muted: #475569;
    --text-dim: #64748B;

    --sidebar-bg: #0F172A;
    --sidebar-text: #94A3B8;
    --sidebar-active-bg: linear-gradient(135deg, #4F46E5, #7C3AED);

    --sidebar-width: 270px;
    --header-height: 70px;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
    --shadow-glow: 0 4px 15px rgba(79, 70, 229, 0.2);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-main);
}

/* Background Subtle Gradient Glow */
.bg-glow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-glow-1 {
    position: absolute;
    top: -10%;
    left: 20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.05) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    filter: blur(50px);
}

.bg-glow-2 {
    position: absolute;
    bottom: -10%;
    right: 10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.04) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    filter: blur(60px);
}

/* Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Sidebar - Deep Dark Contrast */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid #1E293B;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid #1E293B;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #FFF;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFF;
    font-size: 20px;
    box-shadow: var(--shadow-glow);
}

.brand-text {
    font-size: 18px;
    font-weight: 800;
    color: #FFF;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.3px;
}

.sidebar-menu {
    padding: 24px 16px;
    flex: 1;
    overflow-y: auto;
}

.menu-category {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #64748B;
    font-weight: 700;
    margin: 20px 12px 10px 12px;
}

.menu-category:first-child {
    margin-top: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    margin-bottom: 4px;
    position: relative;
}

.nav-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    transition: transform 0.2s ease;
}

.nav-link:hover {
    color: #FFF;
    background: rgba(255, 255, 255, 0.06);
}

.nav-link:hover i {
    transform: translateX(2px);
}

.nav-link.active {
    color: #FFF;
    background: var(--sidebar-active-bg);
    font-weight: 600;
    box-shadow: var(--shadow-glow);
}

.nav-link.active i {
    color: #FFF;
}

.badge-count {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    color: #FFF;
}

.sidebar-user {
    padding: 16px;
    border-top: 1px solid #1E293B;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3B82F6, #7C3AED);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #FFF;
    font-size: 15px;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #FFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 12px;
    color: #94A3B8;
}

/* Main Container */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Header Navbar - Crisp White Header */
.app-header {
    height: var(--header-height);
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

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

.toggle-sidebar-btn {
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.toggle-sidebar-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-glow);
}

.search-box {
    position: relative;
    width: 320px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 14px;
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: #F8FAFC;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    text-decoration: none;
}

.icon-btn:hover {
    color: var(--primary);
    background: #FFFFFF;
    border-color: var(--primary);
}

.icon-btn .dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

/* Page Content Area */
.content-area {
    padding: 30px;
    flex: 1;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.page-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-dim);
    margin-top: 4px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #FFF;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-glow);
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
    opacity: 0.95;
}

.btn-secondary {
    background: #FFFFFF;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.btn-secondary:hover {
    background: #F8FAFC;
    border-color: #CBD5E1;
    color: var(--primary);
}

/* Crisp Clean Glass Cards */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 8px 30px -4px rgba(15, 23, 42, 0.08);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--card-color, var(--primary)), transparent);
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.metric-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--icon-bg, var(--primary-glow));
    color: var(--icon-color, var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.metric-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    margin-bottom: 8px;
}

.metric-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.trend-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.trend-badge.up {
    background: var(--success-bg);
    color: var(--success);
}

.trend-badge.down {
    background: var(--danger-bg);
    color: var(--danger);
}

.trend-text {
    color: var(--text-dim);
}

/* Charts Section */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.card-title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: #FFFFFF;
}

/* Table Styling - Clean White Striped Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    background: #F8FAFC;
    padding: 14px 18px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #475569;
    border-bottom: 2px solid var(--border-color);
}

.custom-table td {
    padding: 16px 18px;
    font-size: 14px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.custom-table tr:hover td {
    background: #F8FAFC;
}

/* Status Pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.status-pill.active {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.pending {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-pill.failed {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #FFF;
    margin: 0 auto 16px auto;
    box-shadow: var(--shadow-glow);
}

/* Responsiveness */
@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .search-box {
        display: none;
    }
}
