:root {
    color-scheme: light;
    --ac-ink: #253448;
    --ac-muted: #62748b;
    --ac-brand: #345b81;
    --ac-brand-deep: #264b70;
    --ac-border: #dce5ed;
    --ac-surface: #ffffff;
    --ac-bg: #f2f5f8;
    --ac-soft: #eaf0f5;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
    margin: 0;
    background: var(--ac-bg);
    color: var(--ac-ink);
    font: 400 0.94rem/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-text-size-adjust: 100%;
}
a { color: var(--ac-brand-deep); text-underline-offset: 3px; }
a:hover { color: #163650; }
button, input, select, textarea { font: inherit; }
button, .ac-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.55rem 1rem;
    border: 1px solid var(--ac-brand);
    border-radius: 8px;
    background: var(--ac-brand);
    color: #fff;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}
button:hover, .ac-button:hover { background: var(--ac-brand-deep); color: #fff; }
button:disabled { opacity: .55; cursor: not-allowed; }
.ac-button--secondary {
    color: var(--ac-brand-deep);
    background: #fff;
    border-color: #c1d0df;
}
.ac-button--secondary:hover { background: #edf3f8; color: var(--ac-brand-deep); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid #93b6da;
    outline-offset: 2px;
}
main {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 52px;
}
main > h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 0 0 1rem; line-height: 1.22; }
main > h2 { font-size: 1.2rem; margin-top: 2rem; }
main > p, main > ul { max-width: 100%; }
h1, h2, h3 { color: #243b55; }
.ac-topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem; margin-bottom: 1.25rem; }
.ac-brand { font-size: 1.05rem; font-weight: 800; letter-spacing: .02em; color: var(--ac-brand-deep); }
.ac-back { font-weight: 600; text-decoration: none; }
.ac-heading { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap: .7rem; margin-bottom: 1.5rem; }
.ac-heading h1 { margin:0; font-size: clamp(1.55rem, 3vw, 2.2rem); line-height: 1.2; }
.ac-heading p { margin: .4rem 0 0; color: var(--ac-muted); }
.ac-badge { display: inline-flex; align-items: center; background: var(--ac-soft); border:1px solid var(--ac-border); border-radius: 999px; padding: .3rem .8rem; color: #35536e; font-size: .85rem; font-weight: 650; }
.ac-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.ac-panel {
    min-width: 0;
    padding: 1.25rem 1.4rem;
    background: var(--ac-surface);
    border: 1px solid var(--ac-border);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(32, 51, 73, .035);
    margin-bottom: 1.2rem;
}
.ac-grid .ac-panel { margin-bottom:0; }
.ac-panel__header { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .7rem; margin-bottom: 1rem; }
.ac-panel h2, .ac-panel__header h2 { font-size: 1.12rem; line-height:1.3; margin: 0; }
.ac-panel__header small { font-size: .85rem; color: var(--ac-muted); }
.ac-muted { color: var(--ac-muted); }
.ac-form { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.ac-field { flex: 1 1 160px; min-width: 0; }
.ac-field--wide { flex-basis: 280px; }
.ac-field label, .ac-form label { display:block; font-size: .88rem; font-weight: 650; margin-bottom: .3rem; }
.ac-field input, .ac-field textarea, .ac-field select,
main input:not([type="hidden"]), main textarea, main select {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: .55rem .7rem;
    border: 1px solid #becddc;
    border-radius: 8px;
    color: var(--ac-ink);
    background: #fff;
}
main textarea { min-height: 90px; resize: vertical; }
.ac-form button { flex: 0 0 auto; }
.ac-inline-form { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .65rem; }
.ac-inline-form select { width: auto; min-width: 140px; }
.ac-inline-form button { min-height: 38px; }
.ac-actions { display:flex; align-items:center; gap: .55rem; flex-wrap: wrap; }
.ac-export { display: inline-flex; align-items: center; min-height: 38px; border:1px solid #c7d5e2; border-radius:8px; padding:.45rem .75rem; text-decoration: none; font-size:.88rem; font-weight: 650; }
.ac-export:hover { background: #f0f5fa; }
.ac-table-scroll { width:100%; overflow-x: auto; border:1px solid var(--ac-border); border-radius: 10px; }
.ac-table-scroll table, main > table { width:100%; border-collapse: collapse; }
.ac-table-scroll table { min-width: 670px; }
.ac-table-scroll th, .ac-table-scroll td, main > table th, main > table td {
    padding: .75rem .85rem;
    border-bottom: 1px solid #e9eef3;
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
    font-size: .87rem;
}
.ac-table-scroll th, main > table th { font-size: .8rem; background:#eff3f7; color:#40546b; font-weight: 750; }
.ac-table-scroll tr:last-child td { border-bottom: 0; }
.ac-table-scroll tbody tr:hover { background: #f8fafc; }
.ac-number { text-align:right !important; font-variant-numeric: tabular-nums; }
.ac-empty { text-align:center !important; padding: 1.6rem !important; white-space:normal !important; color: var(--ac-muted); }
.ac-tasks { margin: 1.2rem 0 0; padding:0; list-style:none; display:grid; gap:.65rem; }
.ac-task { padding: .9rem 1rem; border:1px solid var(--ac-border); border-radius: 10px; background:#fafcff; overflow-wrap:anywhere; }
.ac-task strong { color: var(--ac-brand-deep); }
.ac-note { margin-top:1.2rem; font-size:.84rem; color:var(--ac-muted); }
[role="status"] { padding:.8rem 1rem; border-radius:8px; background:#ecf8f0; border:1px solid #b4dfc2; color:#27623d; }
[role="alert"] { padding:.8rem 1rem; border-radius:8px; background:#fff0ef; border:1px solid #e9b8b5; color:#8d3430; }
@media (max-width: 760px) {
    main { width: calc(100% - 24px); padding: 16px 0 32px; }
    .ac-grid { grid-template-columns:1fr; }
    .ac-panel { padding:1rem; border-radius: 10px; }
    .ac-form { align-items:stretch; }
    .ac-field, .ac-field--wide { flex-basis:100%; }
    .ac-form button, .ac-actions, .ac-export { width:100%; }
    .ac-form button { min-height:44px; }
    .ac-panel__header { align-items:flex-start; }
    .ac-table-scroll th, .ac-table-scroll td { padding:.67rem .7rem; }
}
@media (prefers-reduced-motion: no-preference) {
    button, .ac-button, .ac-export { transition: background-color .14s ease; }
}

/* Standard forms and lists used by the other accounting portal screens. */
main > form {
    display: grid;
    gap: .5rem;
    width: min(100%, 680px);
    padding: 1.25rem 1.4rem;
    background: var(--ac-surface);
    border: 1px solid var(--ac-border);
    border-radius: 14px;
    margin: 1rem 0 1.5rem;
}
main > form > label { font-weight: 650; margin-top: .35rem; }
main > form > button { justify-self: start; margin-top: .5rem; }
main > table {
    min-width: 640px;
    background: white;
    border: 1px solid var(--ac-border);
    margin-bottom: 1.25rem;
}
main > ul {
    padding-left: 0;
    list-style: none;
    display: grid;
    gap: .7rem;
}
main > ul > li {
    padding: .9rem 1.1rem;
    border: 1px solid var(--ac-border);
    border-radius: 10px;
    background: var(--ac-surface);
    overflow-wrap: anywhere;
}
main > ul > li > p { margin: .35rem 0; }
main > ul > li > form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .5rem; }
main > ul > li > form > select { width:auto; }
@media(max-width:760px) {
    main > form { padding: 1rem; }
    main > form > button { width: 100%; }
    main > ul > li > form > button { width: 100%; }
    main > table { display:block; overflow-x:auto; }
}
