:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --ink: #10213b;
    --muted: #6e7d92;
    --line: #dfe7f1;
    --navy: #031638;
    --navy-2: #07285d;
    --blue: #0877ff;
    --cyan: #02b8f4;
    --green: #05c990;
    --danger: #d84a5f;
    --shadow: 0 18px 45px rgba(14, 39, 78, 0.09);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 20px; display: flex; flex-direction: column; overflow-y: auto; color: #d8e8ff; background: linear-gradient(165deg, #020f29 0%, #062453 68%, #043363 100%); }
.brand { display: block; height: 64px; overflow: hidden; border-radius: 14px; background: #031638; }
.brand img { width: 100%; height: 100%; object-fit: cover; object-position: center; transform: scale(1.22); }
.workspace-label { margin: 26px 12px 12px; color: #748db3; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; color: #aabfdd; font-weight: 650; transition: .18s ease; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(25, 130, 255, .18); }
.nav-icon { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid rgba(137, 188, 255, .23); border-radius: 9px; color: #76caff; font-size: 12px; font-weight: 900; }
.nav-item.active .nav-icon { border-color: transparent; color: white; background: linear-gradient(135deg, var(--blue), var(--cyan)); box-shadow: 0 8px 20px rgba(0, 123, 255, .28); }
.sidebar-foot { margin-top: auto; display: grid; gap: 14px; }
.secure-note { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid rgba(96, 165, 250, .16); border-radius: 11px; color: #94acd0; font-size: 12px; }
.secure-note span, .environment span { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(5, 201, 144, .13); }

.main { min-width: 0; padding: 34px clamp(24px, 4vw, 62px) 54px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.topbar h1 { margin: 4px 0 0; font-size: clamp(27px, 3vw, 38px); letter-spacing: -.045em; }
.eyebrow { margin: 0; color: #0877c9; font-size: 11px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow.light { color: #63dfff; }
.environment { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; font-size: 11px; font-weight: 800; letter-spacing: .08em; }

.alert { margin: 0 0 20px; padding: 14px 16px; border-radius: 12px; font-size: 14px; }
.alert ul { margin: 8px 0 0 20px; padding: 0; }
.alert-success { color: #08745b; border: 1px solid #9ae7cf; background: #e9fbf5; }
.alert-error { color: #a12d42; border: 1px solid #fac1cb; background: #fff0f3; }

.hero-card { min-height: 220px; padding: clamp(28px, 4vw, 46px); display: flex; align-items: center; justify-content: space-between; overflow: hidden; color: white; border-radius: 24px; background: radial-gradient(circle at 85% 0%, rgba(0, 226, 170, .35), transparent 25%), linear-gradient(125deg, #03163a, #064c9e); box-shadow: 0 24px 50px rgba(6, 49, 105, .22); }
.hero-card h2 { margin: 14px 0 8px; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.055em; }
.hero-card p { max-width: 670px; margin: 0; color: #bdd6f6; line-height: 1.7; }
.pill { padding: 7px 10px; border: 1px solid rgba(99, 223, 255, .4); border-radius: 999px; color: #77e8ff; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.hero-mark { width: 125px; height: 125px; display: grid; place-items: center; flex: 0 0 auto; margin-left: 30px; border: 1px solid rgba(255,255,255,.2); border-radius: 34px; color: white; background: linear-gradient(145deg, rgba(0,119,255,.8), rgba(0,225,166,.75)); font-size: 68px; font-weight: 900; transform: rotate(-8deg); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 20px 50px rgba(0,0,0,.22); }

.metric-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.metric-card, .panel { border: 1px solid rgba(220, 229, 240, .95); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.metric-card { padding: 22px; }
.metric-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 750; }
.metric-card strong { display: block; margin-top: 20px; font-size: 42px; letter-spacing: -.05em; }
.metric-card p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.service-state { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.service-state.online { color: #009b6f; }
.service-state.offline { color: var(--danger); }
.panel-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.panel { padding: 24px; }
.panel h2, .panel h3 { margin: 7px 0 9px; letter-spacing: -.03em; }
.panel p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.text-link { color: #0877c9; font-size: 13px; font-weight: 800; }

.content-grid { display: grid; grid-template-columns: minmax(290px, .72fr) minmax(500px, 1.5fr); gap: 20px; align-items: start; }
.providers-grid { grid-template-columns: minmax(280px, .65fr) minmax(550px, 1.55fr); }
.form-panel { position: sticky; top: 28px; }
.form-panel.compact { max-width: 440px; }
form label { display: block; margin: 15px 0 7px; color: #43546c; font-size: 12px; font-weight: 750; }
input, select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cfdae7; border-radius: 10px; outline: none; color: var(--ink); background: #fbfdff; transition: .18s ease; }
input:focus, select:focus { border-color: #1787ef; box-shadow: 0 0 0 3px rgba(23, 135, 239, .12); background: white; }
.field-row { display: grid; grid-template-columns: .55fr 1.45fr; gap: 12px; }
.switch-grid { margin: 18px 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.check-card { margin: 0; padding: 11px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfe; }
.check-card input { width: 16px; min-height: 16px; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 9px 16px; border: 0; border-radius: 10px; color: #07599c; background: #e8f4ff; cursor: pointer; font-weight: 800; transition: .18s ease; }
.button:hover { transform: translateY(-1px); filter: brightness(.98); }
.button:disabled { cursor: wait; opacity: .78; transform: none; }
.button-primary { color: white; background: linear-gradient(135deg, #0877ff, #05a9e8); box-shadow: 0 9px 20px rgba(8, 119, 255, .2); }
.button-spinner { display: none; width: 17px; height: 17px; margin-left: 9px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: white; border-radius: 50%; animation: button-spin .75s linear infinite; }
.button.is-loading .button-spinner { display: inline-block; }
.button-secondary { color: #0b6b57; background: #e6faf4; }
.button-ghost { color: #a9bddb; border: 1px solid rgba(133, 165, 209, .2); background: transparent; }
.button-small { min-height: 34px; padding: 7px 11px; font-size: 11px; }
.full { width: 100%; }
.muted { color: var(--muted); }

.panel-title, .provider-summary { display: flex; align-items: center; gap: 13px; }
.panel-title { justify-content: space-between; margin-bottom: 15px; }
.count-badge { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #0877c9; background: #e9f5ff; font-size: 12px; font-weight: 850; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 12px; color: #8491a4; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .09em; }
td { padding: 15px 12px; border-top: 1px solid #edf1f6; font-size: 13px; }
td strong, td span { display: block; }
td span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.status { display: inline-block; width: max-content; padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 900; letter-spacing: .06em; }
.status-active, .status-available { color: #06765c; background: #e4f9f2; }
.status-draft, .status-degraded { color: #916600; background: #fff4cc; }
.status-unavailable, .status-disabled { color: #a6384b; background: #ffe7eb; }
.empty { padding: 30px; color: var(--muted); text-align: center; }
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-block; width: max-content; margin: 0; padding: 4px 6px; border-radius: 6px; color: #35617f; background: #edf6fb; font-size: 9px; font-weight: 800; }

.provider-list { display: grid; gap: 16px; }
.provider-card { padding: 21px; }
.provider-avatar { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: white; background: linear-gradient(145deg, #086ff1, #00bfaa); font-size: 20px; font-weight: 900; }
.provider-summary h2 { margin: 0 0 3px; font-size: 18px; }
.provider-summary code { color: var(--muted); font-size: 11px; }
.provider-summary .status { margin-left: auto; }
.provider-meta { margin: 17px 0; padding: 11px 0; display: flex; gap: 18px; border-block: 1px solid #edf1f6; color: var(--muted); font-size: 11px; }
.provider-actions { display: grid; gap: 10px; }
.pawapay-configuration { padding: 18px; border: 1px solid #dcd3f7; border-radius: 14px; background: linear-gradient(145deg, #fbf9ff, #f5f9ff); }
.pawapay-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pawapay-heading h3 { margin: 4px 0 0; }
.credential-state { padding: 6px 9px; border-radius: 999px; color: #a6384b; background: #ffe7eb; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.credential-state.configured { color: #06765c; background: #e4f9f2; }
.callback-list { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px 12px; align-items: center; margin: 14px 0; }
.callback-list label { margin: 0; }
.copy-field, .token-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.copy-field input { min-height: 38px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.inline-fields { display: grid; grid-template-columns: 105px 1fr 135px auto; gap: 8px; align-items: end; }
.health-form { display: flex; gap: 8px; justify-content: flex-end; }
.health-form select { width: 120px; min-height: 34px; }
.configuration-drawer { margin-top: 5px; border: 1px solid var(--line); border-radius: 12px; background: #f9fbfd; }
.configuration-drawer summary { padding: 13px 15px; color: #176ba8; cursor: pointer; font-size: 12px; font-weight: 850; }
.configuration-grid { padding: 0 15px 15px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.configuration-grid form { padding: 14px; border: 1px solid #e4ebf3; border-radius: 11px; background: white; }
.configuration-grid h3 { margin: 0 0 10px; font-size: 13px; }
.field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.empty-state { padding: 60px 30px; text-align: center; }
.empty-icon { width: 56px; height: 56px; display: grid; place-items: center; margin: auto; border-radius: 17px; color: #0877c9; background: #e9f5ff; font-weight: 900; }

.login-page { background: radial-gradient(circle at 15% 15%, rgba(8, 119, 255, .24), transparent 28%), radial-gradient(circle at 85% 85%, rgba(5, 201, 144, .16), transparent 26%), var(--navy); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-story { position: relative; padding: 55px clamp(40px, 7vw, 105px); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; color: white; background: radial-gradient(circle at 20% 75%, rgba(0, 221, 173, .25), transparent 28%), radial-gradient(circle at 90% 10%, rgba(0, 123, 255, .38), transparent 33%), linear-gradient(140deg, #020c24, #06366f); }
.login-story::after { content: ""; position: absolute; width: 330px; height: 330px; right: -150px; bottom: -140px; border: 1px solid rgba(80, 208, 255, .25); border-radius: 50%; box-shadow: 0 0 0 60px rgba(10, 134, 255, .05), 0 0 0 120px rgba(10, 134, 255, .035); }
.login-logo { width: min(430px, 80%); height: 100px; object-fit: cover; object-position: center; transform: scale(1.15); transform-origin: left center; }
.login-story h1 { margin: 15px 0; font-size: clamp(42px, 5vw, 70px); line-height: 1.02; letter-spacing: -.06em; }
.login-story p:not(.eyebrow) { max-width: 600px; color: #b9d0ef; font-size: 17px; line-height: 1.65; }
.security-strip { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.security-strip span { padding: 8px 11px; border: 1px solid rgba(133, 216, 255, .18); border-radius: 999px; color: #8ccfec; background: rgba(1, 16, 43, .25); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.login-panel { width: 100%; display: grid; place-items: center; }
.login-card { width: min(440px, 100%); padding: clamp(30px, 5vw, 50px); border: 1px solid #e3eaf2; border-radius: 24px; background: white; box-shadow: 0 28px 70px rgba(11, 36, 72, .12); }
.login-form-logo { width: 210px; height: 60px; margin: -4px 0 24px; object-fit: cover; object-position: center; transform: scale(1.1); transform-origin: left center; }
.login-card h2 { margin: 7px 0 5px; font-size: 34px; letter-spacing: -.045em; }
.login-card .button { margin-top: 22px; }
.form-note { margin: 16px 0 0; color: #8794a7; font-size: 10px; line-height: 1.5; text-align: center; }
.mobile-brand { display: none; }

@keyframes button-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1040px) {
    .content-grid, .providers-grid { grid-template-columns: 1fr; }
    .form-panel { position: static; max-width: none; }
    .inline-fields { grid-template-columns: 110px 1fr; }
}

@media (max-width: 760px) {
    .shell { display: block; }
    .sidebar { position: static; width: 100%; height: auto; padding: 14px; flex-direction: row; align-items: center; gap: 10px; }
    .brand { width: 150px; height: 46px; }
    .workspace-label, .sidebar-foot { display: none; }
    .nav { margin-left: auto; display: flex; }
    .nav-item { padding: 8px; font-size: 0; }
    .nav-icon { font-size: 11px; }
    .main { padding: 24px 16px 40px; }
    .metric-grid, .panel-grid { grid-template-columns: 1fr; }
    .hero-mark { display: none; }
    .login-shell { min-height: 100vh; padding: 20px; }
    .login-story { display: none; }
    .login-panel { min-height: 100vh; }
    .mobile-brand { display: block; margin-bottom: 28px; color: #0577d4; font-weight: 900; }
    .field-row, .switch-grid { grid-template-columns: 1fr; }
    .provider-meta { flex-direction: column; gap: 5px; }
    .inline-fields { grid-template-columns: 1fr; }
    .configuration-grid, .field-row.three { grid-template-columns: 1fr; }
    .health-form { justify-content: stretch; }
    .health-form select { width: 100%; }
}
