:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --light: #f8fafc;
    --dark: #1e293b;
    --bg-body: #f1f5f9;
    --surface: #ffffff;
    --border-radius: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
    --font-heading: 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
}

/* Prevent layout shift from scrollbar appearing/disappearing */
html {
    overflow-y: scroll;
}

body {
    background-color: var(--bg-body);
    font-family: var(--font-body);
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--dark);
}

/* Sidebar structure */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

#sidebar {
    min-width: 250px;
    max-width: 250px;
    background: linear-gradient(180deg, var(--primary) 0%, #3730a3 100%);
    color: #fff;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

#sidebar .sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sidebar .sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
}

#sidebar ul.components {
    padding: 1rem 0;
    flex: 1;
}

#sidebar ul li {
    padding: 0;
}

#sidebar ul li a {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    display: block;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

#sidebar ul li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #fff;
}

#sidebar ul li a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-left-color: #fff;
    font-weight: 600;
}

#sidebar ul li a i {
    margin-right: 0.5rem;
    width: 1.25rem;
    text-align: center;
}

#sidebar .user-info {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

#content {
    width: 100%;
    padding: 2rem;
    min-height: 100vh;
    transition: all 0.3s;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, var(--primary) 0%, #3730a3 100%);
}

.login-card {
    background: var(--surface);
    border-radius: var(--border-radius);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards & Containers */
.card {
    background: var(--surface);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(79, 70, 229, 0.1);
}

.card-header {
    background: #f8fafc;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 1.25rem 1.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.75rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-outline-light {
    border: 1px solid var(--secondary);
    color: var(--secondary);
}

.btn-outline-light:hover {
    background: var(--light);
    color: var(--primary);
}

/* Tables */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: var(--light);
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--secondary);
    padding: 1rem;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: var(--light);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Forms */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.625rem 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Badges */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
}

/* Alerts */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -250px;
    }

    #sidebar.active {
        margin-left: 0;
    }

    #content {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .table-responsive {
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-sm);
    }
}

/* Fix Card Overflow */
.card-body,
.card-header,
.card-footer {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Professional Vertical KPI Card Layout */
.kpi-card {
    min-width: 0 !important;
    height: 100%;
}

.kpi-card .card-body {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    height: 100%;
    justify-content: center;
}

/* Icon container - Top position */
.kpi-card .rounded-circle {
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}

.kpi-card .rounded-circle i {
    font-size: 1.75rem !important;
}

.kpi-content {
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

/* KPI Title Styling - NO TRUNCATION */
.kpi-content h6 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary);
    margin: 0;
    line-height: 1.3;
    width: 100%;
    /* Full text display */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Professional KPI Value - NO TRUNCATION */
.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.025em;
    color: var(--dark);
    margin: 0;
    width: 100%;

    /* Full number display */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .kpi-value {
        font-size: 1.85rem;
    }

    .kpi-content h6 {
        font-size: 0.68rem;
    }
}

@media (max-width: 1200px) {
    .kpi-card .card-body {
        padding: 1.75rem 1.25rem;
    }

    .kpi-value {
        font-size: 1.75rem;
    }

    .kpi-content h6 {
        font-size: 0.65rem;
    }

    .kpi-card .rounded-circle {
        width: 3.5rem;
        height: 3.5rem;
    }

    .kpi-card .rounded-circle i {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 992px) {
    .kpi-card .card-body {
        padding: 1.5rem 1rem;
    }

    .kpi-value {
        font-size: 1.65rem;
    }
}

@media (max-width: 768px) {
    .card-body {
        padding: 1.25rem;
    }

    .kpi-card .card-body {
        padding: 1.5rem 1rem;
    }

    .kpi-value {
        font-size: 1.75rem;
    }

    .kpi-content h6 {
        font-size: 0.7rem;
    }

    .kpi-card .rounded-circle {
        width: 3rem;
        height: 3rem;
    }

    .kpi-card .rounded-circle i {
        font-size: 1.35rem !important;
    }
}