:root {
    /* Corporate Palette - Slate & Indigo */
    --primary-color: #4338ca;
    /* Indigo 700 */
    --primary-hover: #3730a3;
    /* Indigo 800 */
    --secondary-color: #64748b;
    /* Slate 500 */
    --accent-color: #0ea5e9;
    /* Sky 500 */

    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;

    /* Backgrounds */
    --dark-bg: #0f172a;
    /* Slate 900 */
    --light-bg: #f1f5f9;
    /* Slate 100 */
    --card-bg: #ffffff;
    --sidebar-bg: #1e293b;
    /* Slate 800 */

    /* Text */
    --text-primary: #1e293b;
    /* Slate 800 */
    --text-secondary: #64748b;
    /* Slate 500 */
    --text-light: #94a3b8;
    /* Slate 400 */
    --text-white: #f8fafc;

    /* System */
    --border-color: #e2e8f0;
    /* Slate 200 */
    --border-radius: 8px;
    /* Sharper, more professional radius */
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s ease-in-out;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-primary);
    font-size: 0.875rem;
    /* 14px base size */
    line-height: 1.5;
    overflow-x: hidden;
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--dark-bg);
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

h1 {
    font-size: 1.875rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

h4 {
    font-size: 1.125rem;
}

h5 {
    font-size: 1rem;
}

.small,
small {
    font-size: 0.75rem;
}

.text-muted {
    color: var(--text-secondary) !important;
}

/* Base Components */
a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 1.25rem;
}

/* Buttons */
.btn {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 6px -1px rgba(67, 56, 202, 0.4);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

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

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Form Controls */
.form-control,
.form-select {
    font-size: 0.875rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 0.55rem 0.85rem;
    color: var(--text-primary);
    background-color: #fff;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1);
}

.form-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

/* Navigation / Sidebar */
#sidebar-wrapper {
    min-height: 100vh;
    margin-left: -16rem;
    transition: margin .25s ease-out;
    background: var(--sidebar-bg);
    border-right: none;
    width: 16rem;
}

#sidebar-wrapper .sidebar-heading {
    padding: 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-white);
    background: rgba(0, 0, 0, 0.1);
    letter-spacing: 0.05em;
}

#sidebar-wrapper .list-group {
    width: 16rem;
    padding: 1rem 0;
}

.sidebar-item {
    border: none;
    padding: 0.75rem 1.5rem;
    color: var(--text-light);
    font-weight: 500;
    background: transparent;
    display: flex;
    align-items: center;
    border-left: 3px solid transparent;
}

.sidebar-item i {
    width: 1.5rem;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 1rem;
}

.sidebar-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
}

.sidebar-item.active {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    border-left-color: var(--accent-color);
}

#page-content-wrapper {
    min-width: 100vw;
    background-color: var(--light-bg);
}

#wrapper.toggled #sidebar-wrapper {
    margin-left: 0;
}

/* Stats Cards */
.stats-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stats-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stats-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stats-value {
    color: var(--dark-bg);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Tables */
.table {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0;
}

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

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

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

/* Badges */
.badge {
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 4px;
    font-size: 0.75em;
}

.badge-soft-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-soft-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-soft-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-soft-primary {
    background-color: #e0e7ff;
    color: #3730a3;
}

/* Helpers */
.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.fw-medium {
    font-weight: 500;
}

.fw-semibold {
    font-weight: 600;
}

@media (min-width: 768px) {
    #sidebar-wrapper {
        margin-left: 0;
    }

    #page-content-wrapper {
        min-width: 0;
        width: 100%;
        margin-left: 0;
        /* Updated for flex layout usually, but ensuring standard bootstrap wrapper behavior */
    }

    #wrapper.toggled #sidebar-wrapper {
        margin-left: -16rem;
    }
}