@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary-color: #4f46e5; /* Indigo */
    --primary-hover: #4338ca;
    --secondary-color: #f1f5f9;
    --text-main: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */
    --bg-color: #f8fafc; /* Slate 50 */
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.025);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-bs-theme="dark"] {
    --secondary-color: #1e293b; /* Slate 800 */
    --text-main: #f8fafc; /* Slate 50 */
    --text-muted: #94a3b8; /* Slate 400 */
    --bg-color: #0f172a; /* Slate 900 */
    --card-bg: #1e293b; /* Slate 800 */
    --border-color: #334155; /* Slate 700 */
    
    /* Make shadow subtle on dark mode */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.5);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

/* CARDS */
.card, .bg-white.rounded.shadow-sm {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: var(--transition);
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

/* BUTTONS */
.btn {
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1.25rem;
    transition: var(--transition);
    letter-spacing: 0.01em;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    color: var(--text-muted);
    border-color: var(--border-color);
}
.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--text-main);
    border-color: var(--border-color);
}

/* INPUTS & FORMS */
.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: var(--card-bg);
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.input-group-text {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-muted);
}

/* TABLES */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-main);
    vertical-align: middle;
}
.table thead th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    background-color: var(--secondary-color);
}
.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}
.table-hover tbody tr:hover {
    background-color: var(--secondary-color);
}

/* BADGES */
.badge {
    font-weight: 600;
    padding: 0.4em 0.8em;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

/* MODALS */
.modal-header {
    position: relative;
    z-index: 10;
}
.modal-body.row {
    margin-top: 0 !important;
}

/* SIDEBAR - DESKTOP */
.sidebar {
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1040;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.sidebar-link i {
    width: 24px;
    font-size: 1.1rem;
    transition: var(--transition);
}

.sidebar-link:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.sidebar-link:hover i {
    transform: scale(1.1);
}

.sidebar-link.active {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

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

.sidebar-link.text-danger:hover {
    background-color: rgba(220, 38, 38, 0.1);
    color: #dc2626 !important;
}

/* MOBILE NAVBAR */
.mobile-navbar {
    display: none;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 1035;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* MOBILE OPTIMIZATIONS */
@media (max-width: 768px) {
    .d-flex.flex-column.flex-md-row {
        flex-direction: column !important;
    }
    
    .mobile-navbar {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px !important;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.show {
        transform: translateX(280px);
    }
    
    .mobile-overlay.show {
        display: block;
        opacity: 1;
    }
    
    .flex-grow-1 {
        padding: 1rem !important; /* Less padding on mobile */
    }
    
    /* Make tables swipeable nicely */
    .table-responsive {
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
    }
}
