﻿:root {
    --kf-orange: #ff8a00;
    --kf-orange-dark: #db6f00;
    --kf-green: #18b957;
    --kf-red: #f04444;
    --kf-ink: #111827;
    --kf-muted: #64748b;
    --kf-soft: #f6f7f3;
    --kf-line: #e5e7eb;
    --kf-sidebar: #111827;
    --kf-card: #ffffff;
    --kf-shadow: 0 22px 60px rgba(15, 23, 42, .10);
}


#blazor-error-ui {
    display: none;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f7f8f5;
    color: var(--kf-ink);
    letter-spacing: 0;
}

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

button, input { font: inherit; }

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    background:
        radial-gradient(circle at top right, rgba(255, 138, 0, .10), transparent 34rem),
        linear-gradient(180deg, #fbfcf8 0%, #f5f7f2 100%);
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px;
    background:
        linear-gradient(180deg, #161a22 0%, #101722 42%, #0f1f17 100%);
    color: #fff;
    overflow-y: auto;
}

.brand-block { display: grid; gap: 10px; margin-bottom: 24px; }

.logo-card {
    display: flex;
    align-items: center;
    min-height: 54px;
    padding: 4px 0;
}

.logo-card img {
    width: 206px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .24));
}

.brand-block p {
    margin: 0;
    color: rgba(255, 255, 255, .68);
    font-size: .88rem;
    line-height: 1.5;
}

.admin-nav { display: grid; gap: 9px; }

.admin-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: rgba(255, 255, 255, .72);
    font-weight: 750;
}

.admin-nav .nav-link:hover,
.admin-nav .nav-link.active {
    color: #111827;
    background: #fff;
    border-color: rgba(255, 255, 255, .7);
    box-shadow: 0 16px 36px rgba(0, 0, 0, .18);
}

.nav-icon {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(255, 138, 0, .16);
    color: var(--kf-orange);
    font-weight: 900;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .10);
}

.sidebar-footer strong,
.sidebar-footer small { display: block; }
.sidebar-footer small { color: rgba(255, 255, 255, .58); margin-top: 3px; }
.logout-link { color: #fff; font-weight: 800; font-size: .86rem; }

.admin-main { min-width: 0; }

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 32px;
    background: rgba(255, 255, 255, .84);
    border-bottom: 1px solid rgba(226, 232, 240, .9);
    backdrop-filter: blur(16px);
}

.topbar-kicker {
    margin: 0 0 4px;
    color: var(--kf-muted);
    font-size: .78rem;
    font-weight: 750;
    text-transform: uppercase;
}

.admin-topbar strong { text-transform: capitalize; font-size: 1.05rem; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 13px;
    border-radius: 999px;
    background: #f0fdf4;
    color: #15803d;
    font-weight: 800;
    font-size: .86rem;
}

.status-pill span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--kf-green);
    box-shadow: 0 0 0 5px rgba(24, 185, 87, .12);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px 7px 7px;
    border: 1px solid var(--kf-line);
    border-radius: 999px;
    background: #fff;
}

.user-chip > span,
.brand-icon {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--kf-orange), #ffb241);
    color: #fff;
    font-weight: 900;
}

.user-chip strong,
.user-chip small { display: block; line-height: 1.1; }
.user-chip small { color: var(--kf-muted); font-size: .78rem; margin-top: 3px; }

.admin-content { padding: 28px 32px 42px; }

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, .72fr);
    background:
        radial-gradient(circle at 14% 20%, rgba(255, 138, 0, .13), transparent 25rem),
        radial-gradient(circle at 80% 70%, rgba(24, 185, 87, .14), transparent 23rem),
        #fffaf3;
}

.login-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(32px, 6vw, 88px);
    position: relative;
    overflow: hidden;
}

.login-brand-panel::after {
    content: "";
    position: absolute;
    right: 7%;
    bottom: -80px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: rgba(255, 138, 0, .10);
}

.login-brand-mark img {
    width: min(280px, 58vw);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 18px 32px rgba(15, 23, 42, .16));
}

.login-copy { max-width: 680px; margin-top: 42px; position: relative; z-index: 1; }
.login-copy h1 { margin: 0; max-width: 620px; font-size: clamp(3rem, 7vw, 6.4rem); line-height: .95; font-weight: 950; }
.login-copy h1::after { content: ""; display: block; width: 190px; height: 7px; margin-top: 22px; border-radius: 999px; background: var(--kf-green); }
.login-copy p { max-width: 560px; color: #475569; font-size: 1.2rem; line-height: 1.6; }

.login-proof-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 720px; margin-top: 44px; position: relative; z-index: 1; }
.login-proof-grid div { padding: 18px; border: 1px solid #ffe0b8; border-radius: 18px; background: rgba(255,255,255,.75); }
.login-proof-grid strong, .login-proof-grid span { display: block; }
.login-proof-grid strong { font-size: 1.4rem; color: var(--kf-orange); }
.login-proof-grid span { color: var(--kf-muted); margin-top: 5px; }

.login-card {
    align-self: center;
    margin: 28px clamp(24px, 5vw, 72px) 28px 0;
    padding: 34px;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 28px;
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--kf-shadow);
    backdrop-filter: blur(18px);
}

.login-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.login-card h2 { margin: 0; font-size: 1.8rem; }
.login-card p { margin: 4px 0 0; color: var(--kf-muted); }

.login-form { display: grid; gap: 16px; }
.login-form label span { display: block; margin-bottom: 8px; color: #475569; font-weight: 800; }
.login-form input {
    width: 100%;
    min-height: 52px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0 16px;
    background: #f8fafc;
    outline: none;
}
.login-form input:focus { border-color: var(--kf-orange); box-shadow: 0 0 0 4px rgba(255, 138, 0, .12); background: #fff; }

.primary-action {
    min-height: 54px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--kf-orange), #ff9f1c);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 18px 30px rgba(255, 138, 0, .25);
}

.login-note { font-size: .9rem; }
.form-alert { padding: 14px 16px; border-radius: 16px; background: #fff4ed; color: #c2410c; border: 1px solid #fed7aa; margin-bottom: 16px; font-weight: 750; }
.loading-panel, .empty-state { padding: 28px; border: 1px dashed #cbd5e1; border-radius: 18px; color: var(--kf-muted); background: rgba(255,255,255,.7); }

.eyebrow { margin: 0 0 9px; color: var(--kf-orange); font-weight: 950; text-transform: uppercase; font-size: .78rem; }

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    align-items: stretch;
    padding: 30px;
    border-radius: 26px;
    background: linear-gradient(135deg, #ffffff 0%, #fff7ec 50%, #effaf2 100%);
    border: 1px solid #f6dfbf;
    box-shadow: var(--kf-shadow);
}

.dashboard-hero h1 { margin: 0; max-width: 780px; font-size: clamp(2rem, 4vw, 4rem); line-height: 1; font-weight: 950; }
.dashboard-hero h1::after { content: ""; display: block; width: 150px; height: 6px; margin-top: 18px; border-radius: 999px; background: var(--kf-green); }
.dashboard-hero p { max-width: 660px; color: #475569; font-size: 1.05rem; line-height: 1.6; }

.hero-balance { display: grid; align-content: center; padding: 24px; border-radius: 22px; background: #111827; color: #fff; }
.hero-balance span, .hero-balance small { color: rgba(255,255,255,.65); }
.hero-balance strong { font-size: 2.35rem; margin: 6px 0; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.premium-metrics { margin-top: 20px; }
.metric-card { position: relative; overflow: hidden; padding: 22px; border: 1px solid var(--kf-line); border-radius: 22px; background: #fff; box-shadow: 0 14px 38px rgba(15,23,42,.06); }
.metric-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--accent, var(--kf-orange)); }
.metric-card span, .metric-card small { display: block; color: var(--kf-muted); }
.metric-card strong { display: block; margin: 8px 0 5px; font-size: 1.8rem; }
.accent-green { --accent: var(--kf-green); }
.accent-red { --accent: var(--kf-red); }
.accent-orange { --accent: var(--kf-orange); }
.accent-dark { --accent: #111827; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .7fr); gap: 20px; margin-top: 20px; }
.panel { padding: 22px; border: 1px solid var(--kf-line); border-radius: 24px; background: #fff; box-shadow: 0 14px 38px rgba(15,23,42,.06); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.panel h2 { margin: 0; font-size: 1.22rem; }
.text-action { color: var(--kf-orange); font-weight: 900; }

.transaction-list { display: grid; gap: 10px; }
.transaction-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: #f8fafc; }
.transaction-row strong, .transaction-row small { display: block; }
.transaction-row small { color: var(--kf-muted); margin-top: 3px; }
.transaction-type { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 14px; font-weight: 950; }
.transaction-type.income { background: #dcfce7; color: #16a34a; }
.transaction-type.expense { background: #fee2e2; color: #ef4444; }
.transaction-type.adjustment { background: #ffedd5; color: #f97316; }

.brand-panel { background: #111827; color: #fff; }
.brand-panel p { color: rgba(255,255,255,.68); line-height: 1.6; }
.feature-stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.feature-stack span { padding: 8px 11px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font-weight: 850; }

.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 2.4rem; font-weight: 950; }
.page-head p { margin: 8px 0 0; color: var(--kf-muted); }
.table-wrap { overflow-x: auto; }
.premium-table { width: 100%; border-collapse: collapse; }
.premium-table th { color: var(--kf-muted); font-size: .78rem; text-align: left; text-transform: uppercase; padding: 12px; border-bottom: 1px solid var(--kf-line); }
.premium-table td { padding: 15px 12px; border-bottom: 1px solid #f1f5f9; }
.text-end, .amount { text-align: right; }
.amount { font-weight: 950; }
.amount.income { color: var(--kf-green); }
.amount.expense { color: var(--kf-red); }

.wallet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.wallet-card { display: flex; align-items: center; gap: 14px; padding: 22px; border: 1px solid var(--kf-line); border-radius: 22px; background: #fff; box-shadow: 0 14px 38px rgba(15,23,42,.06); }
.wallet-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px; background: #fff7ed; color: var(--kf-orange); font-weight: 950; }
.wallet-card small, .wallet-card strong { display: block; }
.wallet-card small { color: var(--kf-muted); }
.wallet-card strong { font-size: 1.5rem; margin-top: 4px; }

@media (max-width: 1040px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: relative; height: auto; }
    .dashboard-hero, .content-grid, .login-shell { grid-template-columns: 1fr; }
    .login-card { margin: 0 clamp(20px, 6vw, 60px) 40px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .admin-topbar { align-items: flex-start; flex-direction: column; padding: 16px 20px; }
    .topbar-actions { width: 100%; justify-content: space-between; }
    .admin-content { padding: 20px; }
    .metric-grid, .login-proof-grid { grid-template-columns: 1fr; }
    .dashboard-hero { padding: 22px; }
}



.success-alert {
    padding: 14px 16px;
    border-radius: 16px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #bbf7d0;
    margin-bottom: 16px;
    font-weight: 750;
}

.config-form { max-width: 980px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-grid label,
.toggle-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-grid span,
.toggle-row strong {
    color: #334155;
    font-weight: 800;
}

.form-grid input {
    min-height: 48px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    padding: 0 14px;
    color: #111827;
    background: #fff;
    outline: none;
}

.form-grid input:focus {
    border-color: #ff8a00;
    box-shadow: 0 0 0 4px rgba(255, 138, 0, .12);
}

.toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.toggle-row {
    flex-direction: row;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fffaf3;
}

.toggle-row input { margin-top: 4px; accent-color: #ff8a00; }
.toggle-row small { display: block; color: #64748b; margin-top: 3px; }

@media (max-width: 820px) {
    .form-grid,
    .toggle-grid { grid-template-columns: 1fr; }
}
