/* ═══════════════════════════════════════════════════════════════
   Integrated Explorer — 금융권 전문 메인 허브
   Professional Financial Terminal · Institutional Grade
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg:              #0b0e14;
  --bg-surface:      #101318;
  --bg-elevated:     #151a24;
  --bg-panel:        #121620;
  --bg-row-alt:      #0e1119;
  --bg-hover:        rgba(56, 189, 248, 0.04);
  --bg-active:       rgba(56, 189, 248, 0.08);

  --border:          #1c2130;
  --border-strong:   #252d3d;

  --text:            #c8d0dc;
  --text-bright:     #e8edf5;
  --text-secondary:  #7d889c;
  --text-muted:      #495264;

  --accent:          #38bdf8;
  --accent-dim:      rgba(56, 189, 248, 0.10);
  --accent-text:     #7dd3fc;

  --positive:        #ef4444;
  --negative:        #3b82f6;
  --warn:            #f59e0b;
  --green:           #10b981;

  --font-sans:       "Pretendard Variable", "Inter", "Malgun Gothic", sans-serif;
  --font-mono:       "IBM Plex Mono", "Consolas", monospace;

  --ease:            cubic-bezier(0.16, 1, 0.3, 1);
  --dur:             0.15s;
}

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

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(56,189,248,.18); color: var(--text-bright); }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); }

/* ═══════════════════════════════════════
   Shell Container
   ═══════════════════════════════════════ */
.shell {
  max-width: 1680px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.is-hidden { display: none !important; }

/* ═══════════════════════════════════════
   Title Bar — 32px compact
   ═══════════════════════════════════════ */
.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding: 6px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 8px 12px;
  flex-wrap: wrap;
}

.titlebar-left,
.titlebar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.15em;
}

.logo-sep {
  width: 1px;
  height: 12px;
  background: var(--border-strong);
}

.app-name {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.sys-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  background: var(--accent-dim);
  border: 1px solid rgba(56,189,248,.15);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.12em;
}

.sys-badge::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

.sys-sep {
  width: 1px;
  height: 10px;
  background: var(--border);
}

.sys-clock {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════
   Status Strip — 28px
   ═══════════════════════════════════════ */
.status-strip {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow: visible;
  flex-wrap: wrap;
  row-gap: 4px;
}

.status-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  white-space: normal;
  min-width: 0;
  flex-wrap: wrap;
}

.status-cell:first-child { padding-left: 0; }

.status-key {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.status-val {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
}

.val-muted { color: var(--text-muted); }

.status-div {
  width: 1px;
  height: 12px;
  background: var(--border);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   Workspace Stack
   ═══════════════════════════════════════ */
.workspace-stack {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.home-view {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.workspace-view {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ═══════════════════════════════════════
   Stat Strip — horizontal ticker
   ═══════════════════════════════════════ */
.stat-strip {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.stat-strip .dashboard-stat-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-right: 1px solid var(--border);
  min-width: 0;
}

.stat-strip .dashboard-stat-card:last-child {
  border-right: none;
}

.stat-strip .dashboard-stat-card .section-label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: normal;
  flex-shrink: 0;
}

.stat-strip .dashboard-stat-card strong {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-text);
  white-space: normal;
}

.stat-strip .dashboard-stat-card span {
  font-size: 10px;
  color: var(--text-muted);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.45;
}

/* ═══════════════════════════════════════
   Launcher Section — Table-based
   ═══════════════════════════════════════ */
.launcher-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
}

.launcher-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 36px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.launcher-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sec-icon {
  width: 3px;
  height: 14px;
  background: var(--accent);
  flex-shrink: 0;
}

.launcher-header h2 {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.02em;
}

.sec-count {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 1px 5px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
}

.sec-timestamp {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Launcher Table ── */
.launcher-table-wrap {
  flex: 1;
  overflow: auto;
}

.launcher-table {
  width: 100%;
  border-collapse: collapse;
}

.launcher-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 7px 14px;
  background: var(--bg-elevated);
  border-bottom: 2px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: left;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.launcher-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  vertical-align: middle;
}

.launcher-table tbody tr {
  transition: background var(--dur) var(--ease);
  cursor: pointer;
}

.launcher-table tbody tr:nth-child(even) {
  background: var(--bg-row-alt);
}

.launcher-table tbody tr:hover {
  background: var(--bg-hover);
}

/* Column specific */
.col-idx {
  width: 36px;
  text-align: center !important;
}

.launcher-table td:first-child {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.col-chip { width: 72px; }
.col-cat { width: 100px; }
.col-stat { width: 120px; }
.col-act { width: 100px; text-align: center !important; }

.mod-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-panel);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.mod-name {
  font-weight: 700;
  color: var(--text-bright);
  font-size: 13px;
}

.mod-cat {
  color: var(--text-secondary);
  font-size: 11px;
}

.mod-desc {
  color: var(--text-secondary);
  font-size: 11px;
  max-width: 360px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.5;
}

.mod-status {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.mod-status.is-used {
  color: var(--green);
}

.launch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border: 1px solid var(--border-strong);
  background: var(--accent-dim);
  font: inherit;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-text);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  letter-spacing: 0.04em;
}

.launch-btn:hover {
  background: var(--bg-active);
  border-color: var(--accent);
  color: var(--text-bright);
}

/* ═══════════════════════════════════════
   Recent Section
   ═══════════════════════════════════════ */
.recent-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.recent-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 32px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.recent-header h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-bright);
}

.recent-list {
  display: flex;
  overflow-x: auto;
  gap: 0;
}

.recent-route-button {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 16px;
  border: none;
  border-right: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  white-space: normal;
  transition: background var(--dur) var(--ease);
  min-width: 160px;
}

.recent-route-button:last-child {
  border-right: none;
}

.recent-route-button:hover {
  background: var(--bg-hover);
}

.recent-route-button span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-bright);
}

.recent-route-button small {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
}

.empty-state {
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 11px;
}

/* ═══════════════════════════════════════
   Footer
   ═══════════════════════════════════════ */
.shell-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  padding: 0 16px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   Workspace View
   ═══════════════════════════════════════ */
.workspace-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 16px;
  min-height: 36px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.workspace-actions {
  display: flex;
  gap: 1px;
  flex-wrap: wrap;
}

.tab-btn {
  border: none;
  border-right: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-secondary);
  padding: 8px 14px;
  min-height: 36px;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: normal;
  line-height: 1.35;
}

.tab-btn:first-child {
  border-left: 1px solid var(--border);
}

.tab-btn:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.tab-btn.is-active {
  background: var(--accent-dim);
  color: var(--accent-text);
  border-bottom: 2px solid var(--accent);
}

.workspace-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.ws-eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ws-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-bright);
}

/* ═══════════════════════════════════════
   Module Shell
   ═══════════════════════════════════════ */
.module-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: var(--bg-surface);
}

.module-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.module-head-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.module-head-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.module-head strong {
  font-size: 12px;
  color: var(--text-bright);
}

.module-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  flex: 1;
}

.bridge-status {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  white-space: normal;
  line-height: 1.45;
}

.module-frame {
  width: 100%;
  flex: 1;
  min-height: 860px;
  border: none;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* ═══════════════════════════════════════
   Legacy compatibility (hidden elements)
   ═══════════════════════════════════════ */
.section-label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.panel { background: var(--bg-surface); }
.home-card,
.card-top,
.card-meta-row,
.card-copy,
.card-list,
.card-footer,
.module-chip,
.module-category,
.module-route,
.module-state,
.nav-button,
.module-button,
.ghost-button,
.eyebrow,
.hero,
.hero-copy,
.hero-actions,
.hero-badges,
.home-grid,
.home-dashboard,
.dashboard-panel,
.dashboard-head,
.dashboard-timestamp { /* kept for JS compat */ }

/* ═══════════════════════════════════════
   Responsive
   ═══════════════════════════════════════ */
@media (max-width: 1100px) {
  .mod-desc { display: none; }
  .col-desc { display: none; }
}

@media (max-width: 860px) {
  .stat-strip {
    flex-wrap: wrap;
  }

  .stat-strip .dashboard-stat-card {
    min-width: 50%;
    border-bottom: 1px solid var(--border);
  }

  .titlebar-left .app-name { display: none; }

  .workspace-actions {
    overflow-x: auto;
  }

  .module-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .launcher-table .col-cat,
  .launcher-table .col-stat { display: none; }
}

@media (max-width: 600px) {
  .titlebar { padding: 0 10px; }
  .status-strip { padding: 0 10px; }
  .launcher-header { padding: 0 10px; }
  .recent-header { padding: 0 10px; }
  .shell-footer { padding: 0 10px; }

  .stat-strip .dashboard-stat-card {
    min-width: 100%;
  }

  .workspace-bar {
    flex-direction: column;
    height: auto;
    padding: 8px 10px;
    gap: 6px;
  }
}
