:root {
    --primary: #0d6efd;
    --primary-dark: #0747a6;
    --line: #e7edf5;
    --soft: #f5f8fc;
    --ink: #172033;
    --muted: #697586;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--soft);
    color: var(--ink);
    font-family: "Prompt", sans-serif;
    font-size: 12px;
    line-height: 1.45;
}

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

.sidebar {
    position: sticky;
    top: 0;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 14px;
    transition: width 0.2s ease, padding 0.2s ease, border-color 0.2s ease, opacity 0.15s ease;
    overflow: hidden;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 12px;
    white-space: nowrap;
}

.brand-mark {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #fff;
    background: var(--primary);
}

.nav-scroll {
    overflow-y: auto;
    padding-right: 4px;
}

.menu-title {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    margin: 18px 0 8px;
    white-space: nowrap;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 32px;
    padding: 7px 8px;
    border-radius: 8px;
    color: #344054;
    text-decoration: none;
    margin-bottom: 3px;
    font-size: 12px;
    white-space: nowrap;
}

.menu-link i {
    width: 18px;
    text-align: center;
}

.menu-link:hover,
.menu-link.active {
    color: var(--primary-dark);
    background: #eaf2ff;
}

.logout {
    margin-top: auto;
    color: #b42318;
}

.app-main {
    min-width: 0;
    flex: 1;
    transition: margin 0.2s ease;
}

.topbar {
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 18px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.topbar h1 {
    font-size: 16px;
    line-height: 1.3;
    margin: 0;
    font-weight: 700;
}

.content-wrap {
    padding: 14px;
}

.sidebar-toggle {
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
}

.sidebar-hidden .sidebar,
body.sidebar-hidden .sidebar {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding-left: 0;
    padding-right: 0;
    border-right-color: transparent;
    opacity: 0;
    pointer-events: none;
}

.sidebar-hidden .sidebar .brand,
.sidebar-hidden .sidebar .nav-scroll,
.sidebar-hidden .sidebar .logout,
body.sidebar-hidden .sidebar .brand,
body.sidebar-hidden .sidebar .nav-scroll,
body.sidebar-hidden .sidebar .logout {
    visibility: hidden;
}

.metric-card,
.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(17, 24, 39, 0.04);
}

.metric-card {
    padding: 12px;
    min-height: 88px;
}

.metric-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.metric-number {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
}

.panel {
    padding: 12px;
}

.table,
.form-control,
.form-select,
.btn,
.dropdown-menu,
.modal-body,
.modal-footer,
.modal-header {
    font-size: 12px;
}

.table > :not(caption) > * > * {
    padding: 0.35rem 0.45rem;
}

.form-control,
.form-select,
.btn {
    min-height: 32px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.btn-sm {
    min-height: 28px;
    padding: 0.15rem 0.4rem;
    font-size: 12px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
}

.btn {
    border-radius: 8px;
}

.form-control,
.form-select {
    border-radius: 8px;
}

.modal-content {
    border-radius: 8px;
    border: 0;
}

.required::after {
    content: " *";
    color: #dc3545;
}

@media (max-width: 991.98px) {
    .content-wrap {
        padding: 14px;
    }

    .topbar {
        padding: 12px 14px;
    }

    .topbar h1 {
        font-size: 15px;
    }
}
