/* ─────────── SAMWOO 영업2팀 — macOS Tahoe portal shell ─────────── */
/* Mirrors 00_통합_메인_포털/assets/portal.css chrome layer.          */
/* Business logic styles (grid, history, ccf-lookup, inventory)        */
/* remain in index.html inline <style>.                                */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

/* ── Design tokens ── */
:root {
  --mac-blue:      #0a84ff;
  --mac-blue-dark: #0066cc;
  --ink:   #1d1d1f;
  --ink-2: #3a3a3c;
  --ink-3: #6e6e73;
  --ink-4: #a1a1a6;

  --bg-window:  rgba(255,255,255,0.78);
  --bg-content: #ffffff;
  --bg-card:    #f5f5f7;
  --bg-card-2:  #fbfbfd;
  --line:   rgba(0,0,0,0.08);
  --line-2: rgba(0,0,0,0.05);
  --hover:  rgba(0,0,0,0.04);

  --r:    10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --sidebar-w: 230px;
  --sans: "Pretendard", -apple-system, "SF Pro Text", "SF Pro Display",
          BlinkMacSystemFont, sans-serif;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: -0.1px;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  background: #ececec;
  min-height: 100vh;
  padding: 24px;
  overflow-x: hidden;
}

button, input { font-family: inherit; color: inherit; }

/* ── Window container ── */
.window {
  max-width: 1240px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  box-shadow:
    0 0 0 0.5px rgba(0,0,0,0.1),
    0 24px 60px rgba(0,0,0,0.14),
    0 8px 20px rgba(0,0,0,0.06);
  overflow: hidden;
}

/* ── Body grid ── */
.body {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 600px;
}

/* ── Sidebar ── */
.sidebar {
  background: linear-gradient(180deg, #f7f7f9 0%, #e8e8eb 50%, #f5f5f7 100%);
  border-right: 1px solid var(--line-2);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
}

/* Search bar */
.sb-search {
  background: rgba(255,255,255,0.6);
  border: 0.5px solid rgba(0,0,0,0.08);
  border-radius: 7px;
  padding: 5px 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.sb-search input {
  flex: 1;
  font-size: 12.5px;
  padding: 0;
  background: transparent;
  border: none;
  outline: none;
}
.sb-search input::placeholder { color: var(--ink-4); }

/* Brand block */
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 8px;
  margin-bottom: 14px;
}
.sb-brand .mark {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0a84ff, #0055cc);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.sb-brand .nm  { font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: -0.2px; }
.sb-brand .tm  { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

/* User info block (shown after login) */
.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 8px;
  margin-bottom: 14px;
  cursor: pointer;
}
.sb-user:hover { background: rgba(255,255,255,0.4); }
.sb-user .ava {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b9dff, #1d4ed8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.sb-user .who  { flex: 1; min-width: 0; }
.sb-user .nm   { font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: -0.2px; }
.sb-user .tm   { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

/* Sections & items */
.sb-section { margin-bottom: 6px; }

.sb-st {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  padding: 8px 10px 4px;
  letter-spacing: -0.1px;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  margin: 1px 0;
  user-select: none;
}
.sb-item:hover:not(.active):not(.locked) { background: rgba(0,0,0,0.04); }
.sb-item.active  { background: var(--mac-blue); color: #fff; font-weight: 500; }
.sb-item.locked  { color: var(--ink-4); cursor: not-allowed; }
.sb-item.locked .ico-box { opacity: 0.5; }

/* Icon boxes */
.ico-box {
  width: 20px; height: 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 10px;
}
.ico-box svg { width: 12px; height: 12px; stroke-width: 2; }
.ico-box.b1  { background: #007aff; }
.ico-box.b2  { background: #5ac8fa; }
.ico-box.b3  { background: #5856d6; }
.ico-box.b4  { background: #af52de; }
.ico-box.b5  { background: #8e8e93; }
.ico-box.b6  { background: #ff9500; }
.ico-box.b7  { background: #ff3b30; }
.ico-box.b8  { background: #00838f; }
.ico-box.b9  { background: #0277bd; }
.ico-box.b10 { background: #ad1457; }
.ico-box.b11 { background: #4e342e; }
.ico-box.b12 { background: #34c759; }

.sb-item.active .ico-box { background: rgba(255,255,255,0.25); }
.sb-item .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-item .ct {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  background: rgba(0,0,0,0.06);
  padding: 1px 6px;
  border-radius: 999px;
}
.sb-item.active .ct { color: #fff; background: rgba(255,255,255,0.25); }

.sb-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 6px 0; }
.sb-spacer  { flex: 1; min-height: 12px; }
.sb-foot    { padding: 6px 10px; font-size: 10.5px; color: var(--ink-4); }

/* ── Content area ── */
.content {
  background: var(--bg-content);
  padding: 24px 32px 36px;
  overflow-x: auto;
}

/* Page header */
.page-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}
.page-h .title {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.5px;
}
.page-h .subtitle {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 4px;
}

/* Card group (landing cards) */
.card-group {
  background: var(--bg-card);
  border: 0.5px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 14px;
  overflow: hidden;
}
.card-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 0.5px solid var(--line-2);
  cursor: pointer;
}
.card-row:last-child { border-bottom: none; }
.card-row:hover { background: rgba(0,0,0,0.02); }

.card-row .row-ico {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.card-row .row-l  { flex: 1; min-width: 0; }
.card-row .row-t  { font-size: 13.5px; font-weight: 600; color: var(--ink); letter-spacing: -0.2px; }
.card-row .row-s  { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.card-row .row-r  { font-size: 12px; color: var(--ink-3); text-align: right; min-width: 80px; }
.card-row .status-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.card-row .status-pill.live    { background: #e7f1ec; color: #2f7d5b; }
.card-row .status-pill.pending { background: #f7ead9; color: #ad6b22; }

/* Sec label */
.sec-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  margin: 0 0 8px 4px;
  letter-spacing: -0.1px;
}

/* Portal mbtn overrides — map old btn-primary navy → mac-blue */
.mbtn {
  background: #ffffff;
  border: 0.5px solid rgba(0,0,0,0.12);
  border-radius: 7px;
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 0.5px 0 rgba(0,0,0,0.05);
  transition: background .12s;
}
.mbtn:hover { background: var(--bg-card); }
.mbtn.primary {
  background: var(--mac-blue);
  color: #fff;
  border-color: var(--mac-blue-dark);
}
.mbtn.primary:hover { background: var(--mac-blue-dark); }

/* ── Logout button in sidebar ── */
#logoutBtn {
  display: block;
  width: calc(100% - 12px);
  margin: 0 6px 6px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 0.5px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.5);
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  transition: background .12s;
}
#logoutBtn:hover { background: rgba(255,59,48,0.1); color: #ff3b30; }

/* ── Token map — override hardcoded navy from inline styles ── */
/* btn-primary maps to mac-blue */
.btn-primary             { background: var(--mac-blue) !important; }
.btn-primary:hover       { background: var(--mac-blue-dark) !important; }
/* Section heading accent line */
.section h3              { border-bottom-color: rgba(10,132,255,0.25) !important; color: var(--ink) !important; }
/* Stat card value color override */
.stat-card .value        { color: var(--mac-blue) !important; }
.stat-card .value.red    { color: #c62828 !important; }
.stat-card .value.green  { color: #2e7d32 !important; }
.stat-card .value.blue   { color: var(--mac-blue) !important; }
/* Inventory table header — keep dark, just strip navy */
.inv-wrap thead th       { background: #1e2025 !important; }
/* Toolbar search focus */
.toolbar input[type="text"]:focus { border-color: var(--mac-blue) !important; }
/* old page-title color */
.page-title              { color: var(--ink) !important; font-size: 17px; }
/* log-user accent */
.log-user                { color: var(--mac-blue) !important; }
.log-line::before        { color: var(--mac-blue) !important; }
/* hist-editing highlight */
.hist-editing            { border-color: var(--mac-blue) !important;
                           box-shadow: 0 0 0 2px rgba(10,132,255,.15) !important; }

/* ── Responsive ── */
@media (max-width: 900px) {
  body { padding: 12px; }
  .body { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line-2); }
  .page-h { flex-direction: column; gap: 8px; align-items: flex-start; }
  .content { padding: 16px; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar       { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }
