/* =====================================================
   SENAPI THEME BRIDGE
--------------------------------------------------------
   variables.css + app.css (ported from Template8) style the
   window/titlebar/topbar/sidebar/statusbar/CLI chrome and the
   generic .btn/.btn-primary/.table classes — untouched, same
   navy/amber palette the client picked. This file covers
   everything specific to SENAPI's own pages: signed-in-as,
   login shell, status badges, forms, and the budget dashboard
   (category cards, percent rings, execution bars).
===================================================== */


/* ==========================
   ICON SVGs
   Template8's sidebar ships emoji icons in a 22px `.icon` swatch;
   IconLibrary.cs/Icon.razor replace those with inline currentColor SVGs,
   which need explicit sizing since an unstyled <svg> defaults to 300x150.
========================== */

.icon-svg {
    display: block;
    width: 100%;
    height: 100%;
}

.sidebar-item .icon .icon-svg {
    width: 13px;
    height: 13px;
}


/* ==========================
   TOPBAR MENU PANEL — "Aide" dropdown
   Template8's File/Edit/View pills are decorative placeholders with no
   panel underneath; the Aide menu is the one dropdown that's actually
   functional (it just links to the manual). Click-to-open (via
   topbar-menu.js), not :hover — a hover-only panel with any gap between
   trigger and panel has a dead zone where the cursor loses :hover before
   reaching the panel, closing it before it can be clicked.
========================== */

.menu-dropdown {
    position: relative;
}

.menu-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    flex-direction: column;
    gap: 2px;
    min-width: 200px;
    padding: 6px;
    background: var(--blue-box-bg);
    border-radius: 14px;
    box-shadow: 0 20px 40px -22px rgba(0, 0, 0, .65);
    z-index: 20;
}

.menu-dropdown.open .menu-panel {
    display: flex;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 12.5px;
    text-align: left;
    text-decoration: none;
    color: var(--text-dark);
    background: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

.menu-item:hover {
    background: var(--dropdown-hover);
}


/* ==========================
   SIDEBAR FOOTER — signed-in identity
========================== */

.signed-in-as {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 4px 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--blue-box-border, rgba(255, 255, 255, .08));
}

.signed-in-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
}

.signed-in-role {
    font-size: 10.5px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-faint);
}


/* ==========================
   TOPBAR — signed-in user
========================== */

.topbar-user {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
    padding-right: 4px;
}


/* ==========================
   STATUS BADGE
========================== */

.status-badge {
    display: inline-block;
    padding: .2rem .7rem;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
}

.status-ok {
    background: var(--icon-blue-soft);
    color: var(--icon-blue);
}

.status-warn {
    background: rgba(255, 189, 46, .18);
    color: #ffbd2e;
}

.status-error {
    background: rgba(237, 20, 64, .14);
    color: #ED1440;
}

p.status-badge {
    display: block;
    margin: 1rem 0 0;
    padding: .6rem 1rem;
    border-radius: 10px;
}


/* ==========================
   FORM GRID
========================== */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
    max-width: 760px;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    font-size: 12.5px;
    color: var(--text-muted);
}

.form-grid input,
.form-grid select {
    padding: 8px 12px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-dark);
    background: var(--window-bg);
    border: 1px solid var(--blue-box-border, transparent);
    border-radius: 10px;
}

.form-grid input:focus,
.form-grid select:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--icon-blue-soft);
}

.form-grid input.invalid,
.form-grid select.invalid {
    border-color: #ED1440;
}

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


/* ==========================
   TOOLBAR
========================== */

.toolbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.toolbar select,
.toolbar input {
    padding: 7px 12px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-dark);
    background: var(--window-bg);
    border: 1px solid var(--blue-box-border, transparent);
    border-radius: 999px;
}


/* ==========================
   LOGIN
========================== */

.login-shell {
    width: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 360px;
    padding: 2.25rem 2rem;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.login-brand svg {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
}

.login-brand span {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}

.login-card h1 {
    margin: 0 0 1.25rem;
    font-size: 1.15rem;
    color: var(--text-dark);
}

.login-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.login-fields label {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    font-size: 12.5px;
    color: var(--text-muted);
}

.login-fields input {
    padding: 10px 14px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-dark);
    background: var(--window-bg);
    border: 1px solid var(--blue-box-border, transparent);
    border-radius: 10px;
}

.login-fields input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--icon-blue-soft);
}

.login-submit {
    width: 100%;
    justify-content: center;
    margin-top: .25rem;
}


/* ==========================
   BUDGET DASHBOARD
========================== */

.budget-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
    margin-bottom: 1.75rem;
}

@media (max-width: 900px) {
    .budget-board {
        grid-template-columns: 1fr;
    }
}

.budget-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.budget-card-body {
    flex: 1;
    min-width: 0;
}

.budget-card-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 0 0 .5rem;
}

.budget-card-figure {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    margin-bottom: .25rem;
}

.budget-card-executed {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.budget-card-allocated {
    font-size: 12px;
    color: var(--text-muted);
}

.budget-card-remaining {
    font-size: 11.5px;
    color: var(--text-faint);
    margin: 0;
}

.percent-ring {
    position: relative;
    width: 76px;
    height: 76px;
    flex: 0 0 auto;
}

.percent-ring svg {
    transform: rotate(-90deg);
}

.percent-ring circle {
    fill: none;
    stroke-width: 9;
}

.percent-ring .track {
    stroke: var(--window-bg);
}

.percent-ring .fill {
    stroke: var(--icon-blue);
    stroke-linecap: round;
    transition: stroke-dashoffset .4s var(--uk-ease-out, ease-out);
}

.percent-ring b {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--text-dark);
}

.budget-lines-table .exec-bar-cell {
    min-width: 140px;
}

.exec-bar-track {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: var(--window-bg);
    overflow: hidden;
}

.exec-bar-fill {
    position: absolute;
    inset: 0;
    width: var(--pct, 0%);
    background: var(--icon-blue);
    border-radius: 999px;
}

.exec-bar-pct {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-faint);
}
