:root { color-scheme: light; font-family: 'Segoe UI', system-ui, sans-serif; color: #203b35; background: #f5f7f5; }
* { box-sizing: border-box; }
body { margin: 0; }
.api-notifications { position: fixed; inset: auto auto max(20px, env(safe-area-inset-bottom)) 50%; transform: translateX(-50%); margin: 0; padding: 0; border: 0; background: transparent; color: inherit; width: min(420px, calc(100vw - 40px)); max-height: calc(100dvh - 40px); overflow-y: auto; z-index: 2147483647; pointer-events: none; }
.api-notification { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; padding: 14px 16px; border: 1px solid; border-radius: 12px; box-shadow: 0 8px 28px #102c3526; font: 14px/1.5 'Segoe UI', system-ui, sans-serif; pointer-events: auto; animation: api-notification-in 250ms ease-out both; }
.api-notification.api-notification-leaving { pointer-events: none; animation: api-notification-out 220ms ease-in both; }
@keyframes api-notification-in { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes api-notification-out { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(18px) scale(.98); } }
@media(prefers-reduced-motion: reduce) { .api-notification,.api-notification.api-notification-leaving { animation-duration: .01ms; } }
.api-notification span { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.api-notification-success { color: #215b41; background: #edf5ef; border-color: #b9d6c3; }
.api-notification-error { color: #963c31; background: #fff0eb; border-color: #e8bdb2; }
.api-notification .api-notification-close { flex-shrink: 0; min-height: 24px; width: 24px; padding: 0; border: 0; background: transparent; color: inherit; font-size: 22px; line-height: 1; }
.api-notification .api-notification-close:hover { background: #0000000a; }
:host { display: block; font-family: 'Segoe UI', system-ui, sans-serif; color: #203b35; font-size: 15px; line-height: 1.55; }
h1,h2,h3,p { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.2; letter-spacing: -1.2px; font-weight: 600; }
h2 { font-size: 21px; font-weight: 600; letter-spacing: -.4px; }
h3 { font-size: 17px; font-weight: 600; }
a { color: #176752; text-underline-offset: 4px; }
button,input,textarea,select { font: inherit; }
button,.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #174c42; background: #174c42; color: white; padding: 11px 20px; border-radius: 9px; font-weight: 600; text-decoration: none; cursor: pointer; min-height: 46px; }
button:hover,.button:hover { background: #103b33; }
button.secondary,.button.secondary { background: white; color: #244e42; border-color: #d3dfd8; }
button.secondary:hover,.button.secondary:hover { background: #edf3ee; }
button.danger { color: #9c3232; border-color: #ead4d4; background: #fff; }
button:disabled { opacity: .55; cursor: wait; }
a:focus-visible,button:focus-visible,input:focus-visible { outline: 3px solid #78af9b; outline-offset: 3px; }
input,textarea,select { width: 100%; min-height: 47px; padding: 10px 13px; color: #203b35; background: #fff; border: 1px solid #ccd9d1; border-radius: 8px; }
textarea { resize: vertical; }
[hidden] { display: none !important; }
.tabs { display: flex; gap: 8px; border-bottom: 1px solid #dfe7df; padding-bottom: 12px; }
.tabs button { background: transparent; color: #64776f; border-color: transparent; }
.tabs button.active { color: #174c42; background: #eaf1e8; }
input[readonly] { background: #f5f7f5; color: #61746d; }
.inline-checkbox { width: 18px; min-height: 18px; height: 18px; }
label { display: grid; gap: 7px; font-size: 14px; font-weight: 600; }
small,.muted { color: #64776f; }
.eyebrow { color: #5f7769; font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.page { max-width: 1180px; margin: auto; padding: 48px 44px; }
.page-head { margin-bottom: 32px; }
.page-head p { margin-top: 10px; color: #64776f; }
.panel { background: white; border: 1px solid #dfe7df; border-radius: 16px; padding: 28px; }
.form { max-width: 640px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.full { grid-column: 1 / -1; }
.divider { border: 0; border-top: 1px solid #e4eae4; margin: 4px 0; }
.message { font-size: 14px; border-radius: 9px; padding: 12px 15px; background: #edf5ef; color: #215b41; }
.message:empty { display: none; }
.message.error { color: #963c31; background: #fff0eb; }
.center-state { min-height: 65vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.login-intro { background: #174c42; color: #fff; padding: clamp(32px, 7vw, 100px); display: flex; flex-direction: column; justify-content: space-between; gap: 70px; }
.login-intro h1 { font-size: clamp(36px, 4vw, 58px); max-width: 500px; }
.login-intro p { color: #c8dfd0; max-width: 370px; margin-top: 24px; }
.login-intro small { color: #c8dfd0; }
.brand { display: flex; gap: 12px; align-items: center; font-size: 19px; font-weight: 650; letter-spacing: -.4px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: #e1eddc; color: #174c42; display: grid; place-items: center; font-size: 23px; font-weight: 700; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-form { width: 100%; max-width: 380px; }
.login-form h2 { font-size: 30px; }
.link-button { background: transparent; border: 0; color: #176752; padding: 4px; font-size: 13px; min-height: 32px; }
.link-button:hover { background: #eef3ee; }
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; min-height: 100vh; height: 100%; background: #fff; border-right: 1px solid #dfe7df; padding: 32px 22px; display: flex; flex-direction: column; gap: 40px; }
.sidebar .brand { font-size: 17px; }
.sidebar small { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; display: block; }
nav { display: flex; flex-direction: column; gap: 8px; }
nav a { color: #61746a; text-decoration: none; padding: 12px 16px; border-radius: 9px; display: flex; align-items: center; gap: 13px; font-weight: 600; }
nav a:hover { background: #f1f5f0; }
nav a.active { background: #eaf1e8; color: #174c42; }
nav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.sidebar-footer { margin-top: auto; border-top: 1px solid #e3eae2; padding-top: 20px; font-size: 13px; overflow-wrap: anywhere; }
.shell.nav-collapsed { grid-template-columns: 80px minmax(0, 1fr); }
.nav-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.nav-heading .brand { gap: 8px; font-size: 15px; }
.nav-heading .brand-mark { width: 32px; height: 32px; flex-shrink: 0; }
.logo-toggle { padding: 0; min-height: 32px; border: 0; cursor: pointer; font-size: 21px; }
.logo-toggle:hover { background: #cbdcc6; }
.mobile-nav-launcher { display: none; }
.navigation-dialog { position: static; display: block; margin: 0; padding: 0; width: 100%; max-width: none; max-height: none; border: 0; background: transparent; color: inherit; overflow: visible; }
.navigation-dialog:not([open]) { display: none; }
.navigation-dialog::backdrop { background: #102c3570; }
.sidebar .sidebar-footer { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; padding-bottom: 10px; border-radius: 8px; }
.sidebar-footer:hover,.sidebar-footer.active { background: #eaf1e8; }
.profile-avatar { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: #e1eddc; color: #174c42; font-weight: 700; }
.sidebar.is-collapsed { padding: 24px 12px; gap: 28px; }
.is-collapsed .nav-label { display: none; }
.is-collapsed .nav-heading { flex-direction: column; justify-content: center; }
.is-collapsed nav a { justify-content: center; padding: 12px 8px; }
.is-collapsed .sidebar-footer { justify-content: center; }
nav svg { flex-shrink: 0; }
@media(min-width: 641px) {
    .shell > my-nav { position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; min-height: 0; }
    .sidebar { position: static; height: 100vh; height: 100dvh; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
    .sidebar > * { flex-shrink: 0; }
}
.workspace { min-width: 0; }
.topbar { height: 78px; background: #fff; border-bottom: 1px solid #dfe7df; padding: 0 44px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.status { color: #4d7260; font-size: 12px; display: flex; align-items: center; gap: 7px; }
.status::before { content: ''; width: 7px; height: 7px; background: #39865a; border-radius: 50%; }
.welcome { padding: 42px; background: #e9f0e3; border-color: #dbe5d4; position: relative; overflow: hidden; }
.welcome h1 { max-width: 700px; margin: 18px 0; overflow-wrap: anywhere; }
.welcome p { max-width: 470px; color: #57705e; }
.welcome .row { margin-top: 28px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card-link { display: block; text-decoration: none; color: #203b35; }
.card-link:hover { border-color: #8aaa96; }
.card-link p { margin: 8px 0 22px; color: #64776f; font-size: 14px; }
.card-link span { color: #176752; font-weight: 600; font-size: 14px; }
.table-panel { padding: 0; overflow: hidden; }
.page.invoices-page { width: 100%; max-width: none; height: 100vh; height: 100dvh; margin: 0; padding: 0; }
.invoices-page > .table-panel { height: 100%; display: flex; flex-direction: column; border: 0; border-radius: 0; padding: 0; }
.invoices-page .toolbar { padding: 12px; flex-shrink: 0; }
.invoices-table-body { flex: 1; min-height: 0; overflow: auto; }
.invoices-table-body > .table-scroll { height: 100%; overflow: auto; }
.invoices-page .invoice-data-table th { position: sticky; top: 0; z-index: 1; background: #f5f7f5; }
.invoices-page .pagination { margin-top: auto; padding: 10px 12px; flex-shrink: 0; border-top: 1px solid #dfe7df; }
@media(max-width: 640px) { .page.invoices-page { height: calc(100vh - 56px); height: calc(100dvh - 56px); } }
.toolbar { padding: 22px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.icon-button { width: 40px; height: 40px; min-height: 40px; padding: 9px; flex-shrink: 0; }
.icon-button svg { display: block; width: 20px; height: 20px; flex-shrink: 0; }
.icon-button.icon-active { background: #e1eddc; color: #174c42; border-color: #78af9b; }
.search { display: flex; gap: 10px; width: min(100%, 480px); }
.invoice-search { width: min(100%, 600px); flex-wrap: wrap; }
.invoice-search input { flex: 1 1 180px; width: auto; min-width: 0; }
.invoice-search { margin: 0; align-items: center; }
.invoice-search input { height: 40px; min-height: 40px; margin: 0; padding: 8px 13px; }
.table-scroll { overflow-x: auto; }
.invoice-data-table td { min-width: 120px; max-width: 320px; vertical-align: top; overflow-wrap: anywhere; white-space: pre-wrap; }
.invoice-data-table th { white-space: nowrap; }
.invoice-data-table td > .row { flex-wrap: nowrap; }
.invoice-page-controls { gap: 12px; }
.page-size-label { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.page-size-label select { width: 68px; height: 36px; min-height: 36px; padding: 4px 6px; }
.invoice-summary { margin-left: auto; gap: 16px; font-size: 12px; }
.invoice-summary > span { white-space: nowrap; }
.invoice-summary strong { margin-left: 4px; font-variant-numeric: tabular-nums; }
.column-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 20px; max-height: 55vh; overflow-y: auto; }
.column-options label { justify-content: flex-start; flex-wrap: nowrap; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th { background: #f7f9f5; font-size: 11px; letter-spacing: 1px; color: #6b7e70; text-transform: uppercase; font-weight: 600; }
td,th { padding: 17px 24px; border-bottom: 1px solid #e7ece5;min-width: 8em; }
td strong { font-weight: 600; }
tbody tr:hover { background: #fafcf8; }
.pagination { padding: 18px 24px; }
.empty { padding: 42px 24px; text-align: center; color: #64776f; }
.badge { display: inline-block; border-radius: 99px; padding: 4px 10px; background: #edf3e8; color: #456640; font-size: 12px; }
.vendor-dialog { width: min(700px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; border: 1px solid #dfe7df; border-radius: 16px; padding: 28px; color: #203b35; background: #fff; box-shadow: 0 24px 80px #102c3540; }
.vendor-dialog::backdrop { background: #102c3570; }
.multiline { white-space: pre-wrap; }
.vendor-row { cursor: pointer; }
.invoice-page { padding: 20px; }
.invoice-page h1 { margin-top: 12px; }
.invoice-layout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: start; }
.document-panel { grid-area: documents; position: sticky; top: 16px; padding: 20px; gap: 14px; min-width: 0; }
.document-tabs-bar { display: flex; align-items: flex-start; gap: 10px; }
.document-tabs-bar .tabs { flex: 1; min-width: 0; flex-wrap: wrap; }
.document-update { flex-shrink: 0; width: 42px; height: 42px; min-height: 42px; padding: 9px; }
.document-update svg { display: block; width: 22px; height: 22px; flex-shrink: 0; }
.document-viewport { height: min(66vh, 850px); min-height: 320px; overflow: auto; background: #edf0ec; border: 1px solid #dfe7df; border-radius: 9px; }
.document-viewport img { display: block; }
.pdf-preview { display: block; width: 100%; height: 100%; border: 0; }
.invoice-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.product-validity { border: 1px solid #dfe7df; border-radius: 9px; padding: 12px; margin: 0; min-width: 0; }
.product-validity legend { padding: 0 6px; font-size: 14px; font-weight: 600; }
.invoice-form { grid-area: details; padding: 24px; min-width: max-content; }
.invoice-vendor-card { padding: 16px; border: 1px solid #dfe7df; border-radius: 10px; background: #f8faf7; }
.invoice-vendor-card .details { gap: 12px 20px; }
.invoice-section { min-width: 0; border: 1px solid #dfe7df; border-radius: 10px; background: #fff; }
.invoice-section-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; border-radius: 10px; background: #f8faf7; }
.invoice-section-header::-webkit-details-marker { display: none; }
.invoice-section-header > strong { flex-shrink: 0; }
.invoice-section-summary { min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; color: #203b35; font-size: 15px; overflow-wrap: anywhere; text-align: left; }
.invoice-section-summary strong { font-weight: 600; }
.invoice-header-value { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 5px; }
.invoice-header-value small { color: #64776f; font-size: 12px; font-weight: 400; }
.invoice-section-header > svg { flex-shrink: 0; margin-left: auto; transition: transform 160ms ease; }
.vendor-header-edit { display: none; margin-left: auto; flex-shrink: 0; min-height: 36px; padding: 5px 12px; }
.invoice-section[open] > .invoice-section-header > .vendor-header-edit { display: inline-flex; }
.invoice-section[open] > .invoice-section-header > .vendor-header-edit + svg { margin-left: 0; }
.invoice-section[open] > .invoice-section-header > svg { transform: rotate(180deg); }
.invoice-section-header:focus-visible { outline: 3px solid #78af9b; outline-offset: 2px; }
.invoice-section-body { padding: 16px; border-top: 1px solid #dfe7df; }
.invoice-layout { grid-template-areas: 'details documents'; }
.invoice-item { padding: 18px; border: 1px solid #dfe7df; border-radius: 12px; background: #fafcf8; }
.invoice-totals { display: grid; gap: 8px; margin: 0; }
.invoice-totals div { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.invoice-totals dt { margin: 0; font-size: 14px; }
.invoice-totals .total { border-top: 1px solid #dfe7df; padding-top: 12px; font-weight: 700; font-size: 20px; }
.picker-list { max-height: 48vh; overflow: auto; display: grid; gap: 10px; }
.picker-vendor { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; text-align: left; }
.picker-vendor-row { display: flex; align-items: center; gap: 10px; min-width: 0; color: #244e42; border: 1px solid #d3dfd8; padding: 11px 20px; border-radius: 9px; }
.picker-vendor-row .picker-vendor { flex: 1; min-width: 0; overflow-wrap: anywhere; }
@media(max-width: 1100px) { .invoice-page { padding: 20px 14px; } .invoice-layout { gap: 14px; } .invoice-form .fields { grid-template-columns: 1fr; } .document-panel,.invoice-form { padding: 16px; } }
@media(max-width: 760px) { .invoice-layout { grid-template-columns: 1fr; grid-template-areas: 'documents' 'details'; } .document-panel { top: 0; z-index: 2; gap: 8px; box-shadow: 0 4px 16px #203b3510; } .document-viewport { height: 30vh; min-height: 160px; } .document-panel label,.document-panel small { font-size: 12px; } .document-panel button { padding: 6px 10px; min-height: 36px; } .sidebar nav { flex-wrap: wrap; } }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 0; }
dt { font-size: 12px; color: #64776f; margin-bottom: 5px; }
dd { margin: 0; overflow-wrap: anywhere; }
@media(max-width: 900px) { .shell { grid-template-columns: 190px minmax(0, 1fr); } .page { padding: 32px 24px; } .sidebar { padding: 26px 14px; } .topbar { padding: 0 24px; } .welcome { padding: 28px; } }
@media(max-width: 640px) {
    .mobile-nav-launcher { display: block; padding: 12px 18px; }
    .navigation-dialog { position: fixed; inset: 0; width: min(360px, calc(100vw - 40px)); height: fit-content; max-height: calc(100dvh - 48px); margin: auto; overflow-y: auto; background: #fff; border: 1px solid #dfe7df; border-radius: 16px; box-shadow: 0 24px 80px #102c3540; }
    .navigation-dialog .sidebar { height: auto; min-height: 0; padding: 24px; gap: 24px; border: 0; }
    .navigation-dialog nav { flex-direction: column; flex-wrap: nowrap; }
    .navigation-dialog nav a { justify-content: flex-start; flex: none; padding: 12px 16px; gap: 13px; }
    .navigation-dialog .sidebar-footer { margin-top: 0; }
}
@media(max-width: 640px) { .shell { display: block; } .sidebar { position: static; min-height: auto; padding: 18px; gap: 20px; border-right: 0; border-bottom: 1px solid #dfe7df; } nav { flex-direction: row; } nav a { flex: 1; padding: 10px; justify-content: center; gap: 7px; } .sidebar-footer { display: none; } .topbar { height: 58px; padding: 0 20px; } .topbar .status { display: none; } .page { padding: 28px 18px; } .cards,.fields,.details { grid-template-columns: 1fr; } .panel { padding: 22px; } .table-panel { padding: 0; } .login-layout { grid-template-columns: 1fr; } .login-intro { padding: 24px; gap: 24px; } .login-intro h1,.login-intro p,.login-intro small { display: none; } .login-main { padding: 44px 24px; } .welcome { padding: 26px; } h1 { font-size: 30px; } }
