:root {
    --primary: #4f46e5;
    --primary-light: #eef2ff;
    --primary-dark: #3730a3;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 260px;
    --topbar-height: 56px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    --radius-lg: 1rem;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    html { font-size: 15px; }
}

body {
    font-family: var(--font-sans);
    background-color: var(--gray-50);
    color: var(--gray-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════
   SIDEBAR — White with subtle border
   ═══════════════════════════════════════════════ */
#sidebar {
    background: #ffffff !important;
    border-right: 1px solid var(--gray-200);
    min-width: var(--sidebar-width) !important;
    max-width: var(--sidebar-width);
    min-height: 100vh;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

#sidebar::-webkit-scrollbar {
    width: 4px;
}

#sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 2px;
}

#sidebar .sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

#sidebar .sidebar-brand h5 {
    color: var(--primary) !important;
    font-weight: 700;
    letter-spacing: -0.025em;
}

#sidebar .nav-link {
    color: var(--gray-600) !important;
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.875rem;
    margin: 0.125rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
}

#sidebar .nav-link i {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
    color: var(--gray-400);
    transition: color 0.15s ease;
}

#sidebar .nav-link:hover {
    background-color: var(--gray-100) !important;
    color: var(--gray-900) !important;
}

#sidebar .nav-link:hover i {
    color: var(--primary);
}

#sidebar .nav-link.active {
    background-color: var(--primary-light) !important;
    color: var(--primary) !important;
    font-weight: 600;
}

#sidebar .nav-link.active i {
    color: var(--primary);
}

#sidebar hr {
    border-color: var(--gray-200) !important;
    opacity: 1;
    margin: 0.75rem 0;
}

/* Sidebar nav wrapper */
#sidebar .sidebar-nav {
    padding: 0.75rem;
}

/* Nav divider */
#sidebar .nav-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.75rem 0;
    list-style: none;
}

/* Submenu parent arrow */
#sidebar .has-submenu .submenu-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    color: var(--gray-400);
}

#sidebar .has-submenu .nav-link[aria-expanded="true"] .submenu-arrow {
    transform: rotate(180deg);
}

/* Submenu items */
#sidebar .submenu {
    list-style: none;
    padding: 0 0 0 0.5rem;
    margin: 0;
    border-left: 2px solid var(--gray-200);
    margin-left: 1.25rem;
}

#sidebar .submenu .nav-link {
    font-size: 0.8125rem;
    padding: 0.4rem 0.75rem;
    color: var(--gray-500) !important;
    font-weight: 400;
}

#sidebar .submenu .nav-link:hover {
    color: var(--primary) !important;
    background-color: var(--primary-light) !important;
}

#sidebar .submenu .nav-link i {
    font-size: 0.875rem;
    width: 1.25rem;
}

/* ═══════════════════════════════════════════════
   TOP NAV BAR
   ═══════════════════════════════════════════════ */
.top-navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--gray-200);
    height: var(--topbar-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.top-navbar .page-title {
    font-size: 0.925rem;
    font-weight: 600;
    color: var(--gray-800);
}

/* ═══════════════════════════════════════════════
   CARDS — Premium elevated style
   ═══════════════════════════════════════════════ */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    background: #ffffff;
    border-bottom: 1px solid var(--gray-100);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body { padding: 1.25rem; }

.stat-card {
    border: none;
    border-radius: var(--radius-lg);
    background: #ffffff;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* ═══════════════════════════════════════════════
   BUTTONS — Professional styling
   ═══════════════════════════════════════════════ */
.btn {
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 1px 2px 0 rgb(79 70 229 / 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 6px -1px rgb(79 70 229 / 0.3);
    transform: translateY(-1px);
}

.btn:focus, .btn:active:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px rgb(79 70 229 / 0.15);
    border-color: var(--primary);
}

/* ═══════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════ */
.form-control, .form-select {
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
}

.form-label {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

/* ═══════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════ */
.table {
    font-size: 0.875rem;
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    border-bottom-width: 1px;
    padding: 0.75rem 1rem;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: var(--gray-50);
}

/* ═══════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════ */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: 9999px;
    letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════════ */
main.content-area {
    padding: 1.75rem 2rem;
    min-height: calc(100vh - var(--topbar-height) - 45px);
}

/* ═══════════════════════════════════════════════
   STICKY FOOTER
   ═══════════════════════════════════════════════ */
.platform-footer {
    background: #ffffff;
    border-top: 1px solid var(--gray-200);
    padding: 0.75rem 2rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.platform-footer a {
    color: var(--gray-500);
    text-decoration: none;
    transition: color 0.15s;
}

.platform-footer a:hover {
    color: var(--primary);
}

/* ═══════════════════════════════════════════════
   LANDING PAGE STYLES
   ═══════════════════════════════════════════════ */
.landing-hero {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #2563eb 100%);
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.landing-navbar {
    /*background: rgba(255,255,255,0.05);*/
    background: #f44336eb;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.landing-navbar .nav-link {
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.15s;
}

.landing-navbar .nav-link:hover {
    color: #ffffff;
}

.hero-content {
    position: relative;
    z-index: 1;
    color: #ffffff;
    padding: 6rem 0;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

@media (max-width: 767.98px) {
    .hero-title { font-size: 2.25rem; }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.7;
    max-width: 540px;
}

.hero-cta .btn-light {
    background: #ffffff;
    color: var(--primary);
    font-weight: 600;
    padding: 0.85rem 2.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: none;
    font-size: 1rem;
}

.hero-cta .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.hero-cta .btn-outline-light {
    border: 2px solid rgba(255,255,255,0.4);
    color: #ffffff;
    font-weight: 600;
    padding: 0.85rem 2.25rem;
    border-radius: var(--radius);
    font-size: 1rem;
}

.hero-cta .btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
    border-color: #ffffff;
}

.landing-section {
    padding: 5rem 0;
}

.landing-section.alt-bg {
    background: var(--gray-50);
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--gray-900);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto;
}

.feature-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem;
    background: #ffffff;
    height: 100%;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.feature-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.pricing-card {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    background: #ffffff;
    text-align: center;
    transition: all 0.3s ease;
}

.pricing-card.featured {
    border-color: var(--primary);
    box-shadow: var(--shadow-xl);
    transform: scale(1.03);
    position: relative;
}

.pricing-card:hover {
    box-shadow: var(--shadow-lg);
}

.landing-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 4rem 0 2rem;
}

.landing-footer h6 {
    color: #ffffff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.landing-footer a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 2;
    transition: color 0.15s;
}

.landing-footer a:hover {
    color: #ffffff;
}

.landing-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    margin-top: 3rem;
}

/* ═══════════════════════════════════════════════
   MOBILE RESPONSIVE SIDEBAR
   ═══════════════════════════════════════════════ */
@media (max-width: 767.98px) {
    #sidebar {
        position: fixed;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: none;
    }
    #sidebar.show {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1040;
        display: none;
        backdrop-filter: blur(2px);
    }
    .sidebar-backdrop.show {
        display: block;
    }
    main.content-area {
        padding: 1.25rem 1rem;
    }
}

/* ═══════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════ */
.min-vh-75 { min-height: 75vh; }
.text-purple { color: #6f42c1 !important; }
.bg-purple { background-color: #6f42c1 !important; }

.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 4px;
    min-height: 1rem;
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.badge-pulse { animation: pulse 2s infinite; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* Kanban */
.kanban-column { min-width: 300px; max-width: 300px; }
.kanban-card { cursor: grab; transition: box-shadow 0.15s; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.sortable-ghost { opacity: 0.4; background: #e3f2fd; }

/* Sortable tables */
.table-sortable th[data-sort] { cursor: pointer; user-select: none; position: relative; }
.table-sortable th[data-sort]:hover { background-color: var(--gray-50); }
.table-sortable th[data-sort]::after { content: " \2195"; opacity: 0.3; font-size: 0.7em; }
.table-sortable th[data-sort][data-order="asc"]::after { content: " \2191"; opacity: 0.8; color: var(--primary); }
.table-sortable th[data-sort][data-order="desc"]::after { content: " \2193"; opacity: 0.8; color: var(--primary); }

/* Toast notifications */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass card */
.glass-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-lg);
}

.nav-link { transition: all 0.15s ease; }

.alert {
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.progress {
    border-radius: 9999px;
    background: var(--gray-100);
}

.progress-bar {
    border-radius: 9999px;
}

/* Module nav (HR, CRM sub-navs) */
.navbar.bg-white.border-bottom {
    border-radius: var(--radius) !important;
    border: 1px solid var(--gray-200) !important;
    box-shadow: var(--shadow-sm);
}
