:root { color-scheme: light; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #172033; background: #f4f6fa; --blue:#315efb; --blue-dark:#2447c8; --border:#e3e8f1; --muted:#667085; --sidebar:#111827; --success:#16845b; --warning:#b66b00; --danger:#b42318; }
* { box-sizing: border-box; }
body { margin: 0; background: #f4f6fa; }
a { color: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--sidebar); color: #fff; padding: 24px 16px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; padding: 4px 8px 24px; }
.brand span:last-child { display: grid; gap: 2px; }
.brand small { color: #98a2b3; font-size: 12px; }
.brand-mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #4f7cff, #6941c6); color: #fff; font-weight: 850; }
.brand-mark.large { width: 52px; height: 52px; margin-bottom: 16px; }
.nav { display: grid; gap: 5px; }
.nav a { color: #c8d0dc; text-decoration: none; font-weight: 650; padding: 11px 13px; border-radius: 10px; white-space: nowrap; }
.nav a:hover, .nav a.active { color: #fff; background: rgba(255,255,255,.1); }
.sidebar-footer { margin-top: auto; padding: 16px 8px 0; }
.workspace { min-width: 0; }
.mobile-header { display: none; }
.content { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 70px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.eyebrow { display: block; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 7px; }
h1, h2 { margin-top: 0; color: #101828; }
h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.12; margin-bottom: 8px; }
h2 { font-size: 19px; margin-bottom: 8px; }
p { line-height: 1.55; }
.muted { color: var(--muted); margin-top: 0; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 24px; box-shadow: 0 8px 24px rgba(16,24,40,.04); margin-bottom: 20px; }
.card-grid, .balance-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card { min-height: 145px; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: #fff; text-decoration: none; display: flex; flex-direction: column; gap: 7px; box-shadow: 0 8px 24px rgba(16,24,40,.04); }
.metric-card span { color: var(--muted); font-size: 14px; }
.metric-card strong { font-size: 34px; margin-top: auto; }
.metric-card small { color: var(--muted); }
.metric-card.attention { border-color: #f5c2bd; background: #fff8f7; }
.metric-date { font-size: 16px !important; overflow-wrap: anywhere; }
.two-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.accent-card { background: linear-gradient(135deg,#eef3ff,#f8f5ff); border-color: #d9e2ff; }
.section-heading, .actions { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.actions.wrap { justify-content: flex-start; flex-wrap: wrap; margin-top: 20px; }
.stack { display: grid; gap: 16px; }
.stack.compact { margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; margin: 18px 0; }
label { display: grid; gap: 7px; font-weight: 650; font-size: 14px; }
label.checkbox { display: flex; align-items: center; gap: 9px; }
input[type="text"], input[type="password"], input[type="time"], input[type="number"] { width: 100%; border: 1px solid #cfd6e4; border-radius: 10px; padding: 11px 12px; font: inherit; background: #fff; color: #172033; }
input:focus { outline: 3px solid rgba(49,94,251,.14); border-color: var(--blue); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border: 1px solid #cfd6e4; border-radius: 10px; padding: 9px 15px; background: #fff; color: #172033; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
.button:hover { border-color: #98a2b3; }
.button.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.button.primary:hover { background: var(--blue-dark); }
.button.danger { color: var(--danger); }
.button.ghost { color: #c8d0dc; background: transparent; border-color: #344054; width: 100%; }
.button.full { width: 100%; }
.top-gap { margin-top: 12px; }
.flash { border-radius: 12px; padding: 13px 16px; margin-bottom: 16px; border: 1px solid transparent; }
.flash.success { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.flash.error { background: #fef3f2; color: var(--danger); border-color: #fecdca; }
.status { display: inline-flex; align-items: center; width: fit-content; border-radius: 99px; padding: 5px 9px; font-size: 12px; font-weight: 800; background: #f2f4f7; color: #475467; }
.status.ok { background: #ecfdf3; color: #067647; }
.status.warning { background: #fffaeb; color: #b54708; }
.status.error { background: #fef3f2; color: var(--danger); }
.status-list { display: grid; }
.status-list > div { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.status-list > div:last-child { border: 0; }
.instruction-card { border-left: 4px solid var(--blue); }
.instruction-card ol { padding-left: 20px; line-height: 1.8; }
.empty-state { text-align: center; background: #fff; border: 1px dashed #cfd6e4; border-radius: 16px; padding: 54px 24px; }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 16px; border-radius: 14px; background: #eef3ff; color: var(--blue); font-weight: 850; font-size: 22px; }
.table-wrap { overflow-x: auto; margin: 12px 0 18px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
code { display: inline-block; background: #f2f4f7; padding: 3px 6px; border-radius: 5px; overflow-wrap: anywhere; }
.error-text { display: block; color: var(--danger); margin-top: 6px; }
.form-footer { display: flex; justify-content: flex-end; }
.balance-card { border-top: 4px solid #98a2b3; }
.balance-card.ok { border-top-color: var(--success); }
.balance-card.warning { border-top-color: #f79009; }
.balance-card.critical { border-top-color: var(--danger); }
.balance-value { font-size: 36px; font-weight: 850; margin: 25px 0 6px; }
.balance-value.unknown { font-size: 23px; color: var(--muted); }
.currency { font-weight: 800; color: var(--muted); }
.warning-text { color: #b54708; font-weight: 700; }
.api-error { display: grid; gap: 5px; background: #fef3f2; color: var(--danger); border-radius: 11px; padding: 13px; margin-top: 14px; }
.api-error span { font-size: 14px; }
.api-error small { color: #912018; }
.connection-name { color: var(--muted); font-size: 13px; margin: 17px 0 0; }
.login-layout { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left,#e9efff,transparent 45%),#f4f6fa; }
.login-layout > .flash { position: fixed; top: 18px; width: min(430px,calc(100% - 32px)); }
.login-card { width: min(430px,100%); margin: 0; text-align: center; padding: 34px; }
.login-card form { text-align: left; }
@media (max-width: 1050px) { .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 800px) {
    .app-shell { display: block; }
    .sidebar { position: sticky; z-index: 10; height: auto; padding: 10px 14px; overflow: hidden; }
    .brand { display: none; }
    .nav { display: flex; overflow-x: auto; gap: 5px; scrollbar-width: none; }
    .nav a { padding: 10px 12px; font-size: 14px; }
    .sidebar-footer { display: none; }
    .mobile-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 18px 0; }
    .mobile-brand { font-weight: 850; text-decoration: none; }
    .content { width: min(100% - 28px, 720px); padding: 26px 0 50px; }
    .page-heading { align-items: stretch; flex-direction: column; }
    .two-columns, .card-grid, .balance-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .metric-grid, .form-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 125px; }
    .card { padding: 18px; border-radius: 14px; }
    .section-heading { align-items: flex-start; }
    .balance-value { font-size: 30px; }
    .actions.wrap > * { flex: 1 1 150px; }
    .actions.wrap .button { width: 100%; }
}
