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

:root {
    --primary-color: #4f46e5;
    /* Indigo 600 */
    --secondary-color: #ec4899;
    /* Pink 500 */
    --accent-color: #6366f1;
    /* Indigo 500 */
    --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: 1px solid rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-radius: 20px;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-main);
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--border-radius);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    padding: 2.5rem;
    transition: all 0.3s ease;
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.025em;
}

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

.bg-soft-primary {
    background-color: rgba(79, 70, 229, 0.1);
}

.bg-soft-secondary {
    background-color: rgba(236, 72, 153, 0.1);
}

.radius-12 {
    border-radius: 12px;
}

.radius-20 {
    border-radius: 20px;
}

/* Button Overrides */
.btn {
    border-radius: 12px;
    padding: 10px 24px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

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

.btn-primary:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-main);
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    transition: all 0.2s;
    font-size: 0.95rem;
}

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

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.navbar-brand img {
    max-height: 48px;
    transition: transform 0.3s ease;
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.nav-link {
    color: var(--text-main) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 10px;
    transition: all 0.2s;
}

.navbar-nav .nav-link:hover, 
.navbar-nav .nav-link.active {
    background-color: rgba(79, 70, 229, 0.08) !important;
    color: var(--primary-color) !important;
    font-weight: 600 !important;
}

/* Navbar Toggler (Hamburger) */
.navbar-toggler {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none !important;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230f172a'%3e%3cpath fill-rule='evenodd' d='M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e") !important;
}

/* Dropdown */
.dropdown-item.active, 
.dropdown-item:active {
    background-color: rgba(79, 70, 229, 0.08) !important;
    color: var(--primary-color) !important;
    font-weight: 600 !important;
}

.dropdown-item:hover {
    background-color: rgba(79, 70, 229, 0.04);
    color: var(--primary-color);
}

/* Table */
.table-responsive {
    border-radius: 16px;
    border: 1px solid #f1f5f9;
}

.table thead {
    background: #f8fafc;
    border-bottom: 2px solid #f1f5f9;
}

.table thead th {
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    border: none;
}

.table tbody td {
    padding: 1rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Utilities */
.text-gradient {
    background: linear-gradient(to right, #4f46e5, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 1.25rem;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Modal Styling Cleanup */
.modal-content {
    background: #ffffff;
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 1.5rem 2rem;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid #f1f5f9;
    padding: 1.5rem 2rem;
}

.modal-backdrop {
    background-color: #0f172a;
    backdrop-filter: blur(4px);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .glass-card {
        padding: 1.5rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-auto {
        width: auto !important;
    }

    .d-flex.gap-2 {
        gap: 0.5rem !important;
    }

    .navbar-brand img {
        max-height: 36px;
    }

    .table {
        border-collapse: separate;
        border-spacing: 0 1rem;
        width: 100% !important;
        margin-bottom: 0 !important;
    }

    .table thead {
        display: none;
    }

    .table-responsive {
        border: none;
        background: transparent;
        overflow-x: hidden !important;
        width: 100% !important;
    }

    .table tbody tr {
        display: block;
        position: relative;
        padding-top: 3.8rem;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        border: 1px solid #e2e8f0;
        margin-bottom: 1rem;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    .table tbody td[data-label="No"] {
        position: absolute;
        top: 0;
        left: 0;
        right: 50%;
        width: auto;
        height: 3.8rem;
        border-bottom: 1px solid #e2e8f0;
        text-align: left !important;
        padding: 0 1.25rem;
        justify-content: flex-start;
        align-items: center;
        font-weight: 700;
        color: var(--primary-color);
        background: #f8fafc;
        border-top-left-radius: 12px;
        border-right: none;
        min-height: auto;
    }
    .table tbody td[data-label="No"]::before {
        content: 'No. ' !important;
        position: static;
        width: auto;
        padding: 0;
        text-transform: none;
        color: var(--primary-color);
    }
    
    .table tbody td[data-label="Checkbox"] {
        position: absolute;
        top: 0;
        right: 0;
        left: 50%;
        width: auto;
        height: 3.8rem;
        border-bottom: 1px solid #e2e8f0;
        padding: 0 1.25rem;
        justify-content: flex-end;
        align-items: center;
        background: #f8fafc;
        border-top-right-radius: 12px;
        border-left: none;
        min-height: auto;
    }
    .table tbody td[data-label="Checkbox"]::before {
        display: none !important;
    }

    .mobile-collapse-row {
        width: 100%;
        text-align: center !important;
        padding: 0.75rem !important;
        background: #f8fafc;
        cursor: pointer;
        color: var(--primary-color);
        justify-content: center !important;
        font-size: 0.85rem;
        border-bottom: 1px solid #f1f5f9;
    }
    .mobile-collapse-row::before {
        display: none !important;
    }
    
    .table tbody td.collapse {
        display: none !important;
    }
    .table tbody td.collapse.show {
        display: flex !important;
    }

    .table tbody td {
        display: block;
        text-align: right !important;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #f1f5f9;
        min-height: 3rem;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    .table tbody td .justify-content-center {
        justify-content: flex-end !important;
    }

    .table tbody td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 50%;
        padding-left: 1rem;
        font-weight: 600;
        text-align: left;
        color: #64748b;
        font-size: 0.75rem;
        text-transform: uppercase;
    }

    .table tbody td:last-child {
        border-bottom: 2px solid #e2e8f0;
        padding-bottom: 1.5rem;
    }
}