* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: #d4d0c8;
  color: #000;
  font-family: 'Tahoma', 'Arial', sans-serif;
  font-size: 11px;
  line-height: 1.4;
}

a {
  color: #0000cc;
  text-decoration: underline;
}

a:hover {
  color: #cc0000;
}

button {
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
  font-size: 11px;
}

::-webkit-scrollbar { width: 16px; }
::-webkit-scrollbar-track { background: #d4d0c8; border-left: 1px solid #808080; }
::-webkit-scrollbar-thumb { background: #d4d0c8; border-top: 1px solid #fff; border-left: 1px solid #fff; border-right: 1px solid #404040; border-bottom: 1px solid #404040; }
::-webkit-scrollbar-button { background: #d4d0c8; display: block; height: 16px; border-top: 1px solid #fff; border-left: 1px solid #fff; border-right: 1px solid #404040; border-bottom: 1px solid #404040; }

.win-border-raised {
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
}

.win-border-sunken {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
}

.win-border-inset {
  border: 2px inset #808080;
}

.navbar {
  height: 28px;
  background: #d4d0c8;
  border-bottom: 2px solid #808080;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  flex-shrink: 0;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
}

.navbar-brand {
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  font-weight: bold;
  color: #000;
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.navbar-brand::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #00aa00;
  border-radius: 50%;
  border: 1px solid #006600;
}

.navbar-end {
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar-user {
  position: relative;
}

.navbar-user-btn {
  background: #d4d0c8;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #000;
}

.navbar-user-btn:active {
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
}

.navbar-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid #808080;
  min-width: 140px;
  z-index: 999;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.navbar-user:hover .navbar-dropdown {
  display: block;
}

.navbar-dropdown a,
.navbar-dropdown button {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 3px 8px;
  font-size: 11px;
  color: #000;
  background: none;
  border: none;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.navbar-dropdown a:hover,
.navbar-dropdown button:hover {
  background: #0a246a;
  color: #fff;
}

.navbar-dropdown hr {
  border: none;
  border-top: 1px solid #d4d0c8;
  margin: 1px 0;
}

.nav-auth-links {
  display: flex;
  gap: 4px;
}

.nav-info {
  font-size: 11px;
  font-weight: bold;
  color: #000;
  padding: 2px 6px;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
}

.layout {
  display: flex;
  height: calc(100vh - 28px);
  overflow: hidden;
}

.sidebar {
  width: 160px;
  flex-shrink: 0;
  background: #d4d0c8;
  border-right: 2px solid #808080;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-unit {
  padding: 4px 6px;
  border-bottom: 1px solid #808080;
  background: #0a246a;
  color: #fff;
}

.sidebar-unit-label {
  font-size: 9px;
  text-transform: uppercase;
  color: #aabbcc;
  margin-bottom: 1px;
}

.sidebar-callsign {
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  letter-spacing: 0.05em;
}

.sidebar-section {
  padding: 2px 0;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  color: #fff;
  background: #7b9ebd;
  padding: 2px 6px;
  border-top: 1px solid #aabbcc;
  border-bottom: 1px solid #5577aa;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav a,
.sidebar-nav-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  color: #000;
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-left: 2px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav-btn:hover {
  background: #0a246a;
  color: #fff;
}

.sidebar-nav a.active {
  background: #0a246a;
  color: #fff;
  border-left: 2px solid #ffcc00;
}

.sidebar-nav a i,
.sidebar-nav-btn i {
  width: 12px;
  text-align: center;
  font-size: 10px;
}

.sidebar-nav-btn:hover {
  background: #aa0000;
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  padding: 4px 6px;
  border-top: 1px solid #808080;
  background: #c0c0c0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: #006600;
  font-weight: bold;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00cc00;
  border: 1px solid #006600;
  flex-shrink: 0;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #d4d0c8;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 2px solid #808080;
}

.breadcrumb {
  font-size: 10px;
  color: #444;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.breadcrumb span {
  color: #0a246a;
  font-weight: bold;
}

.page-title {
  font-size: 13px;
  font-weight: bold;
  color: #000;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 1px;
}

.page-title i {
  color: #0a246a;
  font-size: 12px;
}

.page-meta {
  font-size: 10px;
  color: #555;
}

.clock-badge {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: bold;
  color: #cc0000;
  background: #000;
  padding: 3px 8px;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
}

.grid {
  display: grid;
  gap: 6px;
}

.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-8-4 { grid-template-columns: 8fr 4fr; }
.grid-cols-5-7 { grid-template-columns: 5fr 7fr; }

.stat-card {
  background: #fff;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  padding: 4px 6px;
}

.stat-label {
  font-size: 9px;
  font-weight: bold;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 3px;
  border-bottom: 1px solid #d4d0c8;
  padding-bottom: 1px;
}

.stat-value {
  font-size: 18px;
  font-weight: bold;
  color: #000;
  font-family: 'Courier New', monospace;
  line-height: 1;
  margin-bottom: 2px;
}

.stat-sub {
  font-size: 9px;
  color: #777;
}

.c-accent  { color: #0a246a !important; }
.c-green   { color: #006600 !important; }
.c-yellow  { color: #886600 !important; }
.c-red     { color: #cc0000 !important; }
.c-muted   { color: #777    !important; }
.c-dim     { color: #555    !important; }

.panel {
  background: #d4d0c8;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
}

.panel-head {
  background: #0a246a;
  padding: 2px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
}

.panel-title i { color: #aabbdd; font-size: 10px; }

.panel-body {
  padding: 6px;
  background: #fff;
  border-top: 1px solid #808080;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  padding: 1px 4px;
  border: 1px solid #808080;
}

.badge-blue   { background: #0a246a; color: #fff; border-color: #0a246a; }
.badge-green  { background: #006600; color: #fff; border-color: #006600; }
.badge-yellow { background: #cc9900; color: #fff; border-color: #886600; }
.badge-red    { background: #cc0000; color: #fff; border-color: #880000; }

.perm-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.perm-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  color: #fff;
  background: #0a246a;
  border: 1px solid #05134a;
  padding: 1px 4px;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 6px;
  border: 1px solid #808080;
  font-size: 11px;
  margin-bottom: 4px;
  position: relative;
}

.alert-success { background: #ccffcc; border-color: #006600; color: #006600; }
.alert-danger  { background: #ffcccc; border-color: #cc0000; color: #cc0000; }
.alert-warning { background: #ffffcc; border-color: #886600; color: #664400; }
.alert-info    { background: #cce0ff; border-color: #0a246a; color: #0a246a; }

.alert-close {
  position: absolute;
  top: 2px;
  right: 4px;
  background: #d4d0c8;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  padding: 1px 3px;
  color: #000;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  font-weight: bold;
  padding: 0 10px;
  height: 22px;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
  background: #d4d0c8;
  cursor: pointer;
  text-decoration: none;
  color: #000;
  white-space: nowrap;
  min-width: 75px;
}

.btn:hover {
  background: #c8c4bc;
  text-decoration: none;
  color: #000;
}

.btn:active {
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
}

.btn-primary {
  background: #d4d0c8;
  color: #000;
}

.btn-primary:hover { background: #c8c4bc; color: #000; }

.btn-danger {
  background: #d4d0c8;
  color: #cc0000;
}

.btn-ghost { background: #d4d0c8; color: #000; }

.btn-ghost-green  { color: #006600; }
.btn-ghost-yellow { color: #886600; }
.btn-ghost-red    { color: #cc0000; }
.btn-ghost-blue   { color: #0a246a; }

.btn-sm { height: 18px; font-size: 10px; padding: 0 6px; min-width: 0; }
.btn-lg { height: 26px; font-size: 12px; padding: 0 16px; }
.btn-full { width: 100%; }
.btn-icon-only { padding: 0; width: 22px; min-width: 0; }
.btn-icon-only.btn-sm { width: 18px; }

.form-field { margin-bottom: 6px; }
.form-field:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: bold;
  color: #000;
  margin-bottom: 2px;
}

.form-hint {
  font-size: 10px;
  color: #555;
  margin-top: 2px;
}

.input-wrap { position: relative; }

.input-icon-left {
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  color: #808080;
  font-size: 10px;
  pointer-events: none;
}

.input-icon-right {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  color: #808080;
  font-size: 10px;
  cursor: pointer;
}

.input-wrap.has-left input  { padding-left: 20px; }
.input-wrap.has-right input { padding-right: 20px; }

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  height: 20px;
  background: #fff;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  color: #000;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  padding: 0 4px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

input::placeholder { color: #aaa; }

input:focus, select:focus, textarea:focus {
  outline: 1px dotted #000;
  outline-offset: -2px;
}

select {
  padding-right: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4'%3E%3Cpath d='M0 0l4 4 4-4z' fill='%23000'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  cursor: pointer;
}

textarea {
  height: auto;
  padding: 3px 4px;
  resize: vertical;
}

.table-wrap {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  overflow: hidden;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  background: #fff;
}

thead th {
  background: #0a246a;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  padding: 3px 5px;
  border-right: 1px solid #1a3680;
  white-space: nowrap;
  text-align: left;
}

thead th:last-child { border-right: none; }

tbody td {
  padding: 2px 5px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: middle;
  color: #000;
}

tbody tr:nth-child(even) td { background: #eef2ff; }
tbody tr:hover td { background: #0a246a; color: #fff; }
tbody tr:hover td a { color: #fff; }

.td-mono { font-family: 'Courier New', monospace; }
.td-muted { color: #777; font-size: 10px; }

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open { display: flex; }

.modal-box {
  background: #d4d0c8;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  width: 100%;
  max-width: 420px;
  margin: 1rem;
  box-shadow: 4px 4px 8px rgba(0,0,0,0.4);
}

.modal-head {
  background: linear-gradient(to right, #0a246a, #5b7ec5);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
}

.modal-title i { color: #aabbdd; }

.modal-close {
  background: #d4d0c8;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
  color: #000;
  cursor: pointer;
  font-size: 10px;
  font-weight: bold;
  line-height: 1;
  padding: 1px 4px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { background: #c0c0c0; }

.modal-body {
  padding: 10px;
}

.modal-foot {
  padding: 6px 10px;
  display: flex;
  gap: 4px;
  border-top: 1px solid #808080;
  background: #d4d0c8;
}

.auth-layout {
  min-height: 100vh;
  background: #008080;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  background: #d4d0c8;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  box-shadow: 4px 4px 10px rgba(0,0,0,0.5);
}

.auth-card-head {
  background: linear-gradient(to right, #0a246a, #5b7ec5);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-card-title {
  font-size: 11px;
  font-weight: bold;
  color: #fff;
}

.auth-card-body {
  padding: 12px;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  color: #0a246a;
  border: 1px solid #0a246a;
  padding: 1px 5px;
  background: #ddeeff;
  margin-bottom: 8px;
}

.auth-title {
  font-size: 13px;
  font-weight: bold;
  color: #000;
  margin-bottom: 2px;
}

.auth-sub {
  font-size: 10px;
  color: #555;
  margin-bottom: 10px;
  font-family: 'Courier New', monospace;
}

.auth-divider {
  height: 1px;
  background: #808080;
  margin: 8px 0;
  border-bottom: 1px solid #fff;
}

.auth-footer {
  text-align: center;
  font-size: 10px;
  color: #555;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #808080;
}

.auth-grid { display: none; }
.auth-glow { display: none; }

.footer {
  background: #d4d0c8;
  border-top: 2px solid #808080;
  padding: 2px 8px;
  font-size: 10px;
  color: #555;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.error-layout {
  min-height: calc(100vh - 28px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.error-code {
  font-family: 'Courier New', monospace;
  font-size: 72px;
  font-weight: bold;
  color: #808080;
  line-height: 1;
  margin-bottom: 8px;
}

.error-title {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 4px;
}

.error-msg {
  font-size: 11px;
  color: #555;
  margin-bottom: 12px;
}

.inline-form { display: inline; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 3px; }
.gap-2 { gap: 6px; }
.gap-3 { gap: 8px; }
.gap-4 { gap: 12px; }
.mt-1 { margin-top: 3px; }
.mt-2 { margin-top: 6px; }
.mt-3 { margin-top: 8px; }
.mt-4 { margin-top: 12px; }
.mb-1 { margin-bottom: 3px; }
.mb-2 { margin-bottom: 6px; }
.mb-3 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 12px; }
.ml-1 { margin-left: 3px; }
.mr-1 { margin-right: 3px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-mono { font-family: 'Courier New', monospace; }
.text-sm { font-size: 10px; }
.text-xs { font-size: 9px; }
.capitalize { text-transform: capitalize; }
.uppercase { text-transform: uppercase; }

.perm-heading {
  font-size: 9px;
  font-weight: bold;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  cursor: help;
  color: #555;
}

.perm-table th { vertical-align: bottom; padding-bottom: 6px; }

.perm-check { display: flex; align-items: center; justify-content: center; }
.perm-check input[type="checkbox"] { width: 12px; height: 12px; cursor: pointer; accent-color: #0a246a; }

.perm-desc-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  border-bottom: 1px solid #d4d0c8;
  font-size: 11px;
}

.statusbar {
  background: #d4d0c8;
  border-top: 2px solid #808080;
  padding: 1px 4px;
  display: flex;
  gap: 1px;
  font-size: 11px;
  flex-shrink: 0;
}

.statusbar-cell {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  padding: 1px 6px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-8-4 { grid-template-columns: 1fr; }
  .grid-cols-5-7 { grid-template-columns: 1fr; }
  .layout { flex-direction: column; height: auto; }
  .sidebar { width: 100%; border-right: none; border-bottom: 2px solid #808080; flex-direction: row; flex-wrap: wrap; }
  .sidebar-unit, .sidebar-footer { display: none; }
  .sidebar-section { padding: 2px; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-nav a, .sidebar-nav-btn { border-left: none; }
  .content-area { padding: 4px 6px; }
}
