:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-main: #f1f5f9;
    --bg-sidebar: #0f172a;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --sidebar-w: 260px;
    --header-h: 64px;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    font-size: 0.875rem; /* Scaled down from default */
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Refined */
.sidebar {
    width: var(--sidebar-w);
    background-color: var(--bg-sidebar);
    color: #ffffff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1030; /* Bootstrap fixed-top is 1030 */
    transition: all 0.3s;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.logo {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    height: var(--header-h);
}

.nav-menu {
    padding: 0.75rem 0.6rem;
}

.nav-group-title {
    font-size: 0.6rem;
    color: #64748b;
    padding: 0.75rem 0.75rem 0.4rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.875rem;
    color: #94a3b8;
    text-decoration: none !important;
    border-radius: 6px;
    font-size: 0.825rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 0.2rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.nav-link.active {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.nav-link i {
    width: 18px;
    text-align: center;
    margin-right: 10px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0; /* Important for flex child with overflow */
}

.header-bar {
    height: var(--header-h);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.content-body {
    padding: 1.5rem;
}

h3 { font-size: 1.5rem !important; }
h5 { font-size: 1.15rem !important; }
h6 { font-size: 0.95rem !important; }

/* Re-skinning Bootstrap for Premium look */
.card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.1);
}

.btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 7px;
    transition: all 0.2s;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.775rem;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* DataTables Reskinning */
.dataTables_wrapper .dataTables_length, 
.dataTables_wrapper .dataTables_filter, 
.dataTables_wrapper .dataTables_info, 
.dataTables_wrapper .dataTables_processing, 
.dataTables_wrapper .dataTables_paginate {
    color: var(--text-muted) !important;
    font-size: 0.8rem;
}

table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    font-size: 0.85rem;
}

table.dataTable thead th {
    background-color: #f8fafc !important;
    color: var(--text-muted) !important;
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid var(--border-color) !important;
}

table.dataTable tbody td {
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    color: white !important;
    border: 1px solid var(--primary) !important;
    border-radius: 6px !important;
}

/* Form Styling */
.form-label {
    font-weight: 600;
    font-size: 0.825rem;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.form-control, .form-select {
    border-radius: 7px;
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

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

/* Custom Modal */
.modal-overlay {
    display: none;
    align-items: center;
    justify-content: center;
}
