@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css");

:root {
    /* Color Palette - HSL for easy opacity and variation */
    --primary-h: 222;
    --primary-s: 47%;
    --primary-l: 11%;
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    
    --accent-h: 199;
    --accent-s: 89%;
    --accent-l: 48%;
    --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
    
    --success: hsl(142, 71%, 45%);
    --warning: hsl(38, 92%, 50%);
    --danger: hsl(0, 84%, 60%);
    
    --text-main: hsl(215, 25%, 27%);
    --text-muted: hsl(215, 16%, 47%);
    --bg-main: hsl(210, 40%, 98%);
    --bg-card: #ffffff;
    
    --sidebar-width: 260px;
    --sidebar-collapsed: 80px;
    --header-height: 70px;
    
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(226, 232, 240, 0.8);
    --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    padding: 1.5rem 2rem;
    transition: margin-left 0.3s ease, padding 0.3s ease;
}

@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0 !important;
        padding: 1rem;
        width: 100%;
    }
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--primary);
    color: white;
    z-index: 1045;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }
}

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.55);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: 1040;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.nav-item {
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 4px solid transparent;
    font-size: 0.9rem;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-left-color: var(--accent);
}

/* Cards & Components */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.825rem;
    color: var(--text-muted);
}

td {
    padding: 0.85rem 1rem;
    border-top: 1px solid #f1f5f9;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade {
    animation: fadeIn 0.35s ease forwards;
}

/* Extra Mobile Optimizations */
@media (max-width: 576px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }

    .page-header .d-flex {
        width: 100%;
    }

    .page-header .btn {
        flex: 1;
        justify-content: center;
    }
}

/* Global Action Icon Buttons */
.btn-icon-action {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    font-size: 0.95rem;
    line-height: 1;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    text-decoration: none;
}

.btn-icon-action:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.15);
}

.btn-icon-action:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

