/*
 * The signed-in app frame: top bar, sidebar and the page area, in the
 * Zoho Books layout.
 *
 * Plain CSS on purpose. app.css is built by Tailwind, and a class that was not
 * in the views when it was last built simply does not exist; the frame must
 * never depend on that. The colours come from the same --c-* variables as
 * app.css, so light and dark mode follow the one theme switch.
 */

:root {
    --sh-top: #21263C;          /* top bar */
    --sh-top-line: #2F3550;
    --sh-top-field: #2A3049;
    --sh-top-field-line: #454C68;
    --sh-top-text: #FFFFFF;
    --sh-top-muted: #B8BDCC;
    --sh-accent: #408DFB;       /* the + button, underlines, chart */
    --sh-side: #F7F7FB;         /* sidebar, as Zoho Books */
    --sh-side-line: #E6E6EF;
    --sh-side-hover: #EDEDF6;
    --sh-side-text: #21263C;
    --sh-side-muted: #6C718A;
    --sh-side-open: #EBEBF7;    /* the group whose page is open */
    --sh-side-current: #E2E2F4; /* the open page under a group */
    --sh-side-plus: #D5D5EE;    /* its + box */
    --sh-active: #408DFB;       /* selected top-level item (Home, Banking…) */
    --sh-font: Inter, 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
    --sh-width: 256px;
    --sh-width-collapsed: 60px;
    --sh-top-height: 52px;
}

.dark {
    --sh-top: #11141C;
    --sh-top-line: #262B3A;
    --sh-top-field: #1C202C;
    --sh-top-field-line: #333A4D;
    --sh-side: #161A24;
    --sh-side-line: #262B3A;
    --sh-side-hover: #222838;
    --sh-side-text: #E5E7EB;
    --sh-side-muted: #9AA1B2;
    --sh-side-open: #1E2332;
    --sh-side-current: #262C3F;
    --sh-side-plus: #343B52;
    --sh-active: #2F7DEB;
}

html, body { height: 100%; }

body.sh-body {
    margin: 0;
    display: flex;
    flex-direction: column;
    background: rgb(var(--c-surface));
    color: rgb(var(--c-ink));
    font-family: Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    overflow: hidden;
}

.sh-body .font-display { font-family: inherit; }

/* ================================================================ top bar */

.sh-top {
    height: var(--sh-top-height);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--sh-top);
    color: var(--sh-top-text);
    position: relative;
    z-index: 50;
}

.sh-brand {
    width: var(--sh-width);
    height: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    border-right: 1px solid var(--sh-top-line);
    color: var(--sh-top-text);
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: width .15s ease;
}
.sh-brand:hover { color: var(--sh-top-text); text-decoration: none; }
.sh-brand svg { flex-shrink: 0; display: block; }
.sh-brand-name { font-weight: 900; }
.sh-brand-accent { color: #6FA8FF; }

.sh-icon-button {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--sh-top-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}
.sh-icon-button:hover { background: rgba(255, 255, 255, 0.08); color: var(--sh-top-text); }
.sh-icon-button:focus-visible,
.sh-top summary:focus-visible,
.sh-top a:focus-visible { outline: 2px solid var(--sh-accent); outline-offset: 2px; }

.sh-burger { display: none; margin-left: 8px; }

.sh-search {
    margin-left: 18px;
    width: 340px;
    max-width: 34vw;
    height: 34px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid var(--sh-top-field-line);
    border-radius: 6px;
    background: var(--sh-top-field);
    color: var(--sh-top-muted);
}
.sh-search:focus-within { border-color: var(--sh-accent); }
.sh-search input {
    flex-grow: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    outline: none;
    color: var(--sh-top-text);
    font: inherit;
    font-size: 13.5px;
}
.sh-search input::placeholder { color: var(--sh-top-muted); opacity: 1; }
.sh-search-divider { width: 1px; height: 18px; background: var(--sh-top-field-line); }
.sh-search svg { flex-shrink: 0; }

.sh-spacer { flex-grow: 1; }

.sh-top-divider { width: 1px; height: 22px; background: var(--sh-top-line); margin: 0 6px; }

/* <details> menus in the top bar */
.sh-menu { position: relative; }
.sh-menu > summary { list-style: none; cursor: pointer; user-select: none; }
.sh-menu > summary::-webkit-details-marker { display: none; }

.sh-org-button {
    height: 36px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border-radius: 6px;
    color: var(--sh-top-text);
    font-size: 14.5px;
    max-width: 260px;
}
.sh-org-button:hover { background: rgba(255, 255, 255, 0.08); }
.sh-org-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sh-plus {
    width: 34px;
    height: 34px;
    border-radius: 5px;
    background: var(--sh-accent);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sh-plus:hover { filter: brightness(1.08); }

.sh-avatar {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    border: 2px solid #FFFFFF;
    background: #DCE3EE;
    color: #21263C;
    font-size: 12.5px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 12px 0 4px;
}

.sh-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    background: rgb(var(--c-surface));
    color: rgb(var(--c-ink));
    border: 1px solid rgb(var(--c-line));
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(15, 20, 35, 0.18);
    overflow: hidden;
}
.sh-panel-left { left: 0; right: auto; }
.sh-panel a { text-decoration: none; }

/* Organization menu (Views/Account/_OrganizationMenu.cshtml) */
.sh-om { width: 320px; max-width: 100%; }
.sh-om [hidden] { display: none !important; }
.sh-om-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px 10px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: rgb(var(--c-muted));
    border-bottom: 1px solid rgb(var(--c-line));
}
.sh-om-count {
    min-width: 20px; padding: 1px 7px; border-radius: 10px; text-align: center;
    background: rgb(var(--c-ground)); color: rgb(var(--c-ink-soft)); letter-spacing: 0;
}
.sh-om-search { padding: 10px 12px; border-bottom: 1px solid rgb(var(--c-line)); }
.sh-om-search input {
    width: 100%; height: 32px; box-sizing: border-box; padding: 0 10px;
    border: 1px solid rgb(var(--c-line-strong)); border-radius: 4px;
    background: rgb(var(--c-surface)); color: rgb(var(--c-ink)); font-size: 13px;
}
.sh-om-search input:focus { outline: none; border-color: rgb(var(--c-primary)); box-shadow: 0 0 0 3px rgb(var(--c-primary) / .15); }
.sh-om-list { list-style: none; margin: 0; padding: 4px 0; max-height: 300px; overflow-y: auto; }
.sh-om-list form { margin: 0; }
.sh-om-item {
    width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 9px 16px; border: 0; background: transparent; text-align: left;
    color: rgb(var(--c-ink)); cursor: pointer; font: inherit;
}
.sh-om-item:hover { background: rgb(var(--c-ground)); }
.sh-om-item.is-current { background: rgb(var(--c-primary) / .07); cursor: default; }
.sh-om-tile {
    width: 34px; height: 34px; flex-shrink: 0; box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgb(var(--c-line)); border-radius: 6px;
    background: rgb(var(--c-ground)); color: rgb(var(--c-ink-soft));
    font-size: 12.5px; font-weight: 700;
}
.sh-om-item.is-current .sh-om-tile:not(.sh-om-logo) { background: #1E6FD9; border-color: #1E6FD9; color: #FFFFFF; }
.sh-om-logo { object-fit: contain; background: #FFFFFF; padding: 2px; }
.sh-om-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.sh-om-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-om-meta { font-size: 11.5px; color: rgb(var(--c-muted)); }
.sh-om-tick { flex-shrink: 0; color: rgb(var(--c-primary)); }
.sh-om-empty { margin: 0; padding: 14px 16px; font-size: 13px; color: rgb(var(--c-muted)); }
.sh-om-foot {
    display: flex; align-items: center; justify-content: space-between;
    border-top: 1px solid rgb(var(--c-line)); background: rgb(var(--c-ground));
}
.sh-om-foot a { padding: 11px 16px; font-size: 13px; font-weight: 700; color: rgb(var(--c-primary)); }
.sh-om-foot a:hover { text-decoration: underline; }
.sh-om-new { display: inline-flex; align-items: center; gap: 6px; }
.sh-om-manage { color: rgb(var(--c-ink-soft)) !important; font-weight: 400 !important; }

/* The current organization's logo in the top-bar button */
.sh-org-logo {
    width: 22px; height: 22px; flex-shrink: 0; border-radius: 4px;
    object-fit: contain; background: #FFFFFF; padding: 1px; box-sizing: border-box;
}

/* Quick create: columns of links, as in Zoho's + menu */
.sh-create {
    width: min(920px, 92vw);
    padding: 20px 22px 18px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px 22px;
}
.sh-create h3 {
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgb(var(--c-muted));
}
.sh-create ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.sh-create a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px;
    border-radius: 5px;
    font-size: 14px;
    color: rgb(var(--c-ink));
}
.sh-create a::before {
    content: '+';
    width: 15px;
    height: 15px;
    border-radius: 8px;
    background: rgb(var(--c-line-strong));
    color: rgb(var(--c-surface));
    font-size: 12px;
    font-weight: 900;
    line-height: 15px;
    text-align: center;
    flex-shrink: 0;
}
.sh-create a:hover { background: rgb(var(--c-ground)); color: var(--sh-active); }
.sh-create a:hover::before { background: var(--sh-active); }

/* Profile panel */
.sh-profile { width: 320px; }
.sh-profile-head { display: flex; gap: 12px; align-items: center; padding: 16px 18px; border-bottom: 1px solid rgb(var(--c-line)); }
.sh-profile-head .sh-avatar { margin: 0; width: 44px; height: 44px; border-radius: 22px; font-size: 16px; border-color: rgb(var(--c-line)); }
.sh-profile-name { font-weight: 700; font-size: 15px; }
.sh-profile-meta { font-size: 12.5px; color: rgb(var(--c-muted)); overflow-wrap: anywhere; }
.sh-profile-links { display: flex; flex-direction: column; padding: 6px 0; }
.sh-profile-links a,
.sh-profile-links button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 14px;
    color: rgb(var(--c-ink));
    text-align: left;
    cursor: pointer;
    width: 100%;
}
.sh-profile-links a:hover,
.sh-profile-links button:hover { background: rgb(var(--c-ground)); }
.sh-profile-links .sh-signout { color: rgb(var(--c-danger)); }
.sh-profile-links form { margin: 0; }

/* ================================================================= frame */

.sh-frame { flex-grow: 1; min-height: 0; display: flex; }

/* ================================================================ sidebar */

.sh-side {
    width: var(--sh-width);
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background: var(--sh-side);
    border-right: 1px solid var(--sh-side-line);
    font-family: var(--sh-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: width .15s ease;
}

.sh-side-scroll {
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
    scrollbar-color: #C9CBD8 transparent;
}

.sh-side a { text-decoration: none; }

/*
 * Rows, in the Zoho Books sidebar measurements: 15px text, 40px rows, 20px
 * icons, 8px corners. The label starts 60px in, and sub-items line up under it.
 */
.sh-nav-link,
.sh-group > summary {
    height: 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 10px 0 6px;
    border-radius: 8px;
    color: var(--sh-side-text);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: -0.005em;
    white-space: nowrap;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.sh-group > summary::-webkit-details-marker { display: none; }
.sh-nav-link:hover,
.sh-group > summary:hover { background: var(--sh-side-hover); color: var(--sh-side-text); }

.sh-chevron {
    width: 14px;
    flex-shrink: 0;
    display: inline-flex;
    justify-content: center;
    color: var(--sh-side-muted);
    transition: transform .15s ease;
}
.sh-group[open] > summary .sh-chevron { transform: rotate(90deg); }
.sh-nav-icon { flex-shrink: 0; display: inline-flex; margin-right: 2px; }
.sh-nav-icon svg { width: 20px; height: 20px; stroke-width: 1.5; }
.sh-nav-label { overflow: hidden; text-overflow: ellipsis; }

/* A top-level page that is open: the Zoho blue pill. */
.sh-nav-link.is-active,
.sh-nav-link.is-active:hover {
    background: var(--sh-active);
    color: #FFFFFF;
    font-weight: 500;
}
.sh-nav-link.is-active .sh-chevron { color: #FFFFFF; }

/* A group holding the open page: tinted, like Zoho. */
.sh-group.has-active > summary,
.sh-group.has-active > summary:hover { background: var(--sh-side-open); }

.sh-sub { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 4px; }
.sh-sub-row { position: relative; display: flex; }
.sh-sub-link {
    flex-grow: 1;
    min-width: 0;
    height: 38px;
    line-height: 38px;
    box-sizing: border-box;
    display: block;
    padding: 0 8px 0 60px;
    border-radius: 6px;
    color: var(--sh-side-text);
    font-size: 15px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sh-sub-link:hover { background: var(--sh-side-hover); color: var(--sh-side-text); }
/* Room for the + only where it shows, so long names aren't cut short otherwise. */
.sh-sub-row:has(.sh-sub-new):hover .sh-sub-link,
.sh-sub-row:has(.sh-sub-new:focus-visible) .sh-sub-link,
.sh-sub-link.is-active:has(+ .sh-sub-new) { padding-right: 38px; }
.sh-sub-link.is-active,
.sh-sub-link.is-active:hover { background: var(--sh-side-current); color: var(--sh-side-text); font-weight: 500; }

/*
 * The + at the end of a sub-item: always there on the open page, and on any
 * other row when the pointer is over it or it has keyboard focus.
 */
.sh-sub-new {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    box-sizing: border-box;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sh-side-text);
    background: var(--sh-side-plus);
    opacity: 0;
    transition: opacity .12s ease, background .12s ease;
}
.sh-sub-new svg { width: 16px; height: 16px; stroke-width: 2.2; }
.sh-sub-row:hover .sh-sub-new,
.sh-sub-new:focus-visible,
.sh-sub-link.is-active + .sh-sub-new { opacity: 1; }
.sh-sub-row:hover .sh-sub-link:not(.is-active) + .sh-sub-new { background: var(--sh-side-current); }
.sh-sub-new:hover,
.sh-sub-row:hover .sh-sub-link + .sh-sub-new:hover { background: var(--sh-active); color: #FFFFFF; }
.sh-sub-new:focus-visible { outline: 2px solid var(--sh-active); outline-offset: 1px; }

.sh-side-section {
    margin: 18px 8px 6px;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--sh-side-muted);
}

.sh-side-foot {
    flex-shrink: 0;
    padding: 8px 10px 10px;
    border-top: 1px solid var(--sh-side-line);
    display: flex;
    justify-content: flex-end;
}
.sh-collapse {
    width: 34px;
    height: 30px;
    border: 1px solid var(--sh-side-line);
    border-radius: 6px;
    background: rgb(var(--c-surface));
    color: var(--sh-side-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.sh-collapse:hover { color: var(--sh-side-text); }

/* Collapsed: icons only. Groups open as a flyout on hover. */
.sh-collapsed .sh-side { width: var(--sh-width-collapsed); }
.sh-collapsed .sh-brand { width: var(--sh-width-collapsed); padding: 0; justify-content: center; }
.sh-collapsed .sh-brand-name,
.sh-collapsed .sh-nav-label,
.sh-collapsed .sh-chevron,
.sh-collapsed .sh-side-section { display: none; }
.sh-collapsed .sh-nav-link,
.sh-collapsed .sh-group > summary { justify-content: center; padding: 0; }
.sh-collapsed .sh-side-scroll { overflow: visible; }
.sh-collapsed .sh-side-foot { justify-content: center; }
.sh-collapsed .sh-collapse svg { transform: rotate(180deg); }
.sh-collapsed .sh-group { position: relative; }
.sh-collapsed .sh-group > .sh-sub { display: none; }
.sh-collapsed .sh-group:hover > .sh-sub {
    display: flex;
    position: absolute;
    left: calc(100% + 6px);
    top: 0;
    z-index: 45;
    min-width: 220px;
    padding: 6px;
    background: rgb(var(--c-surface));
    border: 1px solid rgb(var(--c-line));
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(15, 20, 35, 0.16);
}
.sh-collapsed .sh-group:hover > .sh-sub .sh-sub-link { padding-left: 12px; }
.sh-collapsed .sh-group.has-active > summary { background: var(--sh-side-open); }

/* ================================================================== main */

.sh-main {
    flex-grow: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 24px 28px 40px;
    background: rgb(var(--c-surface));
}
.sh-main-flush { padding: 0; }

.sh-flash {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 6px;
    font-size: 14px;
}
.sh-flash-ok { background: rgb(var(--c-positive) / 0.08); color: rgb(var(--c-positive)); border: 1px solid rgb(var(--c-positive) / 0.3); }
.sh-flash-error { background: rgb(var(--c-danger) / 0.06); color: rgb(var(--c-danger)); border: 1px solid rgb(var(--c-danger) / 0.3); }

/* ============================================================ small screens */

@media (max-width: 1023px) {
    .sh-burger { display: inline-flex; }
    .sh-brand { width: auto; border-right: 0; padding: 0 8px; }
    .sh-search { max-width: none; width: auto; flex: 1 1 0; min-width: 0; margin-left: 4px; }
    .sh-org-name { max-width: 120px; }
    .sh-side {
        position: fixed;
        top: var(--sh-top-height);
        bottom: 0;
        left: 0;
        z-index: 48;
        transform: translateX(-100%);
        transition: transform .18s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
    }
    .sh-nav-open .sh-side { transform: none; }
    .sh-collapse { display: none; }
    .sh-main { padding: 18px 16px 32px; }
    .sh-create { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .sh-brand-name, .sh-org-name, .sh-hide-sm, .sh-search-divider { display: none; }
    .sh-panel { position: fixed; left: 8px; right: 8px; top: calc(var(--sh-top-height) + 6px); width: auto; }
    .sh-create { width: auto; grid-template-columns: minmax(0, 1fr); max-height: 70vh; overflow-y: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .sh-side, .sh-brand, .sh-chevron { transition: none; }
}

/* ============================================================ dashboard */

.db-head {
    margin: -24px -28px 0;
    padding: 18px 28px 0;
    background: rgb(var(--c-ground));
    border-bottom: 1px solid rgb(var(--c-line));
}
.db-hello { display: flex; align-items: flex-start; gap: 14px; }
.db-org-icon {
    width: 46px; height: 46px; flex-shrink: 0;
    border: 1px solid rgb(var(--c-line)); border-radius: 8px;
    background: rgb(var(--c-surface)); color: rgb(var(--c-muted));
    display: flex; align-items: center; justify-content: center;
}
.db-hello h1 { margin: 0; font-size: 20px; font-weight: 700; }
.db-hello p { margin: 3px 0 0; font-size: 13.5px; color: rgb(var(--c-muted)); }
.db-hello-links { margin-left: auto; display: flex; gap: 18px; padding-top: 4px; font-size: 13.5px; }
.db-hello-links a { color: rgb(var(--c-primary)); text-decoration: none; }
.db-hello-links a:hover { text-decoration: underline; }

.db-tabs { margin-top: 16px; display: flex; gap: 26px; }
.db-tabs a {
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 2px;
    border-bottom: 3px solid transparent;
    font-size: 15px;
    color: rgb(var(--c-muted));
    text-decoration: none;
}
.db-tabs a:hover { color: rgb(var(--c-ink)); }
.db-tabs a[aria-current="page"] { color: rgb(var(--c-ink)); border-bottom-color: var(--sh-accent); }

.db-body { padding-top: 22px; display: flex; flex-direction: column; gap: 22px; width: 100%; }

.db-banner {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px; border-radius: 8px;
    background: rgb(var(--c-primary) / 0.07);
    border: 1px solid rgb(var(--c-primary) / 0.14);
}
.db-banner-icon {
    width: 42px; height: 42px; flex-shrink: 0; border-radius: 8px;
    background: rgb(var(--c-surface)); color: rgb(var(--c-primary));
    display: flex; align-items: center; justify-content: center;
}
.db-banner-text { flex-grow: 1; display: flex; flex-direction: column; gap: 3px; }
.db-banner-sample { margin-bottom: 20px; }
.db-banner-text strong { font-size: 15px; }
.db-banner-text span { font-size: 14px; color: rgb(var(--c-ink-soft)); }
.db-button {
    height: 36px; padding: 0 16px; border-radius: 4px; border: 0;
    background: var(--sh-active); color: #FFFFFF;
    font: inherit; font-size: 14px; font-weight: 700;
    display: inline-flex; align-items: center; white-space: nowrap; text-decoration: none; cursor: pointer;
}
.db-button:hover { filter: brightness(1.08); color: #FFFFFF; text-decoration: none; }
.db-dismiss {
    width: 32px; height: 32px; flex-shrink: 0; border: 0; border-radius: 6px; background: transparent;
    color: rgb(var(--c-ink-soft)); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.db-dismiss:hover { background: rgb(var(--c-ink) / 0.06); }

.db-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 900px) { .db-grid { grid-template-columns: minmax(0, 1fr); } }

.db-card { border: 1px solid rgb(var(--c-line)); border-radius: 8px; background: rgb(var(--c-surface)); overflow: hidden; }
.db-card-head {
    height: 48px; box-sizing: border-box; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: rgb(var(--c-ground)); border-bottom: 1px solid rgb(var(--c-line));
}
.db-card-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.db-card-head h2 a { color: inherit; text-decoration: none; }
.db-card-head h2 a:hover { text-decoration: underline; }
.db-new { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: rgb(var(--c-primary)); text-decoration: none; }
.db-new:hover { text-decoration: underline; }
.db-new-dot { width: 16px; height: 16px; border-radius: 8px; background: var(--sh-accent); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; }
.db-card-body { padding: 18px 20px 20px; }
.db-label { font-size: 13.5px; color: rgb(var(--c-muted)); }
.db-amount { margin-top: 4px; font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.db-bar { margin-top: 16px; height: 10px; border-radius: 5px; background: rgb(var(--c-line-faint)); display: flex; overflow: hidden; }
.db-bar-current { background: var(--sh-accent); }
.db-bar-overdue { background: #F58A2F; }
.db-legend { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; }
.db-legend span { display: inline-flex; align-items: center; gap: 6px; }
.db-legend b { font-variant-numeric: tabular-nums; }
.db-key { width: 9px; height: 9px; flex-shrink: 0; }
.db-key-current { background: var(--sh-accent); }
.db-key-overdue { background: #F58A2F; }
.db-key-open { background: #9CA3AF; }
.db-key-in { background: #22A06B; }
.db-key-out { background: #D6433B; }

.db-flow { display: flex; gap: 24px; padding: 16px 20px 18px; }
.db-flow svg { flex: 1 1 auto; width: 100%; min-width: 0; height: auto; color: var(--sh-accent); }
.db-flow dl { margin: 0; min-width: 210px; display: flex; flex-direction: column; gap: 14px; text-align: right; }
.db-flow dt { font-size: 13.5px; color: rgb(var(--c-muted)); display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.db-flow dd { margin: 4px 0 0; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .db-flow { flex-direction: column; } .db-flow dl { text-align: left; } .db-flow dt { justify-content: flex-start; } }

.db-empty { padding: 28px 20px; font-size: 14px; color: rgb(var(--c-muted)); }

.db-activity { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.db-activity th { text-align: left; padding: 10px 20px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgb(var(--c-muted)); border-bottom: 1px solid rgb(var(--c-line)); }
.db-activity td { padding: 11px 20px; border-bottom: 1px solid rgb(var(--c-line-faint)); vertical-align: top; }
.db-activity tr:last-child td { border-bottom: 0; }
.db-muted { color: rgb(var(--c-muted)); }

/* Small-screen dashboard rules come last so they override the ones above. */
@media (max-width: 1023px) {
    .db-head { margin: -18px -16px 0; padding: 16px 16px 0; }
    .db-hello-links { display: none; }
}

@media (max-width: 640px) {
    .db-banner { flex-wrap: wrap; align-items: flex-start; }
    .db-banner-text { flex: 1 1 calc(100% - 110px); }
    .db-banner .db-button { order: 3; margin-left: 58px; }
    .db-dismiss { margin-left: auto; }
    .db-amount { font-size: 19px; }
    .db-hello h1 { font-size: 18px; }
}

/* ======================================================= sign-up set-up page */
.sh-setup { overflow: auto; }
.sh-setup-top {
    height: 56px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
    padding: 0 22px; background: var(--sh-top); color: #FFFFFF;
}
.sh-setup-brand { display: flex; align-items: center; gap: 10px; }
.sh-setup-brand .sh-brand-name { color: #FFFFFF; font-size: 18px; font-weight: 900; }
.sh-setup-signout {
    border: 1px solid rgb(255 255 255 / .25); background: transparent; color: #FFFFFF;
    font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 4px; cursor: pointer;
}
.sh-setup-signout:hover { background: rgb(255 255 255 / .08); }
.sh-setup-main { overflow: visible; }
