:root {
    --sd-primary: #173b67;
    --sd-primary-dark: #102f55;
    --sd-bg: #f5f7fa;
    --sd-border: #e7ebef;
    --sd-text: #18212b;
    --sd-muted: #667482;
    --sd-navbar-height: 62px;
}

html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background: var(--sd-bg);
    color: var(--sd-text);
    overflow-x: hidden;
    text-align: right;
}

.app-bg, .login-bg { background: var(--sd-bg); color: var(--sd-text); }
a { text-decoration: none; }

.app-navbar {
    min-height: var(--sd-navbar-height);
    z-index: 1030;
}
.navbar-brand { margin: 0; color: var(--sd-primary); }
.navbar-brand:hover { color: var(--sd-primary-dark); }
.brand-name { line-height: 1; }
.brand-mark,
.brand-mini {
    display: inline-grid;
    place-items: center;
    background: var(--sd-primary);
    color: #fff;
    font-weight: 700;
    flex: 0 0 auto;
}
.brand-mark { width: 64px; height: 64px; border-radius: 18px; font-size: 1.35rem; }
.brand-mini { width: 36px; height: 36px; border-radius: 10px; font-size: .8rem; margin-left: .55rem; }
.nav-menu-btn { width: 40px; height: 38px; display: grid; place-items: center; padding: 0; }
.user-name { max-width: 180px; }

.app-shell { min-height: calc(100vh - var(--sd-navbar-height)); }
.sidebar {
    min-height: calc(100vh - var(--sd-navbar-height));
    position: sticky;
    top: var(--sd-navbar-height);
    align-self: flex-start;
    height: calc(100vh - var(--sd-navbar-height));
    overflow-y: auto;
}
.sidebar-nav .nav-link,
.mobile-nav .nav-link {
    color: #465362;
    padding: .75rem .85rem;
    border-radius: .7rem;
    min-height: 44px;
}
.sidebar-nav .nav-link:hover:not(.disabled),
.mobile-nav .nav-link:hover:not(.disabled) { background: #f0f4f8; color: var(--sd-primary); }
.sidebar-nav .nav-link.active,
.mobile-nav .nav-link.active { background: var(--sd-primary); color: #fff; }
.sidebar-nav .nav-link.disabled,
.mobile-nav .nav-link.disabled { color: #9aa5b1; opacity: 1; }
.nav-section { color: #8a96a3; font-size: .75rem; padding: 1.1rem .85rem .35rem; }

.app-main { min-width: 0; }
.page-heading { margin-bottom: 1.5rem; }

.btn-primary {
    --bs-btn-bg: var(--sd-primary);
    --bs-btn-border-color: var(--sd-primary);
    --bs-btn-hover-bg: var(--sd-primary-dark);
    --bs-btn-hover-border-color: var(--sd-primary-dark);
    --bs-btn-active-bg: var(--sd-primary-dark);
    --bs-btn-active-border-color: var(--sd-primary-dark);
}

.card { border-radius: 1rem; }
.card-header { border-bottom-color: var(--sd-border); }
.stat-card { min-height: 150px; }
.stat-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #eef3f8;
    color: var(--sd-primary);
    font-size: 1.2rem;
}
.module-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .9rem 0;
    border-bottom: 1px solid var(--sd-border);
}
.module-row:last-child { border-bottom: 0; }

.table-responsive { border-radius: inherit; }
.table { min-width: 680px; }
.table > :not(caption) > * > * { padding: .85rem 1rem; vertical-align: middle; }
.table thead th {
    white-space: nowrap;
    font-size: .875rem;
    color: #566270;
    background: #fafbfc;
    border-bottom-width: 1px;
}

.form-label { font-weight: 600; font-size: .9rem; }
.form-control, .form-select { min-height: 42px; }
.form-control:focus, .form-select:focus {
    border-color: #8aa8c9;
    box-shadow: 0 0 0 .2rem rgba(23, 59, 103, .10);
}

.login-card { max-width: 440px; border-radius: 1.25rem; }
.offcanvas { max-width: 320px; }
.alert { border-radius: .85rem; }

@media (max-width: 991.98px) {
    .app-main { width: 100%; }
}

@media (max-width: 575.98px) {
    :root { --sd-navbar-height: 58px; }
    .app-main { padding: 1rem !important; }
    .navbar-brand { font-size: .98rem; }
    .brand-mini { width: 32px; height: 32px; border-radius: 9px; }
    .user-actions { gap: .35rem !important; }
    .display-6 { font-size: 1.7rem; }
    .stat-card { min-height: 132px; }
    .stat-card .card-body { padding: .9rem; }
    .stat-icon { width: 38px; height: 38px; }
    .card-body { padding: 1rem; }
    .page-title-actions { align-items: stretch !important; }
    .page-title-actions .btn { width: 100%; }
    .table > :not(caption) > * > * { padding: .7rem .75rem; }
}

.preview-dl dt { color: var(--sd-muted); font-weight: 500; padding-top: .4rem; padding-bottom: .4rem; }
.preview-dl dd { margin-bottom: 0; padding-top: .4rem; padding-bottom: .4rem; overflow-wrap: anywhere; }
.allocation-row { padding-bottom: .75rem; border-bottom: 1px dashed var(--sd-border); }
.allocation-row:last-child { border-bottom: 0; }
.table tfoot td { background: #fafbfc; border-top: 2px solid var(--sd-border); }
@media (max-width: 575.98px) {
    .preview-dl dt { width: 44%; }
    .preview-dl dd { width: 56%; }
}
