:root {
    --gs-primary: #2f8ddd;
    --gs-primary-dark: #256fae;
    --gs-primary-darker: #1f5d91;
    --gs-page-bg: #f5f7fb;
    --gs-panel-head: #e6f0fa;
    --gs-panel-border: #d8e1ec;
    --gs-soft-blue: #dceef8;
    --gs-soft-green: #e4f3de;
    --gs-soft-yellow: #fff7d8;
    --gs-soft-slate: #eef1f5;
    --gs-text: #263238;
    --gs-muted: #6c7a89;
    --gs-navbar-height: 52px;
}

html {
    font-size: 14px;
}

body.gs-app-body {
    min-height: 100vh;
    margin: 0;
    background: var(--gs-page-bg);
    color: var(--gs-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.gs-page {
    min-height: 100vh;
}

.gs-topbar {
    min-height: var(--gs-navbar-height);
    padding: 0;
    border: 0;
    background: var(--gs-primary);
    box-shadow: 0 1px 0 rgb(0 0 0 / 8%);
}

.gs-navbar-container {
    min-height: var(--gs-navbar-height);
    padding-inline: 0 1rem;
}

.gs-brand {
    position: relative;
    align-self: stretch;
    min-width: 190px;
    margin: 0 1rem 0 0;
    padding: 0 1.8rem 0 1.15rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    color: #fff !important;
    background: var(--gs-primary-dark);
    overflow: visible;
}

.gs-brand::after {
    content: "";
    position: absolute;
    top: 0;
    right: -22px;
    width: 44px;
    height: 100%;
    background: var(--gs-primary-dark);
    transform: skewX(-38deg);
    transform-origin: top;
    z-index: 0;
}

.gs-brand-mark,
.gs-brand-text {
    position: relative;
    z-index: 1;
}

.gs-brand-mark {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    color: var(--gs-primary-dark);
    background: #fff;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.gs-brand-text {
    font-size: 1.2rem;
    font-weight: 650;
    white-space: nowrap;
}

.gs-main-nav {
    gap: .1rem;
    margin-left: .6rem;
}

.gs-topbar .nav-link {
    min-height: var(--gs-navbar-height);
    padding: .8rem .72rem;
    display: flex;
    align-items: center;
    gap: .35rem;
    color: rgb(255 255 255 / 92%);
    font-weight: 600;
    border-radius: 0;
}

.gs-topbar .nav-link:hover,
.gs-topbar .nav-link:focus,
.gs-topbar .nav-item.show > .nav-link,
.gs-topbar .nav-link.active {
    color: #fff;
    background: rgb(0 0 0 / 12%);
}

.gs-topbar .nav-link-icon {
    width: 18px;
    height: 18px;
    margin: 0;
    opacity: 1;
}

.gs-user-nav {
    align-items: center;
    gap: .45rem;
}

.gs-user-nav > .nav-item > .nav-link {
    min-height: auto;
}

.gs-user-name {
    color: #fff;
    font-weight: 600;
}

.gs-user-role {
    color: rgb(255 255 255 / 70%);
}

.gs-avatar {
    color: var(--gs-primary-dark);
    background: #fff;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 30%);
}

.gs-notification-dot {
    position: absolute;
    top: .55rem;
    right: .35rem;
    width: 8px;
    height: 8px;
    min-width: 8px;
    padding: 0;
    border: 2px solid var(--gs-primary);
    border-radius: 999px;
}

.gs-notification-menu {
    min-width: 300px;
}

.gs-dropdown-menu {
    --tblr-dropdown-padding-y: .35rem;
    min-width: 220px;
    border-color: #cdd8e5;
    border-radius: .35rem;
    box-shadow: 0 8px 24px rgb(31 45 61 / 16%);
}

.gs-dropdown-menu .dropdown-item {
    padding: .6rem .85rem;
    font-size: .92rem;
}

.gs-dropdown-menu .dropdown-item:hover,
.gs-dropdown-menu .dropdown-item:focus {
    color: #fff;
    background: var(--gs-primary);
}

.gs-module-nav {
    min-height: 43px;
    display: flex;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--gs-panel-border);
    box-shadow: 0 1px 2px rgb(31 45 61 / 4%);
}

.gs-module-nav .nav {
    min-height: 43px;
    align-items: center;
    gap: .15rem;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.gs-module-nav .nav-link {
    padding: .72rem .8rem;
    color: #526273;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 0;
    border-bottom: 2px solid transparent;
}

.gs-module-nav .nav-link:hover,
.gs-module-nav .nav-link.active {
    color: var(--gs-primary-dark);
    background: #f4f9fe;
    border-bottom-color: var(--gs-primary);
}

.gs-page-header {
    margin: 0;
    padding: 1rem 0 .45rem;
    background: #fff;
}

.gs-page-title {
    color: #202b33;
    font-size: 1.6rem;
    font-weight: 650;
    letter-spacing: -.02em;
}

.gs-context-label {
    color: var(--gs-primary-dark) !important;
    font-size: .72rem;
    letter-spacing: .06em;
}

.gs-page-badges {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem;
}

.gs-page-body {
    padding-top: .45rem;
    padding-bottom: 1.25rem;
    background: #fff;
}

.gs-manage-body,
.gs-detail-body {
    padding-top: .6rem;
}

.gs-footer {
    margin-top: 0;
    padding: 1rem 0;
    background: var(--gs-page-bg);
    border-top: 1px solid #e1e7ef;
}

/* Dashboard cards */
.gs-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .65rem;
    margin-bottom: .85rem;
}

.gs-metric-card {
    min-height: 100px;
    border: 1px solid transparent;
    border-radius: .25rem;
    box-shadow: none;
}

.gs-metric-card .card-body {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1rem 1.1rem;
}

.gs-metric-card--blue { background: var(--gs-soft-blue); }
.gs-metric-card--green { background: var(--gs-soft-green); }
.gs-metric-card--slate { background: var(--gs-soft-slate); }
.gs-metric-card--yellow { background: var(--gs-soft-yellow); }

.gs-metric-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: .35rem;
    color: var(--gs-primary);
    background: rgb(255 255 255 / 65%);
}

.gs-metric-card--green .gs-metric-icon { color: #2fb01b; }
.gs-metric-card--slate .gs-metric-icon { color: #253344; }
.gs-metric-card--yellow .gs-metric-icon { color: #f2ad00; }

.gs-metric-icon svg {
    width: 30px;
    height: 30px;
}

.gs-metric-label {
    margin-bottom: .1rem;
    color: #394957;
    font-size: .9rem;
}

.gs-metric-value {
    color: #111827;
    font-size: 1.65rem;
    font-weight: 650;
    line-height: 1.05;
}

.gs-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.05fr) minmax(300px, 1fr);
    gap: .8rem;
}

.gs-stack {
    display: grid;
    gap: .8rem;
    align-content: start;
}

.gs-panel {
    border: 1px solid var(--gs-panel-border);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.gs-panel .card-header {
    min-height: 44px;
    padding: .65rem .8rem;
    background: var(--gs-panel-head);
    border-bottom: 1px solid var(--gs-panel-border);
}

.gs-panel .card-title {
    font-size: 1.1rem;
    font-weight: 500;
}

.gs-panel-heading-icon {
    width: 20px;
    height: 20px;
    margin-right: .35rem;
}

.gs-chart-placeholder {
    min-height: 360px;
    padding: 2rem 2rem 1.2rem;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 12%;
    background:
        repeating-linear-gradient(to top, transparent 0, transparent 79px, #e6ebf1 80px),
        #fff;
}

.gs-chart-bar {
    width: min(26%, 280px);
    min-width: 80px;
    border-radius: .25rem .25rem 0 0;
    background: #2fa8ec;
}

.gs-chart-caption {
    padding: .65rem;
    color: var(--gs-muted);
    text-align: center;
    border-top: 1px solid #edf1f5;
}

.gs-compact-table {
    margin: 0;
}

.gs-compact-table > :not(caption) > * > * {
    padding: .48rem .55rem;
    vertical-align: middle;
}

.gs-quick-links {
    margin: 0;
    padding: .75rem 1rem;
    display: grid;
    gap: .6rem;
    list-style: none;
}

.gs-quick-links a {
    display: flex;
    align-items: center;
    gap: .55rem;
    color: #182433;
    text-decoration: none;
}

.gs-quick-links a:hover {
    color: var(--gs-primary-dark);
}

/* Manage pages */
.gs-filter-card {
    border: 1px solid #d7e5f2;
    border-radius: 0;
    background: #eaf4fc;
    box-shadow: none;
}

.gs-filter-row {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.gs-filter-row .form-control,
.gs-filter-row .form-select {
    min-height: 38px;
}

.gs-manage-card {
    border: 1px solid #e0e6ed;
    border-radius: 0;
    box-shadow: none;
}

.gs-manage-table {
    margin: 0;
    font-size: .92rem;
}

.gs-manage-table thead th {
    padding: .72rem .65rem;
    color: #182433;
    font-weight: 700;
    background: #e6f0fa;
    border-bottom: 1px solid #d8e1ec;
}

.gs-manage-table tbody td {
    padding: .78rem .65rem;
    border-color: #edf1f5;
}

.gs-manage-table tbody tr:nth-child(even) td {
    background: #f1f6fc;
}

.gs-action-button {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    color: #273444;
    background: #eef2f7;
}

.gs-action-button:hover {
    background: #dfe7f0;
}

/* Detail pages */
.gs-detail-header {
    padding-bottom: .7rem;
}

.gs-entity-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem .75rem;
    color: #445365;
}

.gs-detail-tabs {
    background: #fff;
    border-top: 1px solid #edf1f5;
    border-bottom: 1px solid var(--gs-panel-border);
}

.gs-detail-tabs .nav-tabs {
    border: 0;
    gap: 5px;
}

.gs-detail-tabs .nav-link {
    margin: 0;
    padding: .75rem .9rem;
    color: #5c6875;
    background: #edf2f7;
    border: 0;
    border-radius: 0;
}

.gs-detail-tabs .nav-link.active {
    color: #1f2d3d;
    background: #fff;
    box-shadow: inset 0 3px 0 var(--gs-primary);
}

.gs-detail-side .card,
.gs-detail-main > .card {
    border: 1px solid var(--gs-panel-border);
    border-radius: 0;
    box-shadow: none;
}

.gs-side-list .list-group-item {
    padding: .65rem .75rem;
}

.gs-side-list .list-group-item.active {
    color: #fff;
    background: var(--gs-primary);
    border-color: var(--gs-primary);
}

.gs-record-avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    border-radius: .25rem;
    color: #1f5f95;
    background: linear-gradient(145deg, #d7edff, #73b9ed);
    font-weight: 700;
}

.gs-form-card .card-body {
    padding: 1.1rem 1.2rem;
}

.gs-form-grid {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: .75rem 1rem;
    align-items: center;
}

.gs-form-grid .form-label {
    margin: 0;
    color: #44515f;
}

.gs-form-grid .form-control,
.gs-form-grid .form-select {
    min-height: 40px;
}

.gs-branch-list .form-check {
    margin: 0;
    padding: .7rem .8rem .7rem 2.2rem;
    border-bottom: 1px solid #dfe6ee;
}

.gs-branch-list .form-check:last-child {
    border-bottom: 0;
}

.gs-soft-panel {
    background: #eef6ff;
}

@media (max-width: 1199.98px) {
    .gs-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .gs-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gs-form-grid {
        grid-template-columns: 1fr;
        gap: .35rem;
    }
}

@media (max-width: 767.98px) {
    :root { --gs-navbar-height: 50px; }

    html { font-size: 14px; }

    .gs-navbar-container {
        padding-right: .5rem;
    }

    .gs-brand {
        min-width: auto;
        padding-left: .8rem;
        padding-right: 1rem;
    }

    .gs-brand::after { display: none; }
    .gs-brand-text { display: none; }

    .gs-topbar .navbar-collapse {
        padding: .4rem .65rem .75rem;
        background: var(--gs-primary-dark);
    }

    .gs-main-nav {
        margin-left: 0;
    }

    .gs-topbar .nav-link {
        min-height: 42px;
        border-radius: .25rem;
    }

    .gs-page-header {
        padding-top: .75rem;
    }

    .gs-page-title {
        font-size: 1.35rem;
    }

    .gs-metric-grid {
        grid-template-columns: 1fr;
    }

    .gs-filter-row {
        align-items: stretch;
        flex-direction: column;
    }

    .gs-chart-placeholder {
        min-height: 260px;
        padding-inline: 1rem;
    }
}
