/* AEGIS Windows — Authentic Luna/XP chrome
   Recreated in CSS so the entire app feels like a native XP-era
   secure enterprise tool — not a modern web dashboard. */

/* ============================================
   WINDOW CONTAINER
   ============================================ */
.window-container {
  position: fixed;
  inset: 0;
  bottom: 30px;
  z-index: 100;
  pointer-events: none;
}
.window-container > .xp-window { pointer-events: auto; }

/* ============================================
   BASE WINDOW
   ============================================ */
.xp-window {
  position: absolute;
  min-width: 320px;
  min-height: 200px;
  background: #ece9d8;
  border: 3px solid #0055ea;
  border-radius: 8px 8px 0 0;
  box-shadow:
    2px 2px 12px rgba(0,0,0,0.35),
    inset 0 1px 0 #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 11px;
}

.xp-window.minimized { display: none; }
.xp-window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: calc(100% - 30px) !important;
  border-radius: 0;
}

.xp-titlebar {
  height: 26px;
  background: linear-gradient(180deg, #0997ff 0%, #0666de 8%, #0051d0 20%, #0251c0 50%, #0160c8 80%, #0053bf 92%, #0042ab 100%);
  display: flex;
  align-items: center;
  padding: 0 4px;
  color: #fff;
  font-weight: bold;
  font-size: 12px;
  cursor: move;
  text-shadow: 0 1px 0 rgba(0,0,0,0.3);
  border-bottom: 1px solid #003c8c;
  flex-shrink: 0;
  position: relative;
}
.xp-titlebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 2px,
    rgba(255,255,255,0.05) 2px,
    rgba(255,255,255,0.05) 3px
  );
  pointer-events: none;
}

.xp-titlebar-icon {
  width: 16px; height: 16px;
  margin-right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.xp-titlebar-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 2px;
}

.xp-titlebar-controls {
  display: flex;
  gap: 2px;
}
.xp-btn {
  background: linear-gradient(180deg, #3b8a3b 0%, #2d6e2d 50%, #1f5e1f 100%);
  border: 1px solid #1a4d1a;
  color: #fff;
  font-family: "Tahoma", sans-serif;
  font-size: 11px;
  font-weight: bold;
  padding: 3px 12px;
  border-radius: 3px;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    1px 1px 0 rgba(0,0,0,0.1);
}
.xp-btn:hover {
  background: linear-gradient(180deg, #4a9c4a 0%, #3d803d 50%, #2d6e2d 100%);
}
.xp-btn:active {
  background: linear-gradient(180deg, #1f5e1f 0%, #2d6e2d 50%, #3b8a3b 100%);
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.3);
}
.xp-btn-primary {
  background: linear-gradient(180deg, #4a9cff 0%, #1f5dd0 50%, #0040b0 100%);
  border-color: #003080;
}
.xp-btn-primary:hover {
  background: linear-gradient(180deg, #5aacff 0%, #2f6de0 50%, #1050c0 100%);
}
.xp-btn-primary:active {
  background: linear-gradient(180deg, #0040b0 0%, #1f5dd0 50%, #4a9cff 100%);
}
.xp-btn-danger {
  background: linear-gradient(180deg, #d04545 0%, #b02020 50%, #801515 100%);
  border-color: #501010;
}
.xp-btn-danger:hover {
  background: linear-gradient(180deg, #e05555 0%, #c03030 50%, #902020 100%);
}
.xp-btn-warn {
  background: linear-gradient(180deg, #e8b545 0%, #c89020 50%, #986810 100%);
  border-color: #604005;
}
.xp-btn-warn:hover {
  background: linear-gradient(180deg, #f0c560 0%, #d0a030 50%, #a07820 100%);
}

/* Title bar control buttons */
.xp-tb-btn {
  width: 21px; height: 21px;
  background: linear-gradient(180deg, #3b8af3 0%, #2870d8 50%, #1a5dc0 100%);
  border: 1px solid #003c8c;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
  font-family: "Marlett", "Tahoma", sans-serif;
}
.xp-tb-btn:hover { background: linear-gradient(180deg, #4b9aff 0%, #3880e8 50%, #2a6dd0 100%); }
.xp-tb-btn:active {
  background: linear-gradient(180deg, #1a5dc0 0%, #2870d8 50%, #3b8af3 100%);
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.3);
}
.xp-tb-close {
  background: linear-gradient(180deg, #e08585 0%, #c83939 50%, #a01818 100%);
  border-color: #501010;
}
.xp-tb-close:hover { background: linear-gradient(180deg, #f09595 0%, #d84949 50%, #b02828 100%); }

.xp-window-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ece9d8;
}

/* ============================================
   MENUBAR
   ============================================ */
.xp-menubar {
  display: flex;
  background: #ece9d8;
  border-bottom: 1px solid #aaa;
  padding: 2px 4px;
  gap: 0;
  font-size: 11px;
  flex-shrink: 0;
}
.xp-menubar-item {
  padding: 3px 8px;
  cursor: pointer;
  color: #000;
}
.xp-menubar-item:hover {
  background: linear-gradient(180deg, #6cb6ff 0%, #245edb 100%);
  color: #fff;
}

/* ============================================
   TOOLBAR
   ============================================ */
.xp-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  background: linear-gradient(180deg, #ece9d8 0%, #d6d2c2 100%);
  border-bottom: 1px solid #aaa;
  flex-shrink: 0;
}
.xp-toolbar-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: linear-gradient(180deg, #f5f4ec 0%, #d6d2c2 100%);
  border: 1px solid #888;
  border-radius: 2px;
  cursor: pointer;
  font-size: 11px;
  color: #000;
  box-shadow: inset 0 1px 0 #fff;
}
.xp-toolbar-btn:hover {
  background: linear-gradient(180deg, #fff 0%, #ece9d8 100%);
}
.xp-toolbar-btn:active {
  background: linear-gradient(180deg, #c0c0c0 0%, #d6d2c2 100%);
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.2);
}
.xp-toolbar-sep {
  width: 1px;
  height: 18px;
  background: #aaa;
  margin: 0 2px;
}

/* ============================================
   STATUS BAR
   ============================================ */
.xp-statusbar {
  display: flex;
  border-top: 1px solid #aaa;
  background: #ece9d8;
  font-size: 11px;
  flex-shrink: 0;
}
.xp-statusbar-section {
  padding: 3px 8px;
  border-right: 1px solid #aaa;
  background: #ece9d8;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
}
.xp-statusbar-section:last-child { border-right: none; flex: 0 0 auto; min-width: 120px; justify-content: center; }

/* ============================================
   CONTENT AREA
   ============================================ */
.xp-content {
  flex: 1;
  overflow: auto;
  padding: 10px;
  background: #fff;
  position: relative;
}
.xp-content-flush { padding: 0; }

/* ============================================
   FORM CONTROLS
   ============================================ */
.xp-form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.xp-label {
  font-size: 11px;
  color: #000;
  min-width: 100px;
  text-align: right;
  font-weight: normal;
}
.xp-input, .xp-select, .xp-textarea {
  background: #fff;
  border: 2px solid #7f9db9;
  padding: 3px 4px;
  font-family: "Tahoma", sans-serif;
  font-size: 11px;
  color: #000;
  border-radius: 0;
  box-shadow: inset 1px 1px 0 #888;
  flex: 1;
  min-width: 100px;
}
.xp-input:focus, .xp-select:focus, .xp-textarea:focus {
  outline: none;
  border-color: #316ac5;
  background: #ffffe0;
}
.xp-textarea { resize: vertical; min-height: 60px; font-family: "Tahoma", sans-serif; }

.xp-checkbox, .xp-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 11px;
  margin: 2px 0;
}
.xp-checkbox input, .xp-radio input { margin: 0; }
.xp-checkbox .box {
  width: 13px; height: 13px;
  background: #fff;
  border: 1px solid #7f9db9;
  box-shadow: inset 1px 1px 0 #888;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #000;
  font-weight: bold;
}
.xp-checkbox input:checked + .box::after { content: '✓'; color: #000; }
.xp-radio .circle {
  width: 13px; height: 13px;
  background: #fff;
  border: 1px solid #7f9db9;
  box-shadow: inset 1px 1px 0 #888;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.xp-radio input:checked + .circle::after {
  content: '';
  width: 7px; height: 7px;
  background: #000;
  border-radius: 50%;
}

/* Group boxes (fieldset look) */
.xp-group {
  border: 1px solid #aaa;
  border-radius: 0;
  margin: 8px 0;
  padding: 12px 10px 10px;
  position: relative;
  background: #f5f4ec;
}
.xp-group-legend {
  position: absolute;
  top: -8px;
  left: 10px;
  background: #f5f4ec;
  padding: 0 6px;
  font-size: 11px;
  font-weight: bold;
  color: #003c8c;
}

/* ============================================
   PANELS — used inside the content area
   ============================================ */
.xp-panel {
  background: #f5f4ec;
  border: 1px solid #aaa;
  padding: 8px;
  margin: 0 0 8px 0;
}
.xp-panel-header {
  background: linear-gradient(180deg, #0997ff 0%, #0666de 50%, #0160c8 100%);
  color: #fff;
  padding: 3px 8px;
  font-weight: bold;
  font-size: 11px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.3);
  border: 1px solid #0051d0;
  margin: -8px -8px 8px -8px;
}

/* ============================================
   TAB CONTROL
   ============================================ */
.xp-tabs {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.xp-tabs-headers {
  display: flex;
  background: #ece9d8;
  padding: 4px 4px 0 4px;
  gap: 2px;
  border-bottom: 1px solid #aaa;
  flex-shrink: 0;
}
.xp-tab {
  padding: 4px 12px;
  background: linear-gradient(180deg, #ece9d8 0%, #d4d0bc 100%);
  border: 1px solid #aaa;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  cursor: pointer;
  font-size: 11px;
  color: #000;
  position: relative;
  top: 1px;
  margin-bottom: -1px;
}
.xp-tab.active {
  background: #fff;
  border-bottom: 1px solid #fff;
  font-weight: bold;
  color: #003c8c;
  z-index: 1;
}
.xp-tab:hover:not(.active) {
  background: linear-gradient(180deg, #f5f4ec 0%, #e0dccc 100%);
}
.xp-tabs-content {
  flex: 1;
  background: #fff;
  border: 1px solid #aaa;
  border-top: none;
  padding: 12px;
  overflow: auto;
}

/* ============================================
   LIST VIEW / TABLES
   ============================================ */
.xp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  background: #fff;
  border: 1px solid #7f9db9;
}
.xp-table th {
  background: linear-gradient(180deg, #ece9d8 0%, #c0baa0 100%);
  border-right: 1px solid #aaa;
  border-bottom: 1px solid #aaa;
  padding: 4px 6px;
  text-align: left;
  font-weight: bold;
  color: #000;
  text-shadow: 0 1px 0 #fff;
  white-space: nowrap;
}
.xp-table th:last-child { border-right: none; }
.xp-table td {
  border-right: 1px solid #e0e0e0;
  border-bottom: 1px solid #e8e8e8;
  padding: 4px 6px;
  vertical-align: top;
}
.xp-table tr:nth-child(even) td { background: #f8f8f8; }
.xp-table tr:hover td { background: #e8f0fc; }
.xp-table tr.selected td { background: #316ac5; color: #fff; }

/* Tree view (left pane) */
.xp-tree {
  font-size: 11px;
  padding: 4px;
  background: #fff;
  overflow: auto;
  height: 100%;
}
.xp-tree-item {
  display: flex;
  align-items: center;
  padding: 2px 4px;
  cursor: pointer;
  gap: 4px;
  white-space: nowrap;
}
.xp-tree-item:hover { background: #e8f0fc; }
.xp-tree-item.selected { background: #316ac5; color: #fff; }
.xp-tree-item .indent { display: inline-block; }
.xp-tree-item .node-icon { font-size: 12px; }

/* ============================================
   TREE + DETAIL LAYOUT
   ============================================ */
.xp-split {
  display: flex;
  height: 100%;
}
.xp-split-left {
  width: 220px;
  background: #fff;
  border-right: 1px solid #aaa;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.xp-split-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}
.xp-split-header {
  background: linear-gradient(180deg, #0997ff 0%, #0666de 50%, #0160c8 100%);
  color: #fff;
  padding: 3px 8px;
  font-weight: bold;
  font-size: 11px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.3);
  border-bottom: 1px solid #0051d0;
}

/* Address bar */
.xp-addressbar {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  background: #ece9d8;
  border-bottom: 1px solid #aaa;
  gap: 4px;
  flex-shrink: 0;
}
.xp-addressbar .label { font-size: 11px; }
.xp-addressbar .xp-input { flex: 1; }

/* ============================================
   PROGRESS BAR
   ============================================ */
.xp-progress {
  height: 16px;
  background: #fff;
  border: 1px solid #7f9db9;
  box-shadow: inset 1px 1px 0 #888;
  position: relative;
  overflow: hidden;
}
.xp-progress-fill {
  height: 100%;
  background: linear-gradient(180deg, #6cb6ff 0%, #1f4fb8 50%, #6cb6ff 100%);
  position: relative;
}
.xp-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent 0,
    transparent 12px,
    rgba(255,255,255,0.2) 12px,
    rgba(255,255,255,0.2) 16px
  );
  animation: progressShine 1.5s linear infinite;
}
@keyframes progressShine {
  from { background-position: 0 0; }
  to { background-position: 16px 0; }
}
.xp-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #000;
  font-weight: bold;
  text-shadow: 0 1px 0 #fff;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 17px; height: 17px; }
::-webkit-scrollbar-track {
  background:
    repeating-linear-gradient(
      45deg,
      #ece9d8 0,
      #ece9d8 2px,
      #d4d0bc 2px,
      #d4d0bc 4px
    );
  border: 1px solid #888;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #f5f4ec 0%, #c0baa0 50%, #888 100%);
  border: 1px solid #888;
  border-radius: 0;
  box-shadow: inset 0 1px 0 #fff;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #fff 0%, #d4d0bc 50%, #999 100%);
}
::-webkit-scrollbar-button {
  background: linear-gradient(180deg, #f5f4ec 0%, #c0baa0 50%, #888 100%);
  border: 1px solid #888;
  height: 17px;
  width: 17px;
  display: block;
  box-shadow: inset 0 1px 0 #fff;
}

/* ============================================
   NOTIFICATIONS — classic system dialogs
   ============================================ */
.notification-container {
  position: fixed;
  bottom: 36px;
  right: 8px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  pointer-events: none;
}
.xp-notify {
  pointer-events: auto;
  min-width: 280px;
  max-width: 360px;
  background: #ece9d8;
  border: 2px solid #0055ea;
  border-radius: 6px;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  font-size: 11px;
  animation: notifyIn 0.3s ease-out;
}
@keyframes notifyIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.xp-notify.warn { border-color: #c89020; }
.xp-notify.error { border-color: #c02020; }
.xp-notify.success { border-color: #2d8a2d; }
.xp-notify-titlebar {
  background: linear-gradient(180deg, #0997ff 0%, #0051d0 100%);
  color: #fff;
  padding: 3px 6px;
  display: flex;
  align-items: center;
  font-weight: bold;
  text-shadow: 0 1px 0 rgba(0,0,0,0.3);
}
.xp-notify.warn .xp-notify-titlebar { background: linear-gradient(180deg, #e8b545 0%, #986810 100%); }
.xp-notify.error .xp-notify-titlebar { background: linear-gradient(180deg, #e08585 0%, #801515 100%); }
.xp-notify.success .xp-notify-titlebar { background: linear-gradient(180deg, #6cd06c 0%, #2d8a2d 100%); }
.xp-notify-body {
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.xp-notify-icon { font-size: 24px; flex-shrink: 0; }
.xp-notify-content { flex: 1; }
.xp-notify-title { font-weight: bold; margin-bottom: 4px; }
.xp-notify-text { font-size: 11px; line-height: 1.4; }
.xp-notify-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding: 0 8px 8px;
}
