/* ── Win95 Complete Theme System ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', 'MS Sans Serif', 'Segoe UI', Geneva, sans-serif;
  background: #008080; min-height: 100vh; overflow-x: hidden;
}
body::before {
  content: ''; position: fixed; inset: 0;
  background-image: radial-gradient(circle at 20px 20px, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px; pointer-events: none; z-index: 0;
}

/* ── Window ── */
.win {
  background: #c0c0c0;
  border: 2px solid; border-color: #ffffff #808080 #808080 #ffffff;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.25);
}
.titlebar {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff; padding: 3px 4px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 700; user-select: none; height: 22px;
}
.titlebar .t { display: flex; align-items: center; gap: 5px; }
.titlebar .t .ico {
  width: 14px; height: 14px;
  background: linear-gradient(135deg, #00ff00, #008000);
  border-radius: 2px; display: flex; align-items: center; justify-content: center;
  font-size: 7px; color: #fff; flex-shrink: 0;
}
.title-btns { display: flex; gap: 2px; }
.title-btn {
  width: 16px; height: 14px; background: #c0c0c0;
  border: 1px solid; border-color: #ffffff #808080 #808080 #ffffff;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; color: #000; cursor: pointer; font-weight: 700;
}
.title-btn:active { border-color: #808080 #ffffff #ffffff #808080; }
.title-btn.x:hover { background: #e00000; color: #fff; }

.win-body { padding: 12px; }

/* ── Buttons ── */
.btn {
  padding: 6px 18px; border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  background: #c0c0c0; font-family: inherit;
  font-size: 12px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  text-decoration: none; color: #111;
}
.btn:active { border-color: #808080 #ffffff #ffffff #808080; }
.btn:hover { background: #d0d0d0; }
.btn-p {
  background: #000080; color: #fff;
  border-color: #4444ff #000044 #000044 #4444ff;
}
.btn-p:hover { background: #0000a0; }
.btn-sm { padding: 3px 10px; font-size: 11px; }
.btn-xs { padding: 2px 6px; font-size: 10px; }

.btn-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ── Inputs ── */
.field { display: flex; flex-direction: column; gap: 3px; }
.field label { font-size: 11px; font-weight: 600; color: #333; }
.field input, .field select, .field textarea {
  padding: 6px 10px; border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  background: #fff; font-family: inherit;
  font-size: 13px; color: #111; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #000080; background: #fffff0;
}

/* ── Content Box ── */
.content-box {
  background: #fff; border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 12px; margin-bottom: 8px;
}
.content-box h3 {
  font-size: 12px; font-weight: 700; color: #000080; margin-bottom: 6px;
  padding-bottom: 4px; border-bottom: 1px solid #ccc;
}

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse; font-size: 11px;
}
table th {
  background: #c0c0c0; padding: 4px 8px; text-align: left;
  font-weight: 700; color: #333; font-size: 10px;
  border: 1px solid; border-color: #ffffff #808080 #808080 #ffffff;
}
table td {
  padding: 4px 8px; border-bottom: 1px solid #ddd; color: #444;
}
table tr:hover td { background: #f0f0ff; }

/* ── Badge ── */
.badge {
  display: inline-block; padding: 1px 6px; font-size: 9px; font-weight: 700;
  border: 1px solid; border-color: #ffffff #808080 #808080 #ffffff;
}
.badge-green { background: #008000; color: #fff; }
.badge-gray { background: #808080; color: #fff; }
.badge-red { background: #e00000; color: #fff; }
.badge-blue { background: #000080; color: #fff; }

/* ── Stats Card ── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.stat-card {
  background: #fff; border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  padding: 10px; text-align: center;
}
.stat-card .num { font-size: 20px; font-weight: 700; font-family: 'Courier New', monospace; color: #000080; }
.stat-card .lbl { font-size: 10px; color: #666; margin-top: 2px; }
.stat-card .green { color: #008000; }
.stat-card .red { color: #e00000; }
@media (max-width: 640px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Sidebar Layout ── */
.layout { display: flex; gap: 8px; position: relative; z-index: 1; align-items: flex-start; padding: 16px 16px 40px; }
.sidebar { width: 170px; flex-shrink: 0; }
.main { flex: 1; min-width: 0; }

.nav-item {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 10px; font-size: 11px; cursor: pointer;
  border: 1px solid transparent; margin: 1px 0; color: #fff;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5); border-radius: 2px;
}
.nav-item:hover { background: rgba(0,0,128,0.25); border: 1px dotted rgba(255,255,255,0.3); }
.nav-item.active { background: rgba(0,0,128,0.35); border: 1px solid rgba(255,255,255,0.2); }
.nav-divider { border: none; border-top: 1px solid rgba(255,255,255,0.15); margin: 4px 0; }

@media (max-width: 768px) {
  .layout { flex-direction: column; padding: 10px 10px 40px; }
  .sidebar { width: 100%; }
  .sidebar .nav-item { display: inline-flex; font-size: 10px; padding: 3px 8px; margin: 1px; }
  .sidebar .win-body { display: flex; flex-wrap: wrap; padding: 6px; }
}

/* ── Taskbar ── */
.taskbar {
  position: fixed; bottom: 0; left: 0; width: 100%; height: 30px;
  background: #c0c0c0; border-top: 2px solid #ffffff;
  display: flex; align-items: center; padding: 0 2px; z-index: 50; gap: 4px;
}
.start {
  display: flex; align-items: center; gap: 4px; padding: 2px 10px;
  font-weight: 700; font-size: 11px; background: #c0c0c0;
  border: 2px solid; border-color: #ffffff #808080 #808080 #ffffff;
  cursor: pointer; font-family: inherit; height: 24px;
}
.start:active { border-color: #808080 #ffffff #ffffff #808080; }
.start .flag {
  width: 14px; height: 14px;
  background: linear-gradient(135deg, #ff4444, #44ff44, #4444ff);
  border-radius: 2px;
}
.tb-item {
  background: #c0c0c0; border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 2px 12px; font-size: 11px; cursor: pointer; height: 24px;
  display: flex; align-items: center;
}
.tb-item.active { border-color: #ffffff #808080 #808080 #ffffff; background: #d0d0d0; }
.tb-time { margin-left: auto; padding: 2px 8px; font-size: 11px; border: 1px solid #808080; height: 22px; display: flex; align-items: center; }

/* ── Start Menu ── */
.start-menu {
  position: fixed; bottom: 34px; left: 0; z-index: 60;
  background: #c0c0c0; border: 2px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  padding: 2px; min-width: 180px; display: none;
}
.start-menu.show { display: block; }
.sm-item {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px; font-size: 11px; cursor: pointer;
}
.sm-item:hover { background: #000080; color: #fff; }
.sm-divider { height: 1px; background: #808080; margin: 2px 4px; }

/* ── Misc ── */
.hr { border: none; border-top: 1px solid #808080; margin: 8px 0; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* Adjust body padding for fixed topbar */
body.topbar-active { padding-top: 40px !important; }
body.topbar-active-login { padding-top: 56px !important; }

/* ── PAGE TITLE IN TOPBAR ── */
.tb-page-title { font-weight: 600; font-size: 12px; color: rgba(255,255,255,0.85); }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .topbar { height: 36px; padding: 0 8px; font-size: 11px; }
  .topbar .tb-brand { font-size: 12px; }
  .topbar .tb-link { padding: 3px 8px; font-size: 10px; }
  body.topbar-active { padding-top: 36px !important; }
  body.topbar-active-login { padding-top: 50px !important; }
  .guidebar { top: 36px; font-size: 10px; padding: 4px 10px; flex-wrap: wrap; }
  .guidebar .gb-steps { gap: 6px; }
}
