:root {
    --oe-bg: #f5f7fb;
    --oe-surface: #ffffff;
    --oe-surface-muted: #f8fafc;
    --oe-border: #dce3ec;
    --oe-border-soft: #edf1f6;
    --oe-text: #1f2937;
    --oe-muted: #667085;
    --oe-primary: #155fc4;
    --oe-primary-hover: #0f4fa6;
    --oe-focus: rgba(21, 95, 196, 0.18);
    --oe-radius: 8px;
    --oe-radius-sm: 6px;
    --oe-shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
    --oe-shadow-sm: 0 4px 14px rgba(17, 24, 39, 0.06);
}

html {
    min-height: 100%;
}

body {
    background: var(--oe-bg);
    color: var(--oe-text);
    font-size: 0.95rem;
    letter-spacing: 0;
}

a {
    text-underline-offset: 2px;
}

.content-wrapper {
    background: var(--oe-bg);
    min-height: calc(100vh - 57px);
}

.content-wrapper.p-4 {
    padding: 1.25rem !important;
}

.content-header h1,
.content-header h2,
.content-header h3 {
    font-size: 1.35rem;
    line-height: 1.25;
    letter-spacing: 0;
}

.content-header .btn,
.content-header .btn-group .btn {
    white-space: nowrap;
}

.main-header.navbar {
    border-bottom: 1px solid var(--oe-border);
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.03);
    min-height: 57px;
}

.navbar .nav-link {
    border-radius: var(--oe-radius-sm);
    margin: 0 0.15rem;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    background: rgba(21, 95, 196, 0.08);
}

.navbar-search-group {
    min-height: 34px;
}

.navbar-search-group input {
    min-width: 260px !important;
}

.main-sidebar {
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.12) !important;
}

.brand-link {
    min-height: 57px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.brand-link .brand-text {
    font-size: 1rem;
    letter-spacing: 0;
}

.nav-sidebar {
    padding: 0.35rem 0;
}

.nav-sidebar .nav-header {
    margin-top: 0.75rem;
    padding: 0.55rem 1rem 0.25rem;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

.nav-sidebar .nav-link {
    min-height: 40px;
    border-radius: var(--oe-radius-sm);
    margin: 0.12rem 0.5rem;
    display: flex;
    align-items: center;
}

.nav-sidebar .nav-icon {
    width: 1.5rem;
    text-align: center;
    margin-right: 0.45rem !important;
}

.nav-sidebar .nav-link p {
    line-height: 1.2;
}

.nav-treeview {
    margin-bottom: 0.25rem;
}

.nav-treeview .nav-link {
    min-height: 34px;
    padding-left: 0.65rem;
    font-size: 0.9rem;
}

.card {
    border: 1px solid var(--oe-border-soft) !important;
    border-radius: var(--oe-radius) !important;
    box-shadow: var(--oe-shadow-sm) !important;
    overflow: hidden;
}

.card-header {
    border-bottom: 1px solid var(--oe-border-soft) !important;
}

.card-header.bg-white,
.card-header:not([class*="bg-"]) {
    background: linear-gradient(180deg, #fff, #fbfcfe) !important;
}

.card-title,
.card-header h4,
.card-header h5,
.card-header h6 {
    font-size: 1rem;
    line-height: 1.35;
}

.small-box {
    border-radius: var(--oe-radius) !important;
    box-shadow: var(--oe-shadow-sm) !important;
    min-height: 112px;
    overflow: hidden;
}

.small-box .inner h3 {
    font-size: 1.85rem;
    line-height: 1.1;
}

.btn {
    border-radius: var(--oe-radius-sm);
    font-weight: 600;
    letter-spacing: 0;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--oe-primary-hover);
    border-color: var(--oe-primary-hover);
}

.btn-xs {
    padding: 0.2rem 0.45rem;
    font-size: 0.78rem;
    line-height: 1.25;
    border-radius: var(--oe-radius-sm);
}

.form-control,
.form-select,
.input-group-text {
    border-color: #cfd8e3;
    border-radius: var(--oe-radius-sm);
}

.form-control,
.form-select {
    min-height: 38px;
}

.form-control-sm,
.form-select-sm,
.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text {
    min-height: 34px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--oe-primary);
    box-shadow: 0 0 0 0.2rem var(--oe-focus);
}

textarea.form-control {
    min-height: 96px;
}

.form-label {
    color: #344054;
    margin-bottom: 0.35rem;
}

.form-text,
.text-muted {
    color: var(--oe-muted) !important;
}

.table {
    color: var(--oe-text);
}

.table thead th {
    background: var(--oe-surface-muted);
    color: #475467;
    border-bottom: 1px solid var(--oe-border) !important;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

.table td,
.table th {
    vertical-align: middle;
}

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

.table-responsive {
    border-radius: var(--oe-radius);
}

.badge {
    border-radius: 999px;
    font-weight: 700;
    padding: 0.42em 0.65em;
    letter-spacing: 0;
}

.alert {
    border-radius: var(--oe-radius);
    border-width: 1px;
}

.dropdown-menu {
    border: 1px solid var(--oe-border-soft);
    border-radius: var(--oe-radius);
    box-shadow: var(--oe-shadow);
}

.dropdown-item {
    white-space: normal;
}

.modal-content {
    border: 0;
    border-radius: var(--oe-radius);
    box-shadow: var(--oe-shadow);
}

.modal-header,
.modal-footer {
    border-color: var(--oe-border-soft);
}

.pagination .page-link {
    border-color: var(--oe-border);
    color: var(--oe-primary);
}

.pagination .active .page-link,
.page-item.active .page-link {
    background-color: var(--oe-primary);
    border-color: var(--oe-primary);
}

.main-footer {
    border-top: 1px solid var(--oe-border);
    color: var(--oe-muted);
    font-size: 0.88rem;
}

.login-page {
    background:
        linear-gradient(135deg, rgba(21, 95, 196, 0.08), rgba(16, 185, 129, 0.08)),
        var(--oe-bg);
}

.login-box .card {
    box-shadow: var(--oe-shadow) !important;
}

.notesheet-container {
    border-radius: var(--oe-radius);
}

.dark-mode {
    --oe-bg: #111827;
    --oe-surface: #1f2937;
    --oe-surface-muted: #243244;
    --oe-border: #344054;
    --oe-border-soft: #2f3b4f;
    --oe-text: #e5e7eb;
    --oe-muted: #a8b3c5;
}

.dark-mode .content-wrapper,
.dark-mode body {
    background: var(--oe-bg);
    color: var(--oe-text);
}

.dark-mode .card,
.dark-mode .modal-content,
.dark-mode .dropdown-menu {
    background: var(--oe-surface);
    color: var(--oe-text);
    border-color: var(--oe-border-soft) !important;
}

.dark-mode .card-header.bg-white,
.dark-mode .card-header:not([class*="bg-"]) {
    background: #202b3a !important;
}

.dark-mode .table {
    color: var(--oe-text);
}

.dark-mode .table thead th,
.dark-mode .table-light {
    background: var(--oe-surface-muted) !important;
    color: #d0d7e2;
}

.dark-mode .table-hover tbody tr:hover {
    background-color: #263347;
}

.dark-mode .form-control,
.dark-mode .form-select,
.dark-mode .input-group-text {
    background-color: #162033;
    border-color: #3a4658;
    color: var(--oe-text);
}

.dark-mode .form-control::placeholder {
    color: #8793a6;
}

.dark-mode .main-footer {
    background: #1f2937;
}

@media (max-width: 991.98px) {
    .content-wrapper.p-4 {
        padding: 1rem !important;
    }

    .content-header .row {
        row-gap: 0.75rem;
    }

    .content-header .text-end {
        text-align: left !important;
    }

    .content-header .btn {
        margin-bottom: 0.35rem;
    }

    .table-responsive {
        border: 1px solid var(--oe-border-soft);
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: 0.9rem;
    }

    .content-wrapper.p-4 {
        padding: 0.8rem !important;
    }

    .content-header h1,
    .content-header h2,
    .content-header h3 {
        font-size: 1.15rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        max-width: 100%;
        white-space: normal;
    }

    .small-box {
        min-height: 96px;
    }

    .small-box .inner h3 {
        font-size: 1.55rem;
    }

    .main-footer .float-end {
        float: none !important;
        display: block !important;
        margin-top: 0.25rem;
    }
}
