:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4cc9f0;
    --success-color: #4cc9f0;
    --warning-color: #f72585;
    --dark-bg: #0f172a;
    --light-bg: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-dark-blue: #0f172a;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

html {
    font-size: 14px;
    height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    background-color: var(--light-bg);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin-bottom: 60px;
    background-attachment: fixed;
}

/* Glassmorphism Cards */
.card {
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 10px;
    padding: 10px 24px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    filter: brightness(1.2);
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(67, 97, 238, 0.4);
}

/* Forms */
.form-control {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #1e293b !important;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

/* Sidebar Navigation */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: 260px;
    max-width: 260px;
    background: var(--dark-bg);
    color: #fff;
    transition: all 0.3s;
    height: 100vh;
    position: fixed;
    z-index: 1000;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

#sidebar .sidebar-header {
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1001;
}

#sidebar .sidebar-category {
    padding: 20px 20px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    cursor: default;
}

#sidebar ul.components {
    padding: 10px 0;
}

#sidebar ul li a {
    padding: 12px 25px;
    font-size: 0.95rem;
    display: block;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
}

#sidebar ul li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--primary-color);
}

#sidebar ul li a.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

#sidebar ul li a i {
    width: 25px;
    font-size: 1.1rem;
}

/* Submenu Styles */
#sidebar ul li ul.collapse.show,
#sidebar ul li ul.collapsing {
    background: rgba(0, 0, 0, 0.15);
    list-style: none;
    padding: 0;
    margin: 0;
}

#sidebar ul li ul li a {
    padding-left: 50px;
    font-size: 0.88rem;
    border-left: 3px solid transparent;
}

#sidebar ul li a[data-bs-toggle="collapse"] {
    position: relative;
    display: flex;
    justify-content: space-between;
}

#sidebar ul li a[data-bs-toggle="collapse"]::after {
    display: inline-block;
    content: "\f107";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    transition: transform 0.3s;
    font-size: 0.8rem;
}

#sidebar ul li a[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.03);
}

#sidebar ul li a[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* Main Content Area */
#content {
    width: calc(100% - 260px);
    padding: 0;
    min-height: 100vh;
    transition: all 0.3s;
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--light-bg);
    display: flex;
    flex-direction: column;
}

.main-container {
    padding: 24px;
    flex-grow: 1;
}

/* Footer Styles */
.footer-modern {
    background: #fff;
    padding: 20px 30px;
    border-top: 1px solid #e2e8f0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

/* Header/Topbar */
.topbar {
    background: #fff;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar .page-title {
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0;
    color: var(--dark-bg);
}

@media (max-width: 768px) {
    #sidebar {
        margin-left: -260px;
    }

    #sidebar.active {
        margin-left: 0;
    }

    #content {
        width: 100%;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Modern Premium Table Class */
.table-modern {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.table-modern thead th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1.25rem 1rem;
    border-top: none;
    border-bottom: 2px solid #e2e8f0;
}

.table-modern tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.table-modern tbody tr {
    transition: all 0.2s ease;
}

.table-modern tbody tr:hover {
    background-color: #f1f5f9;
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

/* Badges for status */
.badge {
    padding: 0.5em 0.8em;
    font-weight: 500;
    border-radius: 6px;
}

.bg-success {
    background-color: #dcfce7 !important;
    color: #166534 !important;
}

.bg-danger {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

.bg-warning {
    background-color: #fef9c3 !important;
    color: #854d0e !important;
}

.bg-info {
    background-color: #e0f2fe !important;
    color: #075985 !important;
}

.bg-secondary {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

/* Form Validation Professional Styles */
.input-validation-error {
    border-color: #dc3545 !important;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.input-validation-error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.field-validation-error {
    font-size: 0.875em;
    color: #dc3545;
    margin-top: 0.25rem;
    display: block;
}

.field-validation-error::before {
    content: "✱ ";
    font-weight: bold;
}