:root {
    --gs-font-family: 'Inter', sans-serif;

    --gs-bg: #F3F3EB;
    --gs-surface: #FFFFFF;
    --gs-surface-soft: #F8F8F4;
    --gs-surface-muted: #F6F6F1;

    --gs-border: #E7E7DE;
    --gs-border-soft: rgba(0, 0, 0, 0.04);

    --gs-text: #2F332F;
    --gs-text-soft: #7B7F78;
    --gs-heading: #1F231F;

    --gs-primary: #038E36;
    --gs-primary-dark: #02762D;
    --gs-primary-soft: #E3F8DF;
    --gs-primary-soft-2: #F1FAEE;

    --gs-dark-btn: #232823;

    --gs-danger: #E2685F;
    --gs-warning: #E9B13C;
    --gs-success: #69B77C;

    --gs-blue-soft: #EFF8FF;
    --gs-orange-soft: #FFF4ED;
    --gs-red-soft: #FEF3F2;
    --gs-yellow-soft: #FFFAEB;
    --gs-success-soft: #ECFDF3;

    --gs-shadow-sm: 0 4px 12px rgba(24, 30, 24, 0.03);
    --gs-shadow-md: 0 10px 26px rgba(24, 30, 24, 0.05);

    --gs-radius-xs: 8px;
    --gs-radius-sm: 10px;
    --gs-radius-md: 16px;
    --gs-radius-lg: 20px;

    --gs-sidebar-width: 240px;
    --gs-topbar-height: 80px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--gs-font-family);
    background: var(--gs-bg) !important;
    color: var(--gs-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font-family: var(--gs-font-family);
}

.gs-app {
    min-height: 100vh;
    background: var(--gs-bg);
}

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

/* Sidebar */
.gs-sidebar {
    width: var(--gs-sidebar-width);
    background: #fff;
    border-right: 1px solid var(--gs-border-soft);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    overflow-y: auto;
}

.gs-sidebar__inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 14px 12px 18px;
}

.gs-sidebar__brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
    padding: 4px 2px;
}

.gs-sidebar__logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--gs-primary);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.02em;
}

.gs-sidebar__logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--gs-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(3, 142, 54, 0.18);
}

.gs-sidebar__logo-text {
    color: var(--gs-primary);
    font-weight: 700;
}

.gs-sidebar__toggle,
.gs-mobile-sidebar-btn {
    border: 0;
    background: transparent;
    color: var(--gs-heading);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
}

.gs-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.gs-nav-link,
.gs-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    border-radius: 12px;
    color: #353935;
    font-size: 15px;
    font-weight: 500;
    border: 0;
    background: transparent;
    text-align: left;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.gs-nav-link:hover,
.gs-logout-btn:hover {
    background: #F4F7F2;
    color: var(--gs-heading);
}

.gs-nav-link.is-active {
    background: var(--gs-primary-soft);
    color: var(--gs-primary);
    font-weight: 700;
}

.gs-nav-link__icon {
    width: 18px;
    min-width: 18px;
    display: inline-flex;
    justify-content: center;
    font-size: 19px;
    line-height: 1;
}

.gs-nav-link__text {
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.gs-sidebar__footer {
    margin-top: auto;
    padding-top: 22px;
}

/* Main */
.gs-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--gs-sidebar-width);
}

/* Topbar */
.gs-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--gs-topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 28px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gs-border-soft);
}

.gs-topbar__left,
.gs-topbar__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gs-mobile-sidebar-btn {
    display: none;
}

.gs-topbar__search {
    position: relative;
    width: min(440px, 38vw);
}

.gs-topbar__search input {
    width: 100%;
    height: 44px;
    border-radius: 13px;
    border: 1px solid #DCDED7;
    background: #fff;
    padding: 0 16px 0 44px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gs-heading);
    outline: none;
    box-shadow: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.gs-topbar__search input:focus {
    border-color: rgba(3, 142, 54, 0.28);
    box-shadow: 0 0 0 3px rgba(3, 142, 54, 0.08);
}

.gs-topbar__search input::placeholder {
    color: #8B8F88;
    font-weight: 500;
}

.gs-topbar__search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8B8F88;
    font-size: 18px;
    line-height: 1;
}

.gs-topbar__icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--gs-border);
    background: #fff;
    color: #4F544E;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
    position: relative;
}

.gs-topbar__icon-btn:hover {
    background: #F7F7F3;
}

.gs-topbar__dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #DF4F45;
}

.gs-topbar__profile {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding-left: 2px;
}

.gs-topbar__avatar img {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    object-fit: cover;
}

.gs-topbar__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--gs-heading);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.gs-topbar__chevron {
    color: #7D817B;
    font-size: 18px;
}

/* Notifications */
.gs-topbar__notifications {
    position: absolute;
    top: 72px;
    right: 28px;
    width: 360px;
    max-width: calc(100vw - 32px);
    display: none;
    z-index: 50;
}

.gs-topbar__notifications.is-open {
    display: block;
}

.gs-notification-panel {
    background: #fff;
    border: 1px solid var(--gs-border);
    border-radius: 18px;
    box-shadow: var(--gs-shadow-md);
    overflow: hidden;
}

.gs-notification-panel__header {
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--gs-border);
}

.gs-notification-panel__header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.gs-notification-panel__body {
    max-height: 420px;
    overflow-y: auto;
}

.gs-notification-item {
    padding: 14px 18px;
    border-bottom: 1px solid #F0F0EA;
}

.gs-notification-item:last-child {
    border-bottom: 0;
}

.gs-notification-item__title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.gs-notification-item__title-row strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--gs-heading);
    letter-spacing: -0.01em;
}

.gs-notification-item__title-row span {
    font-size: 11px;
    font-weight: 500;
    color: var(--gs-text-soft);
}

.gs-notification-item p {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--gs-text-soft);
    line-height: 1.5;
}

/* Page content */
.gs-page-content {
    padding: 30px 28px;
}

.body-wrapper {
    padding: 0 !important;
}

/* Generic Cards */
.custom-card,
.gs-card {
    background: var(--gs-surface);
    border: 1px solid var(--gs-border);
    border-radius: 18px;
    box-shadow: var(--gs-shadow-sm);
    overflow: hidden;
}

.custom-card .card-header,
.gs-card-header,
.dashboard-header-wrapper {
    padding: 22px 22px 0;
    border: 0;
    background: transparent;
}

.custom-card .card-body,
.gs-card-body {
    padding: 22px;
}

.gs-card-title,
.title,
.dashboard-header-wrapper .title,
.custom-card .card-header .title {
    margin: 0;
    color: var(--gs-heading);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Buttons */
.btn,
button,
.btn--base,
.btn.btn--base,
.btn-outline--base,
.btn.btn-outline--base,
.btn-outline--danger {
    font-family: var(--gs-font-family) !important;
}

.btn--base,
.btn.btn--base {
    background: var(--gs-primary) !important;
    border: 1px solid var(--gs-primary) !important;
    color: #fff !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    letter-spacing: -0.01em;
    box-shadow: none !important;
}

.btn--base:hover,
.btn.btn--base:hover {
    background: var(--gs-primary-dark) !important;
    border-color: var(--gs-primary-dark) !important;
    color: #fff !important;
}

.btn-outline--base,
.btn.btn-outline--base {
    background: #fff !important;
    border: 1px solid var(--gs-border) !important;
    color: var(--gs-heading) !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    letter-spacing: -0.01em;
}

.btn-outline--base:hover,
.btn.btn-outline--base:hover {
    background: #F7F7F3 !important;
    color: var(--gs-heading) !important;
}

.btn-outline--danger {
    background: #fff !important;
    border-radius: 12px !important;
}

/* Inputs */
.form--control,
.form-control,
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
    min-height: 44px;
    border-radius: 12px !important;
    border: 1px solid var(--gs-border) !important;
    background: #fff !important;
    color: var(--gs-heading) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}

.form--control:focus,
.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    border-color: rgba(3, 142, 54, 0.28) !important;
    box-shadow: 0 0 0 3px rgba(3, 142, 54, 0.08) !important;
    outline: none !important;
}

/* Tables */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--gs-text);
    margin-bottom: 0;
}

.table thead th {
    color: #81857F !important;
    font-weight: 500;
    font-size: 13px;
    border-bottom: 1px solid var(--gs-border) !important;
    padding-top: 18px !important;
    padding-bottom: 18px !important;
    background: transparent !important;
}

.table tbody td {
    color: var(--gs-text) !important;
    border-bottom: 1px solid #EFEFE8 !important;
    padding-top: 18px !important;
    padding-bottom: 18px !important;
    vertical-align: middle;
    background: transparent !important;
    font-size: 14px;
    font-weight: 500;
}

.table tbody tr:last-child td {
    border-bottom: 0 !important;
}

/* Helpers */
.text-muted,
.small {
    color: var(--gs-text-soft) !important;
}

.row.g-3,
.row.mt-20,
.row.mb-20-none {
    --bs-gutter-x: 20px;
    --bs-gutter-y: 20px;
}

/* Responsive */
@media (max-width: 1199px) {
    .gs-page-content {
        padding: 24px;
    }
}

@media (max-width: 991px) {
    .gs-sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
    }

    .gs-sidebar.is-open {
        transform: translateX(0);
    }

    .gs-main {
        margin-left: 0;
    }

    .gs-mobile-sidebar-btn {
        display: inline-flex;
        width: 40px;
        height: 40px;
        border-radius: 12px;
        border: 1px solid var(--gs-border);
        background: #fff;
        align-items: center;
        justify-content: center;
        font-size: 18px;
    }

    .gs-topbar {
        padding: 14px 18px;
    }

    .gs-topbar__search {
        width: 100%;
        max-width: 360px;
    }

    .gs-page-content {
        padding: 18px;
    }
}

@media (max-width: 767px) {
    .gs-topbar {
        flex-wrap: wrap;
        height: auto;
    }

    .gs-topbar__left,
    .gs-topbar__right {
        width: 100%;
        justify-content: space-between;
    }

    .gs-topbar__search {
        flex: 1;
        width: auto;
        max-width: none;
    }

    .gs-topbar__notifications {
        right: 18px;
        top: 118px;
    }

    .gs-page-content {
        padding: 16px;
    }
}