/* =========================================================
   KyuFin
   Plan. Track. Grow.
   Main Application Theme
========================================================= */

/* =========================================================
   1. ROOT / THEME VARIABLES
========================================================= */

:root {
    --kf-primary: #31c48d;
    --kf-primary-hover: #28ad7b;
    --kf-primary-soft: #e9faf3;

    --kf-secondary: #1faf9a;
    --kf-secondary-soft: #e8f8f5;

    --kf-teal: #176b61;
    --kf-teal-dark: #0e4e48;

    --kf-dark: #0b1a24;
    --kf-dark-soft: #142631;
    --kf-dark-lighter: #1b313d;

    --kf-bg: #f6faf9;
    --kf-card: #ffffff;

    --kf-text: #12212a;
    --kf-text-muted: #728087;
    --kf-text-light: #9aa5aa;

    --kf-border: #e2ece8;
    --kf-border-dark: #d4e2dd;

    --kf-success: #31c48d;
    --kf-success-soft: #e9faf3;

    --kf-danger: #e05252;
    --kf-danger-soft: #fceeee;

    --kf-warning: #f5a623;
    --kf-warning-soft: #fff6e5;

    --kf-info: #3c8dbc;
    --kf-info-soft: #ebf5fb;

    --kf-purple: #7656d6;
    --kf-purple-soft: #f1edfc;

    --kf-sidebar-width: 260px;
    --kf-sidebar-collapsed: 84px;

    --kf-header-height: 72px;

    --kf-radius-sm: 8px;
    --kf-radius: 12px;
    --kf-radius-lg: 16px;
    --kf-radius-xl: 20px;

    --kf-shadow-sm: 0 2px 8px rgba(11, 26, 36, 0.05);
    --kf-shadow: 0 8px 24px rgba(11, 26, 36, 0.07);
    --kf-shadow-lg: 0 16px 40px rgba(11, 26, 36, 0.10);

    --kf-transition: 0.25s ease;
}


/* =========================================================
   2. RESET / BASE
========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: var(--kf-bg);
    color: var(--kf-text);
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.kf-menu-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

img {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

::selection {
    background: var(--kf-primary);
    color: #fff;
}


/* =========================================================
   3. SCROLLBAR
========================================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c7d7d1;
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: #afc5bd;
}


/* =========================================================
   4. APP WRAPPER
========================================================= */

.kf-app {
    min-height: 100vh;
}

.kf-main {
    min-height: 100vh;
    margin-left: var(--kf-sidebar-width);
    transition: margin-left var(--kf-transition);
}

.kf-content {
    padding: 26px;
}


/* =========================================================
   5. SIDEBAR
========================================================= */

.kf-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;

    width: var(--kf-sidebar-width);

    display: flex;
    flex-direction: column;

    background:
        linear-gradient(
            180deg,
            var(--kf-dark) 0%,
            #0d202a 55%,
            #102932 100%
        );

    color: #fff;

    z-index: 1040;

    transition:
        width var(--kf-transition),
        transform var(--kf-transition);

    box-shadow: 8px 0 30px rgba(11, 26, 36, 0.08);
}

.kf-sidebar-header {
    height: var(--kf-header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.kf-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.kf-brand-mark {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            var(--kf-primary),
            var(--kf-secondary)
        );

    color: #fff;

    font-size: 20px;
    font-weight: 800;

    flex-shrink: 0;

    box-shadow: 0 8px 20px rgba(49, 196, 141, 0.22);
}

.kf-brand-text {
    min-width: 0;
}

.kf-brand-name {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.kf-brand-tagline {
    margin-top: 3px;
    font-size: 10px;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.kf-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 12px;
}

.kf-sidebar-body::-webkit-scrollbar {
    width: 4px;
}

.kf-sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
}

.kf-nav-section {
    margin-bottom: 20px;
}

.kf-nav-title {
    padding: 0 12px;
    margin-bottom: 8px;

    color: rgba(255,255,255,0.35);

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.15px;
    text-transform: uppercase;
}

.kf-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.kf-nav-item {
    margin-bottom: 4px;
}

.kf-nav-link {
    position: relative;

    display: flex;
    align-items: center;
    gap: 12px;

    min-height: 44px;

    padding: 10px 12px;

    border-radius: 11px;

    color: rgba(255,255,255,0.68);

    font-size: 13.5px;
    font-weight: 500;

    transition: all var(--kf-transition);
}

.kf-nav-link i,
.kf-nav-link svg {
    width: 20px;
    min-width: 20px;
    text-align: center;
    font-size: 17px;
}

.kf-nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}

.kf-nav-link.active {
    color: #fff;

    background:
        linear-gradient(
            135deg,
            rgba(49,196,141,0.95),
            rgba(31,175,154,0.95)
        );

    box-shadow: 0 7px 18px rgba(49,196,141,0.18);
}

.kf-nav-link.active::before {
    content: "";

    position: absolute;

    left: -12px;
    top: 10px;
    bottom: 10px;

    width: 3px;

    border-radius: 0 5px 5px 0;

    background: #fff;
}

.kf-nav-badge {
    margin-left: auto;

    min-width: 22px;
    height: 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 6px;

    border-radius: 10px;

    background: rgba(255,255,255,0.10);

    color: rgba(255,255,255,0.75);

    font-size: 10px;
    font-weight: 700;
}

.kf-sidebar-footer {
    padding: 14px 14px 18px;

    border-top: 1px solid rgba(255,255,255,0.07);

    flex-shrink: 0;
}

.kf-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px;

    border-radius: 12px;

    background: rgba(255,255,255,0.05);
}

.kf-sidebar-avatar {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 50%;

    background: var(--kf-primary);

    color: #fff;

    font-weight: 700;
}

.kf-sidebar-user-info {
    min-width: 0;
    flex: 1;
}

.kf-sidebar-user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #fff;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kf-sidebar-user-role {
    font-size: 10px;
    color: rgba(255,255,255,0.45);
}


/* =========================================================
   6. COLLAPSED SIDEBAR
========================================================= */

body.kf-sidebar-collapsed .kf-sidebar {
    width: var(--kf-sidebar-collapsed);
}

body.kf-sidebar-collapsed .kf-main {
    margin-left: var(--kf-sidebar-collapsed);
}

body.kf-sidebar-collapsed .kf-brand-text,
body.kf-sidebar-collapsed .kf-nav-title,
body.kf-sidebar-collapsed .kf-nav-link span,
body.kf-sidebar-collapsed .kf-nav-badge,
body.kf-sidebar-collapsed .kf-sidebar-user-info {
    display: none;
}

body.kf-sidebar-collapsed .kf-sidebar-header {
    justify-content: center;
    padding: 0;
}

body.kf-sidebar-collapsed .kf-brand {
    justify-content: center;
}

body.kf-sidebar-collapsed .kf-nav-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.kf-sidebar-collapsed .kf-nav-link.active::before {
    left: -12px;
}

body.kf-sidebar-collapsed .kf-sidebar-user {
    justify-content: center;
}


/* =========================================================
   7. TOP HEADER
========================================================= */

.kf-header {
    position: sticky;
    top: 0;

    height: var(--kf-header-height);

    display: flex;
    align-items: center;

    padding: 0 26px;

    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);

    border-bottom: 1px solid var(--kf-border);

    z-index: 1030;
}

.kf-header-left,
.kf-header-right {
    display: flex;
    align-items: center;
}

.kf-header-left {
    gap: 14px;
}

.kf-header-right {
    margin-left: auto;
    gap: 9px;
}

.kf-sidebar-toggle {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--kf-border);

    border-radius: 11px;

    background: #fff;
    color: var(--kf-text);

    transition: var(--kf-transition);
}

.kf-sidebar-toggle:hover {
    border-color: var(--kf-primary);
    color: var(--kf-primary);
    background: var(--kf-primary-soft);
}

.kf-header-title {
    font-size: 17px;
    font-weight: 700;
}

.kf-header-subtitle {
    font-size: 11px;
    color: var(--kf-text-muted);
}

.kf-header-action {
    position: relative;

    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--kf-border);
    border-radius: 11px;

    background: #fff;
    color: var(--kf-text);

    transition: var(--kf-transition);
}

.kf-header-action:hover {
    border-color: var(--kf-primary);
    background: var(--kf-primary-soft);
    color: var(--kf-primary);
}

.kf-notification-dot {
    position: absolute;
    top: 7px;
    right: 7px;

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--kf-danger);

    border: 2px solid #fff;
}


/* =========================================================
   8. PAGE HEADER
========================================================= */

.kf-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;

    margin-bottom: 24px;
}

.kf-page-title {
    margin: 0 0 4px;

    font-size: 24px;
    font-weight: 750;
    letter-spacing: -0.45px;
}

.kf-page-description {
    margin: 0;
    color: var(--kf-text-muted);
    font-size: 13px;
}

.kf-page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}


/* =========================================================
   9. BUTTONS
========================================================= */

.kf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    min-height: 40px;

    padding: 8px 15px;

    border: 1px solid transparent;

    border-radius: 10px;

    font-size: 13px;
    font-weight: 600;

    line-height: 1;

    transition: all var(--kf-transition);
}

.kf-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.kf-btn-primary {
    background: var(--kf-primary);
    color: #fff;

    box-shadow: 0 5px 14px rgba(49,196,141,0.20);
}

.kf-btn-primary:hover {
    background: var(--kf-primary-hover);
    color: #fff;
    transform: translateY(-1px);
}

.kf-btn-secondary {
    background: var(--kf-teal);
    color: #fff;
}

.kf-btn-secondary:hover {
    background: var(--kf-teal-dark);
    color: #fff;
}

.kf-btn-outline {
    background: #fff;

    border-color: var(--kf-border);

    color: var(--kf-text);
}

.kf-btn-outline:hover {
    border-color: var(--kf-primary);
    color: var(--kf-primary);
    background: var(--kf-primary-soft);
}

.kf-btn-danger {
    background: var(--kf-danger);
    color: #fff;
}

.kf-btn-danger:hover {
    background: #c94242;
    color: #fff;
}

.kf-btn-light-danger {
    background: var(--kf-danger-soft);
    color: var(--kf-danger);
}

.kf-btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
}


/* =========================================================
   10. CARDS
========================================================= */

.kf-card {
    background: var(--kf-card);

    border: 1px solid var(--kf-border);

    border-radius: var(--kf-radius-lg);

    box-shadow: var(--kf-shadow-sm);
}

.kf-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 18px 20px;

    border-bottom: 1px solid var(--kf-border);
}

.kf-card-title {
    margin: 0;

    font-size: 15px;
    font-weight: 700;
}

.kf-card-subtitle {
    margin-top: 3px;

    font-size: 11px;
    color: var(--kf-text-muted);
}

.kf-card-body {
    padding: 20px;
}

.kf-card-footer {
    padding: 14px 20px;

    border-top: 1px solid var(--kf-border);
}


/* =========================================================
   11. DASHBOARD STAT CARDS
========================================================= */

.kf-stat-card {
    position: relative;
    overflow: hidden;

    min-height: 144px;

    padding: 20px;

    background: #fff;

    border: 1px solid var(--kf-border);

    border-radius: var(--kf-radius-lg);

    box-shadow: var(--kf-shadow-sm);

    transition: all var(--kf-transition);
}

.kf-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--kf-shadow);
}

.kf-stat-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.kf-stat-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    font-size: 18px;
}

.kf-stat-icon.green {
    color: var(--kf-primary);
    background: var(--kf-primary-soft);
}

.kf-stat-icon.teal {
    color: var(--kf-teal);
    background: var(--kf-secondary-soft);
}

.kf-stat-icon.red {
    color: var(--kf-danger);
    background: var(--kf-danger-soft);
}

.kf-stat-icon.orange {
    color: var(--kf-warning);
    background: var(--kf-warning-soft);
}

.kf-stat-icon.purple {
    color: var(--kf-purple);
    background: var(--kf-purple-soft);
}

.kf-stat-label {
    margin-top: 15px;

    color: var(--kf-text-muted);

    font-size: 12px;
    font-weight: 500;
}

.kf-stat-value {
    margin-top: 3px;

    font-size: 24px;
    font-weight: 750;
    letter-spacing: -0.5px;
}

.kf-stat-meta {
    margin-top: 7px;

    font-size: 11px;
    color: var(--kf-text-muted);
}

.kf-stat-positive {
    color: var(--kf-success);
}

.kf-stat-negative {
    color: var(--kf-danger);
}


/* =========================================================
   12. GRID HELPERS
========================================================= */

.kf-grid {
    display: grid;
    gap: 18px;
}

.kf-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kf-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kf-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kf-col-span-2 {
    grid-column: span 2;
}

.kf-mb-0 {
    margin-bottom: 0 !important;
}

.kf-mb-2 {
    margin-bottom: 12px !important;
}

.kf-mb-3 {
    margin-bottom: 18px !important;
}

.kf-mb-4 {
    margin-bottom: 24px !important;
}


/* =========================================================
   13. FORMS
========================================================= */

.kf-form-group {
    margin-bottom: 17px;
}

.kf-label {
    display: block;

    margin-bottom: 7px;

    font-size: 12px;
    font-weight: 600;

    color: var(--kf-text);
}

.kf-required {
    color: var(--kf-danger);
}

.kf-input,
.kf-select,
.kf-textarea {
    width: 100%;

    border: 1px solid var(--kf-border-dark);

    border-radius: 10px;

    background: #fff;

    color: var(--kf-text);

    font-size: 13px;

    outline: none;

    transition:
        border-color var(--kf-transition),
        box-shadow var(--kf-transition);
}

.kf-input,
.kf-select {
    height: 42px;
    padding: 0 12px;
}

.kf-textarea {
    min-height: 105px;
    resize: vertical;

    padding: 11px 12px;
}

.kf-input:focus,
.kf-select:focus,
.kf-textarea:focus {
    border-color: var(--kf-primary);

    box-shadow: 0 0 0 3px rgba(49,196,141,0.12);
}

.kf-input::placeholder,
.kf-textarea::placeholder {
    color: #a5b0b5;
}

.kf-form-help {
    margin-top: 5px;

    font-size: 10.5px;

    color: var(--kf-text-muted);
}

.kf-input-group {
    position: relative;
}

.kf-input-icon {
    position: absolute;

    top: 50%;
    left: 12px;

    transform: translateY(-50%);

    color: var(--kf-text-muted);

    pointer-events: none;
}

.kf-input-group.has-left-icon .kf-input {
    padding-left: 38px;
}

.kf-input-action {
    position: absolute;

    right: 7px;
    top: 50%;

    transform: translateY(-50%);

    width: 31px;
    height: 31px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    background: transparent;

    border-radius: 8px;

    color: var(--kf-text-muted);
}

.kf-input-action:hover {
    background: var(--kf-primary-soft);
    color: var(--kf-primary);
}


/* =========================================================
   14. TABLES
========================================================= */

.kf-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.kf-table {
    width: 100%;

    border-collapse: collapse;
}

.kf-table thead th {
    padding: 12px 14px;

    background: #f9fbfa;

    border-bottom: 1px solid var(--kf-border);

    color: var(--kf-text-muted);

    font-size: 10.5px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.45px;

    white-space: nowrap;
}

.kf-table tbody td {
    padding: 14px;

    border-bottom: 1px solid var(--kf-border);

    color: var(--kf-text);

    font-size: 12.5px;

    vertical-align: middle;
}

.kf-table tbody tr:last-child td {
    border-bottom: 0;
}

.kf-table tbody tr {
    transition: background var(--kf-transition);
}

.kf-table tbody tr:hover {
    background: #fbfdfc;
}

.kf-table-amount {
    font-weight: 650;
}

.kf-table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 5px;
}


/* =========================================================
   15. BADGES
========================================================= */

.kf-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    min-height: 24px;

    padding: 4px 9px;

    border-radius: 20px;

    font-size: 10.5px;
    font-weight: 650;
}

.kf-badge-success {
    color: #16835f;
    background: var(--kf-success-soft);
}

.kf-badge-danger {
    color: var(--kf-danger);
    background: var(--kf-danger-soft);
}

.kf-badge-warning {
    color: #b6750c;
    background: var(--kf-warning-soft);
}

.kf-badge-info {
    color: var(--kf-info);
    background: var(--kf-info-soft);
}

.kf-badge-dark {
    color: #fff;
    background: var(--kf-dark);
}

.kf-badge-muted {
    color: var(--kf-text-muted);
    background: #eff4f2;
}


/* =========================================================
   16. PROGRESS
========================================================= */

.kf-progress {
    width: 100%;
    height: 7px;

    overflow: hidden;

    border-radius: 20px;

    background: #edf3f1;
}

.kf-progress-bar {
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--kf-primary),
            var(--kf-secondary)
        );

    transition: width 0.5s ease;
}

.kf-progress-danger {
    background: var(--kf-danger);
}

.kf-progress-warning {
    background: var(--kf-warning);
}


/* =========================================================
   17. ALERTS
========================================================= */

.kf-alert {
    position: relative;

    display: flex;
    align-items: flex-start;

    gap: 10px;

    padding: 13px 15px;

    margin-bottom: 16px;

    border-radius: 11px;

    font-size: 12.5px;

    border: 1px solid transparent;
}

.kf-alert-success {
    color: #176b52;
    background: var(--kf-success-soft);
    border-color: #ccefe1;
}

.kf-alert-danger {
    color: #a83e3e;
    background: var(--kf-danger-soft);
    border-color: #f3d5d5;
}

.kf-alert-warning {
    color: #9b6816;
    background: var(--kf-warning-soft);
    border-color: #f5e3ba;
}

.kf-alert-info {
    color: #33779d;
    background: var(--kf-info-soft);
    border-color: #d1e7f5;
}

.kf-alert-close {
    margin-left: auto;

    border: 0;
    background: transparent;

    color: inherit;

    opacity: 0.65;
}


/* =========================================================
   18. EMPTY STATE
========================================================= */

.kf-empty {
    padding: 48px 20px;

    text-align: center;
}

.kf-empty-icon {
    width: 62px;
    height: 62px;

    margin: 0 auto 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 18px;

    background: var(--kf-primary-soft);

    color: var(--kf-primary);

    font-size: 25px;
}

.kf-empty-title {
    margin-bottom: 5px;

    font-size: 15px;
    font-weight: 700;
}

.kf-empty-text {
    max-width: 360px;
    margin: 0 auto 16px;

    color: var(--kf-text-muted);

    font-size: 12px;
}


/* =========================================================
   19. DROPDOWN
========================================================= */

.kf-dropdown {
    position: relative;
}

.kf-dropdown-menu {
    position: absolute;

    top: calc(100% + 8px);
    right: 0;

    min-width: 190px;

    padding: 7px;

    background: #fff;

    border: 1px solid var(--kf-border);

    border-radius: 12px;

    box-shadow: var(--kf-shadow-lg);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-5px);

    transition: all var(--kf-transition);

    z-index: 1100;
}

.kf-dropdown.open .kf-dropdown-menu {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}

.kf-dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;

    width: 100%;

    padding: 9px 10px;

    border: 0;
    border-radius: 8px;

    background: transparent;

    color: var(--kf-text);

    font-size: 12px;

    text-align: left;
}

.kf-dropdown-item:hover {
    background: var(--kf-primary-soft);
    color: var(--kf-primary);
}

.kf-dropdown-divider {
    height: 1px;

    margin: 6px 0;

    background: var(--kf-border);
}


/* =========================================================
   20. MODAL
========================================================= */

.kf-modal-backdrop {
    position: fixed;
    inset: 0;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(11,26,36,0.45);
    backdrop-filter: blur(3px);

    z-index: 2000;
}

.kf-modal-backdrop.show {
    display: flex;
}

.kf-modal {
    width: 100%;
    max-width: 520px;

    background: #fff;

    border-radius: var(--kf-radius-lg);

    box-shadow: var(--kf-shadow-lg);

    animation: kfModalIn 0.2s ease;
}

@keyframes kfModalIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.kf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 20px;

    border-bottom: 1px solid var(--kf-border);
}

.kf-modal-title {
    margin: 0;

    font-size: 15px;
    font-weight: 700;
}

.kf-modal-close {
    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;

    border-radius: 8px;

    background: #f3f6f5;

    color: var(--kf-text-muted);
}

.kf-modal-body {
    padding: 20px;
}

.kf-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 8px;

    padding: 14px 20px;

    border-top: 1px solid var(--kf-border);
}


/* =========================================================
   21. LOGIN PAGE
========================================================= */

.kf-login-page {
    min-height: 100vh;

    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);

    background: var(--kf-bg);
}

.kf-login-visual {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    padding: 50px;

    background:
        radial-gradient(
            circle at 30% 20%,
            rgba(49,196,141,0.20),
            transparent 35%
        ),
        linear-gradient(
            145deg,
            var(--kf-dark),
            var(--kf-teal-dark)
        );

    color: #fff;
}

.kf-login-visual::before,
.kf-login-visual::after {
    content: "";

    position: absolute;

    border-radius: 50%;

    border: 1px solid rgba(255,255,255,0.07);
}

.kf-login-visual::before {
    width: 500px;
    height: 500px;

    right: -170px;
    top: -170px;
}

.kf-login-visual::after {
    width: 360px;
    height: 360px;

    left: -120px;
    bottom: -120px;
}

.kf-login-message {
    position: relative;
    z-index: 1;

    max-width: 500px;
}

.kf-login-logo {
    display: inline-flex;
    align-items: center;
    gap: 13px;

    margin-bottom: 32px;
}

.kf-login-logo-mark {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background: var(--kf-primary);

    font-size: 23px;
    font-weight: 800;
}

.kf-login-logo-name {
    font-size: 26px;
    font-weight: 800;
}

.kf-login-heading {
    margin: 0 0 10px;

    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -1.4px;
}

.kf-login-heading span {
    color: var(--kf-primary);
}

.kf-login-copy {
    max-width: 440px;

    color: rgba(255,255,255,0.62);

    font-size: 14px;
}

.kf-login-form-side {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 45px 30px;
}

.kf-login-box {
    width: 100%;
    max-width: 410px;
}

.kf-login-title {
    margin: 0 0 5px;

    font-size: 27px;
    font-weight: 750;
    letter-spacing: -0.5px;
}

.kf-login-subtitle {
    margin: 0 0 28px;

    color: var(--kf-text-muted);

    font-size: 13px;
}

.kf-login-submit {
    width: 100%;
    margin-top: 5px;
}


/* =========================================================
   22. QUICK ADD BUTTON
========================================================= */

.kf-quick-add {
    position: fixed;

    right: 24px;
    bottom: 24px;

    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            var(--kf-primary),
            var(--kf-secondary)
        );

    color: #fff;

    font-size: 22px;

    box-shadow: 0 10px 26px rgba(49,196,141,0.30);

    transition: all var(--kf-transition);

    z-index: 1020;
}

.kf-quick-add:hover {
    transform: translateY(-2px) scale(1.03);
}


/* =========================================================
   23. MOBILE SIDEBAR OVERLAY
========================================================= */

.kf-sidebar-overlay {
    position: fixed;
    inset: 0;

    display: none;

    background: rgba(11,26,36,0.48);

    z-index: 1035;
}

.kf-sidebar-overlay.show {
    display: block;
}


/* =========================================================
   24. UTILITIES
========================================================= */

.text-success {
    color: var(--kf-success) !important;
}

.text-danger {
    color: var(--kf-danger) !important;
}

.text-warning {
    color: var(--kf-warning) !important;
}

.text-muted {
    color: var(--kf-text-muted) !important;
}

.text-primary {
    color: var(--kf-primary) !important;
}

.fw-500 {
    font-weight: 500 !important;
}

.fw-600 {
    font-weight: 600 !important;
}

.fw-700 {
    font-weight: 700 !important;
}

.text-end {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

.w-100 {
    width: 100% !important;
}


/* =========================================================
   25. RESPONSIVE
========================================================= */

@media (max-width: 1199px) {
    .kf-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kf-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 991px) {
    .kf-sidebar {
        transform: translateX(-100%);
    }

    .kf-sidebar.mobile-open {
        transform: translateX(0);
    }

    .kf-main,
    body.kf-sidebar-collapsed .kf-main {
        margin-left: 0;
    }

    body.kf-sidebar-collapsed .kf-sidebar {
        width: var(--kf-sidebar-width);
    }

    body.kf-sidebar-collapsed .kf-brand-text,
    body.kf-sidebar-collapsed .kf-nav-title,
    body.kf-sidebar-collapsed .kf-nav-link span,
    body.kf-sidebar-collapsed .kf-nav-badge,
    body.kf-sidebar-collapsed .kf-sidebar-user-info {
        display: block;
    }

    body.kf-sidebar-collapsed .kf-nav-link {
        justify-content: flex-start;

        padding: 10px 12px;
    }

    body.kf-sidebar-collapsed .kf-sidebar-header {
        justify-content: flex-start;

        padding: 0 20px;
    }

    body.kf-sidebar-collapsed .kf-sidebar-user {
        justify-content: flex-start;
    }

    .kf-content {
        padding: 22px;
    }
}


@media (max-width: 767px) {
    .kf-header {
        padding: 0 16px;
    }

    .kf-content {
        padding: 18px 15px;
    }

    .kf-header-subtitle {
        display: none;
    }

    .kf-page-header {
        flex-direction: column;
    }

    .kf-page-actions {
        width: 100%;
    }

    .kf-page-actions .kf-btn {
        flex: 1;
    }

    .kf-grid-4,
    .kf-grid-3,
    .kf-grid-2 {
        grid-template-columns: 1fr;
    }

    .kf-col-span-2 {
        grid-column: span 1;
    }

    .kf-login-page {
        display: block;
    }

    .kf-login-visual {
        display: none;
    }

    .kf-login-form-side {
        min-height: 100vh;

        padding: 30px 20px;
    }

    .kf-table thead {
        display: none;
    }

    .kf-table,
    .kf-table tbody,
    .kf-table tr,
    .kf-table td {
        display: block;
        width: 100%;
    }

    .kf-table tbody tr {
        margin-bottom: 12px;

        padding: 10px;

        border: 1px solid var(--kf-border);
        border-radius: 12px;

        background: #fff;
    }

    .kf-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;

        gap: 15px;

        padding: 8px 5px;

        border-bottom: 1px dashed var(--kf-border);

        text-align: right;
    }

    .kf-table tbody td:last-child {
        border-bottom: 0;
    }

    .kf-table tbody td::before {
        content: attr(data-label);

        color: var(--kf-text-muted);

        font-size: 10.5px;
        font-weight: 700;

        text-transform: uppercase;

        text-align: left;
    }

    .kf-table-actions {
        justify-content: flex-end;
    }
}


@media (max-width: 479px) {
    .kf-page-title {
        font-size: 21px;
    }

    .kf-stat-value {
        font-size: 21px;
    }

    .kf-card-header,
    .kf-card-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .kf-header-title {
        font-size: 14px;
    }

    .kf-header-action {
        width: 37px;
        height: 37px;
    }

    .kf-quick-add {
        right: 16px;
        bottom: 16px;
    }
}

/* =========================================================
   KYUFIN TABLE SYSTEM
========================================================= */

.kf-data-card {
    overflow: hidden;
}


.kf-data-table-wrapper {
    width: 100%;
    overflow-x: auto;
}


.kf-data-table {
    width: 100%;
    border-collapse: collapse;
}


/* Header */

.kf-data-table thead th {
    background: #f8fbfa;

    color: #738087;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: .045em;
    text-transform: uppercase;

    padding: 13px 18px;

    border-bottom: 1px solid var(--kf-border);

    white-space: nowrap;
}


/* Rows */

.kf-data-table tbody tr {
    transition:
        background-color .16s ease,
        box-shadow .16s ease;
}


.kf-data-table tbody tr:hover {
    background: #f8fcfb;
}


.kf-data-table tbody td {
    padding: 15px 18px;

    border-bottom: 1px solid #edf2f0;

    vertical-align: middle;

    font-size: 12px;
}


.kf-data-table tbody tr:last-child td {
    border-bottom: none;
}


/* Main cell */

.kf-table-main {
    display: flex;
    align-items: center;

    gap: 11px;

    min-width: 190px;
}


.kf-table-icon {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 11px;

    font-size: 14px;
}


.kf-table-icon.green {
    background: #e7f9f2;
    color: #20b486;
}


.kf-table-icon.red {
    background: #fff0f0;
    color: #f05b61;
}


.kf-table-icon.orange {
    background: #fff5e5;
    color: #e8a23a;
}


.kf-table-icon.blue {
    background: #eef5ff;
    color: #4b83d5;
}


.kf-table-icon.purple {
    background: #f1edff;
    color: #7c63df;
}


.kf-table-icon.teal {
    background: #e8f7f5;
    color: var(--kf-teal);
}


/* Text */

.kf-table-info {
    min-width: 0;
}


.kf-table-title {
    color: var(--kf-dark);

    font-size: 12px;
    font-weight: 700;

    line-height: 1.3;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.kf-table-subtext {
    color: var(--kf-text-muted);

    font-size: 10px;

    margin-top: 3px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.kf-table-date {
    color: #45535a;

    font-size: 11.5px;
    font-weight: 500;

    white-space: nowrap;
}


.kf-table-account {
    color: #34434a;

    font-size: 11.5px;
    font-weight: 600;
}


/* Pills */

.kf-table-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 24px;

    padding: 4px 9px;

    border-radius: 999px;

    font-size: 9.5px;
    font-weight: 700;

    white-space: nowrap;
}


.kf-table-pill.green {
    background: #e8f9f2;
    color: #1ea77d;
}


.kf-table-pill.red {
    background: #ffeded;
    color: #eb555c;
}


.kf-table-pill.orange {
    background: #fff4e1;
    color: #d99127;
}


.kf-table-pill.blue {
    background: #edf4ff;
    color: #477fd0;
}


.kf-table-pill.purple {
    background: #f1edff;
    color: #735bd0;
}


.kf-table-pill.gray {
    background: #f1f5f4;
    color: #526169;
}


.kf-table-pill.teal {
    background: #e8f7f5;
    color: var(--kf-teal);
}


/* Category */

.kf-table-category {
    display: inline-flex;
    align-items: center;

    min-height: 24px;

    padding: 4px 9px;

    border-radius: 8px;

    background: #f1f5f4;

    color: #526169;

    font-size: 10px;
    font-weight: 600;

    white-space: nowrap;
}


/* Money */

.kf-table-amount {
    font-size: 12px;
    font-weight: 800;

    white-space: nowrap;
}


.kf-table-amount.positive {
    color: #20a97d;
}


.kf-table-amount.negative {
    color: #ed5159;
}


.kf-table-amount.neutral {
    color: #467bc3;
}


/* Status */

.kf-table-status {
    display: inline-flex;
    align-items: center;

    gap: 5px;

    font-size: 10px;
    font-weight: 700;
}


.kf-table-status::before {
    content: "";

    width: 6px;
    height: 6px;

    border-radius: 50%;
}


.kf-table-status.active {
    color: #1ea77d;
}


.kf-table-status.active::before {
    background: #1ea77d;
}


.kf-table-status.pending {
    color: #d99127;
}


.kf-table-status.pending::before {
    background: #d99127;
}


.kf-table-status.inactive {
    color: #8a969c;
}


.kf-table-status.inactive::before {
    background: #8a969c;
}


/* Utility */

.kf-table-dash {
    color: #a8b2b5;
}


.kf-table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 6px;
}


.kf-table-action {
    width: 31px;
    height: 31px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--kf-border);
    border-radius: 9px;

    background: #fff;

    color: #59686f;

    text-decoration: none;

    cursor: pointer;

    transition: .15s ease;
}


.kf-table-action:hover {
    border-color: #bddfd4;

    background: #f3fbf8;

    color: var(--kf-primary);
}


/* Loading */

.kf-table-loading {
    min-height: 150px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 8px;

    color: var(--kf-text-muted);

    font-size: 11px;
}


.kf-table-loading-icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: #edf9f5;

    color: var(--kf-primary);

    font-size: 17px;
}


/* =========================================================
   RESPONSIVE TABLE
========================================================= */

@media (max-width: 767px) {

    .kf-data-table thead {
        display: none;
    }


    .kf-data-table,
    .kf-data-table tbody,
    .kf-data-table tr,
    .kf-data-table td {
        display: block;
        width: 100%;
    }


    .kf-data-table tbody tr {
        padding: 14px 15px;

        border-bottom: 1px solid var(--kf-border);
    }


    .kf-data-table tbody td {
        border: 0;

        padding: 5px 0;

        display: flex;
        align-items: center;
        justify-content: space-between;

        gap: 15px;
    }


    .kf-data-table tbody td::before {
        content: attr(data-label);

        color: var(--kf-text-muted);

        font-size: 9px;
        font-weight: 700;

        text-transform: uppercase;
    }


    .kf-data-table tbody td.kf-main-cell {
        display: block;

        margin-bottom: 8px;
    }


    .kf-data-table tbody td.kf-main-cell::before {
        display: none;
    }


    .kf-data-table tbody td.text-end {
        text-align: right;
    }


    .kf-table-main {
        min-width: 0;
    }

}

/* =========================================================
   KYUFIN TABLE ROW ALIGNMENT
   Keep existing column widths - only align row contents
========================================================= */

/* Center normal header columns */
.kf-data-table thead th {
    text-align: center;
}


/* Center row values under their headings */
.kf-data-table tbody td {
    text-align: center;
}


/* Main transaction/income/expense cell */
.kf-data-table .kf-main-cell {
    text-align: center;
}


/* Center icon + title together inside the main column */
.kf-data-table .kf-table-main {
    width: 100%;
    justify-content: center;
    text-align: left;
}


/* Account text */
.kf-data-table .kf-table-account {
    text-align: center;
}


/* Category badge */
.kf-data-table td .kf-table-category {
    margin-left: auto;
    margin-right: auto;
}


/* Pills - payment method / type / due date */
.kf-data-table td .kf-table-pill {
    margin-left: auto;
    margin-right: auto;
}


/* Status */
.kf-data-table td .kf-table-status {
    justify-content: center;
}


/* Date */
.kf-data-table .kf-table-date {
    text-align: center;
}


/* Amount stays right aligned */
.kf-data-table thead th.text-end,
.kf-data-table tbody td.text-end {
    text-align: right;
}


/* Amount should not be centered */
.kf-data-table tbody td.text-end .kf-table-amount {
    display: inline-block;
    text-align: right;
}

/* =========================================================
   KYUFIN PAGINATION
========================================================= */

.kf-pagination-footer {
    min-height: 62px;

    padding: 12px 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    border-top: 1px solid #edf2f0;

    background: #fff;
}


/* Information */

.kf-pagination-info {
    color: var(--kf-text-muted);

    font-size: 10.5px;
    font-weight: 500;

    white-space: nowrap;
}


/* Controls */

.kf-pagination-controls {
    display: flex;
    align-items: center;

    gap: 18px;
}


/* Rows per page */

.kf-pagination-limit {
    display: flex;
    align-items: center;

    gap: 8px;

    color: var(--kf-text-muted);

    font-size: 10px;
    font-weight: 600;

    white-space: nowrap;
}


.kf-pagination-select {
    height: 32px;

    min-width: 62px;

    padding: 0 25px 0 10px;

    border: 1px solid var(--kf-border);

    border-radius: 8px;

    background-color: #fff;

    color: var(--kf-dark);

    font-size: 10.5px;
    font-weight: 600;

    outline: none;

    cursor: pointer;
}


.kf-pagination-select:focus {
    border-color: var(--kf-primary);

    box-shadow:
        0 0 0 3px
        rgba(49, 196, 141, .08);
}


/* Pages */

.kf-pagination-pages {
    display: flex;
    align-items: center;

    gap: 5px;
}


/* Button */

.kf-pagination-btn {
    min-width: 32px;
    height: 32px;

    padding: 0 9px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 5px;

    border: 1px solid var(--kf-border);

    border-radius: 8px;

    background: #fff;

    color: #56656c;

    font-size: 10px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background-color .15s ease,
        border-color .15s ease,
        color .15s ease,
        box-shadow .15s ease;
}


.kf-pagination-btn:hover:not(:disabled):not(.active) {
    background: #f4faf8;

    border-color: #c5e8dc;

    color: var(--kf-primary);
}


/* Active page */

.kf-pagination-btn.active {
    border-color: var(--kf-primary);

    background: var(--kf-primary);

    color: #fff;

    box-shadow:
        0 3px 8px
        rgba(49, 196, 141, .18);
}


/* Disabled */

.kf-pagination-btn:disabled {
    opacity: .45;

    cursor: not-allowed;

    background: #f8faf9;
}


/* Previous / Next */

.kf-pagination-nav {
    padding-left: 10px;
    padding-right: 10px;
}


/* Dots */

.kf-pagination-dots {
    min-width: 22px;

    text-align: center;

    color: #9ca8ad;

    font-size: 11px;

    user-select: none;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 850px) {

    .kf-pagination-footer {
        align-items: flex-start;
        flex-direction: column;
    }


    .kf-pagination-controls {
        width: 100%;

        justify-content: space-between;
    }

}


@media (max-width: 600px) {

    .kf-pagination-controls {
        align-items: flex-start;
        flex-direction: column;

        gap: 10px;
    }


    .kf-pagination-pages {
        width: 100%;

        overflow-x: auto;

        padding-bottom: 3px;
    }


    .kf-pagination-nav span {
        display: none;
    }


    .kf-pagination-nav {
        width: 32px;

        padding: 0;
    }

}

/* =========================================================
   HEADER DROPDOWN STACKING FIX
========================================================= */

/* Header dropdown guaranteed visibility */

.kf-header {
    overflow: visible !important;
}

.kf-header-right {
    overflow: visible !important;
}

.kf-header .kf-dropdown {
    position: relative !important;
}

.kf-header .kf-dropdown-menu {
    position: absolute !important;

    top: calc(100% + 8px) !important;
    right: 0 !important;

    z-index: 99999 !important;

    pointer-events: none;
}

.kf-header .kf-dropdown.open > .kf-dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}