* { box-sizing: border-box; }
html { background: #b9bec3; }
body { margin: 0; padding: 0; overflow-x: hidden; color: #20252a; background: #b9bec3; font: 12px Arial, Tahoma, Verdana, sans-serif; }
.page-shell { width: 760px; min-height: 520px; margin: 24px auto; border: 1px solid #404b55; background: #eee; box-shadow: 2px 2px 0 #7b8389; }
.system-header { padding: 11px 14px 9px; color: #fff; border-bottom: 3px solid #829db5; background: #153b60; }
.brand { font-size: 18px; font-weight: bold; letter-spacing: 1px; text-shadow: 1px 1px #061a2c; }
.system-meta { margin-top: 7px; color: #dbe8f3; font-size: 11px; }
.online, .status-ok { color: #236b2a; }
.system-meta .online { padding: 1px 5px; color: #eaffea; border: 1px solid #75a779; background: #346e39; }
.separator { margin: 0 8px; color: #8ba6bd; }
.utility-bar { display: flex; justify-content: space-between; padding: 5px 10px; color: #243b50; border-bottom: 1px solid #7f929f; background: #cbdde9; font-size: 11px; }
.content { min-height: 390px; padding: 52px 72px; border-top: 1px solid #fff; background: #e6e6e6; }
.login-window, .panel { border: 1px solid #59636c; background: #d7d7d7; box-shadow: 2px 2px 0 #a5a5a5; }
.login-window { width: 470px; margin: 0 auto; }
.window-title { padding: 6px 9px; color: #fff; border-bottom: 1px solid #405364; background: #496b87; font-weight: bold; letter-spacing: .5px; }
.window-body, .panel-body { padding: 17px 20px 19px; border: 2px solid #f4f4f4; border-top: 0; }
.login-intro { margin: -17px -20px 15px; padding: 9px 12px; color: #22384c; border-bottom: 1px solid #99adbc; background: #d9e7f0; line-height: 17px; }
.alert { margin-bottom: 13px; padding: 7px 9px; color: #7e1818; border: 1px solid #b47676; background: #f1dada; }
.login-table { width: 100%; border-collapse: collapse; }
.login-table th { width: 145px; padding: 6px 10px 6px 0; text-align: right; font-weight: normal; }
.login-table td { padding: 6px 0; }
input[type="text"], input[type="password"] { width: 225px; padding: 4px; border: 1px solid #687783; border-top-color: #3f4a52; background: #fff; font: 12px Arial, sans-serif; }
.remember { color: #424b52; font-size: 11px; }
button { min-width: 88px; padding: 4px 12px; color: #101820; border: 1px solid #465b6e; border-right-color: #243746; border-bottom-color: #243746; background: #c7d8e4; font: bold 11px Arial, sans-serif; cursor: pointer; }
button:hover { background: #dbe8f0; }
button:active { border-color: #243746 #718493 #718493 #243746; }
.security-notice { width: 470px; margin: 18px auto 0; padding: 8px 10px; color: #4b4b3c; border: 1px solid #aaa37b; background: #eeeccf; font-size: 10px; line-height: 15px; }
.panel { width: 100%; }
.welcome-line { margin: 0 0 16px; }
.status-table { width: 100%; border-collapse: collapse; border: 1px solid #7b8993; background: #fff; }
.status-table th { padding: 6px 8px; color: #fff; border: 1px solid #52697b; background: #647f94; text-align: left; }
.status-table td { padding: 7px 8px; border: 1px solid #b0bac0; }
.status-table tr:nth-child(odd) td { background: #edf3f6; }
.status-ok { font-weight: bold; background: #e0eddf !important; }
.logout-form { margin: 17px 0 0; text-align: right; }
footer { padding: 10px; color: #687078; border-top: 1px solid #a8adb1; background: #d3d3d3; text-align: center; font-size: 10px; line-height: 15px; }
@media (max-width: 800px) { body { padding: 0; } .page-shell { width: 760px; margin: 0; } }

/* Authenticated control panel */
.authenticated-shell, .control-panel-shell { width: calc(100% - 24px); max-width: none; min-height: calc(100vh - 24px); margin: 12px auto; }
.authenticated-header { display: flex; align-items: center; gap: 18px; }
.authenticated-header > div:first-child { flex: 1; }
.header-status { color: #dbe8f3; font-size: 11px; line-height: 22px; text-align: right; }
.authenticated-header button { color: #fff; border-color: #9bb0c1 #172c3d #172c3d #9bb0c1; background: #496b87; }
.info-strip { gap: 12px; white-space: nowrap; }
.control-layout, .control-panel-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 130px); border-top: 1px solid #fff; background: #e5e5e5; }
.side-nav, .control-panel-sidebar { width: 220px; border-right: 1px solid #657583; background: #c4c9cc; }
.nav-heading { padding: 7px 9px; color: #fff; border-bottom: 1px solid #324b5e; background: #3f607a; font-weight: bold; }
.side-nav a { display: block; padding: 6px 9px; color: #18354c; border-bottom: 1px solid #9ca7ae; background: #d9dddf; text-decoration: none; font-size: 11px; }
.side-nav a:hover { background: #edf2f5; }
.side-nav a.active { color: #fff; border-left: 5px solid #8eacbf; background: #315571; font-weight: bold; padding-left: 4px; }
.side-nav form { padding: 10px 8px; }
.nav-logout { width: 100%; }
.portal-content, .control-panel-content { min-width: 0; width: 100%; padding: 13px; overflow: hidden; }
.page-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; padding: 7px 9px; border: 1px solid #71818d; background: #d8e4eb; }
.page-header h1 { margin: 0; color: #1c405d; font-size: 14px; }
.page-header span { color: #58656e; font-size: 10px; }
.notice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 9px; }
.notice { margin-bottom: 8px; padding: 7px 8px; border: 1px solid; font-size: 10px; line-height: 14px; }
.notice-grid .notice { margin: 0; }
.notice-warning { color: #5b4b1a; border-color: #b6a260; background: #f0ebcd; }
.notice-error { color: #751c1c; border-color: #b57979; background: #efdada; }
.notice-success { color: #235b29; border-color: #7ca081; background: #dcebdc; }
.notice-info { color: #23465f; border-color: #7d9aae; background: #dce8ef; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; align-items: start; }
.data-panel { margin-bottom: 10px; border: 1px solid #667681; background: #d7d7d7; }
.info-table, .data-table { width: 100%; border-collapse: collapse; background: #fff; }
.info-table th, .info-table td, .data-table th, .data-table td { padding: 6px 9px; border: 1px solid #b0bac0; text-align: left; vertical-align: top; font-size: 11px; }
.info-table th { width: 40%; color: #334550; background: #e0e5e8; font-weight: normal; }
.data-table thead th { color: #fff; border-color: #52697b; background: #647f94; font-weight: bold; white-space: nowrap; }
.data-table tbody tr:nth-child(even) td { background: #edf3f6; }
.data-table small { color: #68747c; }
.status-badge { display: inline-block; min-width: 52px; padding: 1px 4px; border: 1px solid #7b858b; background: #e0e3e5; font-size: 9px; font-weight: bold; text-align: center; white-space: nowrap; }
.status-running, .status-active, .status-available, .status-healthy, .status-completed { color: #1d5a24; border-color: #78a07c; background: #dcebdc; }
.status-warning, .status-open, .status-high, .status-pending, .status-acknowledged { color: #69530e; border-color: #b4a05e; background: #eee7c8; }
.status-critical, .status-failed { color: #751b1b; border-color: #b87676; background: #ecd5d5; }
.status-stopped, .status-suspended { color: #5b6064; background: #d8dcde; }
.status-info, .status-in-progress, .status-normal { color: #214b68; border-color: #7894a7; background: #dce7ee; }
.status-low, .status-resolved { color: #475058; background: #e6e8e9; }
.resource-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 10px 0; }
.resource-box { padding: 7px; border: 1px solid #7b8993; background: #f1f1f1; font-size: 10px; }
.resource-box strong, .resource-box small { display: block; }
.resource-box small { color: #58636b; }
.progress { height: 12px; margin: 5px 0; padding: 1px; border: 1px solid #657681; background: #fff; }
.progress span { display: block; height: 8px; background: #527b99; }
.small-button, .quick-actions a { display: inline-block; padding: 3px 7px; color: #142d40; border: 1px solid #536b7d; border-right-color: #304657; border-bottom-color: #304657; background: #c7d8e4; text-decoration: none; font-size: 10px; font-weight: bold; }
.quick-actions { display: flex; gap: 7px; padding: 9px; background: #eee; }
.quick-actions { flex-wrap: wrap; align-items: center; }
.quick-actions form { display: inline-flex; gap: 4px; align-items: center; margin: 0; }
.action-cell { min-width: 205px; }
.action-cell form { display: inline; margin-left: 2px; }
.action-cell button.small-button { min-width: 0; padding: 3px 5px; }
.terminal-screen { min-height: 310px; max-height: 460px; overflow: auto; padding: 10px; color: #b9e4b9; border: 2px inset #777; background: #080c09; font: 11px "Courier New", monospace; }
.terminal-screen span { color: #fff; }
.terminal-screen pre { margin: 3px 0 10px; white-space: pre-wrap; font: inherit; }
.terminal-form, .legacy-form { padding: 9px; background: #ddd; }
.terminal-form input { width: 65%; margin: 0 6px; }
.legacy-form label { display: block; margin-bottom: 8px; font-weight: bold; }
.legacy-form input, .legacy-form select, .legacy-form textarea { display: block; width: 100%; margin-top: 3px; padding: 4px; border: 1px solid #687783; border-radius: 0; font: 11px Arial, sans-serif; }
.architecture-diagram { display: flex; align-items: stretch; margin: 10px 0; }
.architecture-box { flex: 1; padding: 12px 8px; color: #18354c; border: 2px solid #456177; background: #dce7ed; text-align: center; }
.architecture-box.gateway { flex: 1.35; color: #fff; background: #315571; }
.architecture-box strong, .architecture-box span { display: block; margin-bottom: 6px; }
.architecture-arrow { flex: 0 0 110px; align-self: center; color: #315571; text-align: center; font-size: 9px; }
.architecture-arrow b { display: block; font-size: 27px; line-height: 24px; }
.inline-action { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; padding: 7px; border: 1px solid #89969f; background: #ddd; }
.module-placeholder .panel-body { background: #eee; }
.module-placeholder .info-table { margin: 12px 0; border: 1px solid #aab3b9; }
.live-resource-grid { grid-template-columns: repeat(6, 1fr); }
.live-bar, .terminal-meta { display:flex; align-items:center; gap:14px; margin-bottom:8px; padding:6px 8px; border:1px solid #71818d; background:#d8e4eb; font-size:10px; }
.live-bar span { margin-left:auto; }.live-connected{color:#236b2a}.live-reconnecting{color:#8b2222}
.terminal-meta form { margin-left:auto; }.terminal-meta button{min-width:0}.terminal-panel:fullscreen{padding:12px;background:#111}.terminal-panel:fullscreen .terminal-screen{height:calc(100vh - 100px);max-height:none}
.terminal-prompt{color:#79d979}.terminal-output{color:#ddd}.terminal-output.exit-126,.terminal-output.exit-127{color:#e29a77}.terminal-cursor{display:inline-block;color:#7bea7b;animation:terminal-blink 1s steps(1) infinite}@keyframes terminal-blink{50%{opacity:0}}
.usage-chart{display:flex;align-items:flex-end;gap:8px;height:120px;padding:10px;border-bottom:1px solid #80909a;background:#f3f3f3}.usage-chart div{flex:1;min-height:5px;background:#527b99;border:1px solid #315571}
.invoice-sheet{padding:22px;border:1px solid #697984;background:#fff}.invoice-sheet h1{color:#153b60;font-size:18px}.invoice-sheet h2{font-size:14px}.print-actions{text-align:right;margin-bottom:8px}.payment-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.data-table-wrapper { width: 100%; overflow-x: auto; }
.data-table-wrapper .data-table { min-width: 720px; }
.payment-notice { margin-bottom: 8px; padding: 6px 8px; color: #4b4b3c; border: 1px solid #aaa37b; background: #eeeccf; font-size: 10px; }
.policy-note { color: #7a8085; font-size: 9px; }
.critical-billing,.dashboard-billing-alert{margin-bottom:10px;border:2px solid #8b1d1d;background:#f3dada;font-size:11px}.critical-billing-title{padding:5px 8px;color:#fff;background:#761616;font-weight:bold}.critical-billing-body,.dashboard-billing-alert>div:not(.critical-billing-title){padding:8px}.critical-pay-button{display:inline-block;padding:5px 9px;color:#fff!important;border:1px solid #5e1111;background:#9a2020;text-decoration:none;font-weight:bold}.critical-pay-button.compact{padding:3px 6px}.urgent-invoice-row td{background:#f6dddd!important}.urgent-balance{color:#761616;font-weight:bold}.billing-risk{color:#761616;font-weight:bold}.deadline-panel .info-table th{width:45%}
@media (max-width: 1100px) { .live-resource-grid{grid-template-columns:repeat(3,1fr)} .info-strip{overflow-x:auto}.architecture-diagram{overflow-x:auto} }
@media (max-width: 780px) { .control-layout,.control-panel-body{grid-template-columns:1fr}.side-nav,.control-panel-sidebar{width:100%;border-right:0;border-bottom:1px solid #657583}.side-nav a{padding:5px 9px}.authenticated-header{align-items:flex-start}.brand{font-size:14px}.header-status{display:none}.two-column{grid-template-columns:1fr}.notice-grid{grid-template-columns:1fr}.live-resource-grid{grid-template-columns:repeat(2,1fr)}.payment-row{grid-template-columns:1fr} }
@media print{body{background:#fff;padding:0}.authenticated-header,.utility-bar,.side-nav,footer,.print-actions{display:none}.authenticated-shell{width:100%;border:0;box-shadow:none}.control-layout{display:block}.portal-content{padding:0}.invoice-sheet{border:0}}
.studio-security{margin-bottom:8px;padding:7px;color:#183d22;border:2px solid #52785a;background:#dcebdc;font-size:10px}.studio-shell{display:grid;grid-template-columns:230px minmax(0,1fr);min-height:650px;border:1px solid #43515c}.studio-tree{padding:6px;color:#d5dde2;background:#252c32;font:11px Tahoma,sans-serif;overflow:auto}.studio-tree summary{padding:4px;font-weight:bold;cursor:pointer}.studio-tree a{display:block;padding:3px 8px;color:#c7d8e4;text-decoration:none}.studio-tree a.active{color:#fff;background:#38566d}.studio-tree input,.studio-tree select{width:100%;margin:2px 0}.studio-workspace{min-width:0;background:#d7d7d7}.studio-tabbar,.studio-toolbar,.studio-savebar,.studio-actions{display:flex;align-items:center;gap:5px;padding:5px;border-bottom:1px solid #4c5962;background:#313a41;color:#fff;font-size:10px}.studio-tabbar span{margin-left:auto}.studio-tabbar a{color:#b9d8eb}.studio-toolbar form,.studio-actions form{display:inline}.studio-editor{display:grid;grid-template-columns:44px 1fr;height:430px;background:#10171c}.studio-editor pre{margin:0;padding:10px 6px;color:#657782;background:#151d22;text-align:right;overflow:hidden;font:12px/19px Consolas,monospace}.studio-editor textarea{width:100%;height:430px;padding:10px;color:#b9e4b9;border:0;background:#10171c;resize:none;outline:none;white-space:pre;font:12px/19px Consolas,monospace;tab-size:4}.studio-savebar input{flex:1}.studio-actions{flex-wrap:wrap;background:#50616d}.validation-console{padding:9px;color:#b9e4b9;background:#080c09;font:11px/18px Consolas,monospace}.architecture-panel{margin-top:10px;border:1px solid #526575;background:#e5e8ea}#architecture-flow{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:5px;padding:10px}#architecture-flow button{padding:6px;border:1px solid #456177;background:#dce7ed}#architecture-detail{padding:7px;border-top:1px solid #84939d;text-align:center}@media(max-width:900px){.studio-shell{grid-template-columns:1fr}.studio-tree{max-height:220px}}
.simulation-chart{display:flex;align-items:flex-end;gap:2px;height:90px;margin:6px;padding:5px;border:1px solid #7a8993;background:#f2f2f2}.simulation-chart strong{align-self:flex-start;width:34px;font-size:9px}.simulation-chart span{flex:1;max-width:14px;min-height:3px;background:#527b99;border:1px solid #315571}.simulation-chart small{align-self:center;color:#68747c}
