/* NORTHERN SUITE — back-office design system.
   Taken from Fleet Scheduler Pro (planner.css): Tahoma 11px, #d4d0c8 desktop,
   #ece9d8 surfaces, bevelled 2px borders, navy #000080 title bars and
   selection, white data grids. Every admin screen of the suite uses it. */

* { box-sizing: border-box; margin: 0; padding: 0; font-family: Tahoma, Verdana, Arial, sans-serif; font-size: 11px; }
:root {
  --desk: #d4d0c8; --face: #ece9d8; --navy: #000080; --hi: #ffffff; --lo: #808080; --dk: #000000;
  --ok: #006000; --err: #a00000; --warn: #a06000;
}
::-webkit-scrollbar { width: 16px; height: 16px; background-color: #ece9d8; }
::-webkit-scrollbar-track { background: #ece9d8; border: 1px solid #808080; background-image: repeating-linear-gradient(45deg, #d4d0c8, #d4d0c8 1px, #ece9d8 1px, #ece9d8 2px); }
::-webkit-scrollbar-thumb { background-color: #ece9d8; border: 2px solid; border-color: #ffffff #808080 #808080 #ffffff; box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #000; }
::-webkit-scrollbar-button { background-color: #ece9d8; border: 2px solid; border-color: #ffffff #808080 #808080 #ffffff; width: 16px; height: 16px; }

html, body { height: 100%; }
body.suite { background: var(--desk); color: #000; display: flex; flex-direction: column; padding: 4px; gap: 4px; min-height: 100vh; }
body.suite.centered { align-items: center; justify-content: center; }
a { color: var(--navy); }
b, strong { font-weight: bold; }
code, .mono { font-family: 'Courier New', monospace; }
h1 { font-size: 13px; font-weight: bold; color: var(--navy); }
h2 { font-size: 12px; font-weight: bold; color: var(--navy); margin: 8px 0 4px; }
h3 { font-size: 11px; font-weight: bold; margin: 6px 0 3px; }
p { margin: 4px 0; line-height: 1.45; }
ul.plain { list-style: none; }
ul.bullets { margin: 4px 0 4px 18px; line-height: 1.5; }
small, .muted { color: #404040; }
.muted { color: #606060; }

/* ---- toolbar (Fleet's header.top-toolbar) ---- */
.top-toolbar { background: var(--face); border: 2px solid; border-color: #fff #808080 #808080 #fff; padding: 4px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.brand { font-weight: bold; color: var(--navy); font-size: 12px; }
.toolbar-stats { display: flex; gap: 12px; background: #fff; padding: 2px 8px; border: 2px solid; border-color: #808080 #fff #fff #808080; flex-wrap: wrap; }
.stat-item { display: flex; gap: 4px; align-items: center; }
.stat-item .val { font-weight: bold; }
.stat-item .lbl { color: #404040; text-transform: uppercase; font-size: 10px; }

/* ---- buttons ---- */
.btn, button.btn, a.btn { display: inline-flex; align-items: center; gap: 4px; background: var(--face); color: #000; border: 2px solid; border-color: #fff #808080 #808080 #fff; padding: 2px 10px; cursor: pointer; font-weight: bold; text-decoration: none; white-space: nowrap; min-height: 22px; }
.btn:active, .btn.active { border-color: #808080 #fff #fff #808080; background: #e0e0e0; }
.btn:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
.btn.primary { border-color: #000 #000 #000 #000; box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080; }
.btn.danger { color: var(--err); }
.btn[disabled], .btn.disabled { color: #808080; text-shadow: 1px 1px 0 #fff; cursor: default; }
.btn.small { padding: 0 6px; min-height: 18px; font-weight: normal; }

/* ---- windows ---- */
.retro-window { background: var(--face); border: 2px solid; border-color: #fff #000 #000 #fff; box-shadow: 4px 4px 10px rgba(0,0,0,.35); padding: 2px; display: flex; flex-direction: column; min-width: 0; }
.retro-window.flat { box-shadow: none; }
.window-header { background: var(--navy); color: #fff; padding: 4px 8px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.window-header .wh-actions { display: flex; gap: 4px; }
.window-header .wh-actions .btn { min-height: 16px; padding: 0 6px; font-size: 10px; }
.window-header.error-header { background: var(--err); }
.window-header.sandbox { background: #c05800; }
.win-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 5px; border-bottom: 1px solid #808080; background: var(--face); }
.win-toolbar .sep { width: 1px; align-self: stretch; background: #808080; margin: 0 2px; }
.win-toolbar .spacer { flex: 1; }
.win-body { flex: 1; overflow: auto; background: #fff; margin: 4px; border: 2px solid; border-color: #808080 #fff #fff #808080; min-height: 0; }
.win-body.pad { padding: 8px; }
.win-face { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.win-status { padding: 3px 6px; color: #404040; border-top: 1px solid #fff; display: flex; gap: 12px; flex-wrap: wrap; }
.win-status span + span { border-left: 1px solid #808080; padding-left: 10px; }

.suite-main { flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: auto; }
.suite-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 6px; align-items: start; }
.suite-cols.two { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
@media (max-width: 900px) { .suite-cols.two { grid-template-columns: 1fr; } }

/* ---- tabs (Fleet's view-bar) ---- */
.view-bar { background: var(--face); padding: 3px; display: flex; gap: 2px; align-items: center; border: 1px solid #808080; flex-wrap: wrap; }
.tab-btn { padding: 3px 10px; background: var(--desk); border: 2px solid; border-color: #fff #808080 #808080 #fff; cursor: pointer; font-weight: bold; color: #000; text-decoration: none; display: inline-block; }
.tab-btn.active { background: #fff; border-color: #808080 #fff #fff #808080; }

/* ---- forms ---- */
fieldset.retro-fieldset { border: 1px solid #808080; padding: 8px; margin: 0; min-width: 0; }
fieldset.retro-fieldset legend { font-weight: bold; padding: 0 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-row, .form-group { display: flex; flex-direction: column; gap: 2px; }
.form-row.inline { flex-direction: row; align-items: center; gap: 6px; }
label { font-weight: normal; }
label.check { display: flex; gap: 5px; align-items: center; cursor: pointer; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=time], input[type=url], input[type=search], input:not([type]), textarea, .retro-input {
  background: #fff; border: 2px solid; border-color: #808080 #fff #fff #808080; padding: 3px 5px; color: #000; outline: none; border-radius: 0; min-height: 22px; max-width: 100%;
}
textarea { font-family: 'Courier New', monospace; resize: vertical; }
input:focus, textarea:focus { outline: 1px dotted #000; outline-offset: -4px; }
input[readonly], input:disabled, textarea[readonly] { background: #f4f3ee; color: #404040; }
input[type=color] { width: 44px; height: 22px; border: 2px solid; border-color: #808080 #fff #fff #808080; padding: 0; background: #fff; }
select { -webkit-appearance: none; appearance: none; background-color: #fff;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><rect width="16" height="16" fill="%23ece9d8"/><path d="M0,0 L16,0 L16,1 L1,1 L1,16 L0,16 Z" fill="%23ffffff"/><path d="M15,0 L16,0 L16,16 L0,16 L0,15 L15,15 Z" fill="%23808080"/><polygon points="4,6 12,6 8,11" fill="%23000000"/></svg>');
  background-repeat: no-repeat; background-position: right 0 center; border: 2px solid; border-color: #808080 #fff #fff #808080; padding: 3px 22px 3px 4px; color: #000; border-radius: 0; cursor: pointer; min-height: 22px; max-width: 100%; }
select[multiple] { background-image: none; padding: 2px; }
.hint { color: #606060; font-size: 10px; }

/* ---- messages ---- */
.msg-err, .msg-ok, .msg-warn, .msg-info { background: #fff; border: 1px solid; padding: 6px 8px; font-weight: bold; white-space: pre-wrap; }
.msg-err { border-color: var(--err); color: var(--err); }
.msg-ok { border-color: #008000; color: var(--ok); }
.msg-warn { border-color: var(--warn); color: var(--warn); }
.msg-info { border-color: var(--navy); color: var(--navy); font-weight: normal; }

/* ---- data grid ---- */
.data-table { border-collapse: collapse; width: 100%; background: #fff; }
.data-table th { position: sticky; top: 0; z-index: 2; background: var(--face); font-weight: bold; text-align: left; border: 1px solid #b0b0b0; padding: 3px 5px; white-space: nowrap; }
.data-table td { border: 1px solid #e0e0e0; padding: 3px 5px; vertical-align: top; }
.data-table td.nowrap, .data-table th.nowrap { white-space: nowrap; }
.data-table tbody tr:nth-child(even) { background: #f7f7f7; }
.data-table tbody tr:hover { background: #d0d0e0; }
.data-table td.num, .data-table th.num { text-align: right; font-family: monospace; }
.data-table td.code { font-family: monospace; font-weight: bold; }
.data-table td.warn { color: var(--err); font-weight: bold; }
.data-table td.c, .data-table th.c { text-align: center; }
.data-table .btn { padding: 0 6px; min-height: 18px; }
.data-table tr.off td { color: #808080; }
.perm-table td.c input { margin: 0 auto; display: block; }
.perm-table tr.product-row td { background: var(--face); font-weight: bold; color: var(--navy); }

/* ---- badges ---- */
.badge { display: inline-block; padding: 0 5px; border: 1px solid #808080; background: var(--face); font-size: 10px; white-space: nowrap; }
.badge.ok { background: #008000; color: #fff; border-color: #004000; }
.badge.off { background: #808080; color: #fff; }
.badge.err { background: var(--err); color: #fff; border-color: #600000; }
.badge.warn { background: #c05800; color: #fff; }
.badge.navy { background: var(--navy); color: #fff; }

/* ---- program manager (portal) ---- */
.launcher { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; padding: 10px; }
.launch { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 6px; text-decoration: none; color: #000; border: 1px solid transparent; text-align: center; }
.launch .ico { font-size: 30px; line-height: 1; filter: drop-shadow(1px 1px 0 #fff); }
.launch .nm { font-weight: bold; }
.launch .ds { color: #404040; font-size: 10px; line-height: 1.3; }
.launch:hover, .launch:focus { background: var(--navy); color: #fff; outline: 1px dotted #ff0; }
.launch:hover .ds, .launch:focus .ds { color: #e0e0ff; }
.launch.off { opacity: .45; pointer-events: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.kpi { background: #fff; border: 2px solid; border-color: #808080 #fff #fff #808080; padding: 6px 8px; }
.kpi .lbl { color: #404040; text-transform: uppercase; font-size: 10px; }
.kpi .val { font-weight: bold; font-size: 16px; color: var(--navy); margin-top: 2px; }
.kpi .sub { color: #606060; font-size: 10px; }

/* ---- product switches ---- */
.product-list { display: flex; flex-direction: column; gap: 4px; }
.product-item { display: grid; grid-template-columns: 22px 28px 1fr; gap: 6px; align-items: start; background: #fff; border: 1px solid #c0c0c0; padding: 6px; }
.product-item .ico { font-size: 18px; }
.product-item .nm { font-weight: bold; }

/* ---- log / pre ---- */
pre.log { background: #fff; border: 2px solid; border-color: #808080 #fff #fff #808080; padding: 6px; font-family: 'Courier New', monospace; font-size: 11px; white-space: pre-wrap; max-height: 360px; overflow: auto; }

/* ---- dialog on the desktop (login, installer) ---- */
.dialog { width: 380px; max-width: calc(100vw - 16px); }
.dialog form { padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--face); }
.dialog .actions { display: flex; justify-content: flex-end; gap: 6px; }
.footer-note { color: #404040; font-size: 10px; text-align: center; margin-top: 6px; }

.right { text-align: right; } .nowrap { white-space: nowrap; }
.row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }
.data-table td.wrap { white-space: normal; word-break: break-all; }
