/* 
  AAGACONNECT PREMIUM DESIGN SYSTEM
  Modern SaaS Aesthetics with Glassmorphism & Dark Mode Support
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Primary Color Palette (Tailored HSL) */
    --primary-h: 222;
    --primary-s: 100%;
    --primary-l: 60%;

    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-dark: hsl(var(--primary-h), var(--primary-s), 45%);
    --primary-light: hsl(var(--primary-h), var(--primary-s), 75%);
    --primary-glow: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.3);

    --secondary: #6366f1;
    --accent: #f59e0b;

    /* Layout Colors (Dark Mode Default) */
    --bg-main: #0a0c10;
    --bg-side: #11141b;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-glass: rgba(31, 41, 55, 0.4);

    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;

    --border-glass: rgba(255, 255, 255, 0.08);
    --border-active: rgba(255, 255, 255, 0.15);

    /* Status Colors */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --glass-blur: blur(12px);

    /* Spacing */
    --sidebar-width: 280px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-glass);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-glow);
}

/* Layout Framework */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-side);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-glass);
}

.logo-wrapper img {
    height: 38px;
    width: auto;
}

.sidebar-content {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

.nav-group {
    margin-bottom: 2rem;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin: 0 0.75rem 0.75rem;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    margin-right: 1rem;
    font-size: 1.1rem;
}

.nav-item:hover {
    background: var(--bg-glass);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid var(--primary-glow);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-glass);
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-bar {
    height: var(--header-height);
    background: rgba(10, 12, 16, 0.8);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.page-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Glass Components */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    border-color: var(--border-active);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 54px;
    height: 54px;
    background: var(--bg-glass);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
}

.stat-info .value {
    font-size: 1.75rem;
    font-weight: 800;
    display: block;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-info .label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-main);
    border-color: var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Data Tables */
.table-container {
    overflow-x: auto;
    border-radius: 16px;
}

table {
    width: 100%;
    border-spacing: 0;
}

th {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    font-weight: 700;
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-glass);
    font-size: 0.9375rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Animations */
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInSlide 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Auth Pages Styling */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at top right, var(--primary-glow), transparent),
        radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.1), transparent);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}