/* ==========================================================================
   ComCleaners POS — GarmentFlow 앱 셸 + 대시보드
   클린 SaaS: 흰색/밝은회색 바탕, primary blue. 장식 그라데이션 없음.
   ========================================================================== */

:root {
  --navy: #0f2540;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e4e9f0;
  --text: #1a2433;
  --muted: #64748b;
  --success: #1e8e3e;
  --success-bg: #e7f6ec;
  --warning: #b45309;
  --warning-bg: #fdf3e7;
  --danger: #d93025;
  --danger-bg: #fdeaea;
  --info: #0f6b9c;
  --sidebar-w: 236px;
}

* { box-sizing: border-box; }
body.app-body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ===== App Shell ===== */
.app-shell { display: flex; min-height: 100vh; }

/* --- 사이드바 --- */
.app-sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: #cdd6e4;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-logo { width: 38px; height: 38px; border-radius: 10px; }
.brand-name { color: #fff; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }

.side-nav { padding: 12px 10px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px;
  border-radius: 8px;
  color: #c3cddb;
  font-size: 14px; font-weight: 500;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-ico { width: 20px; text-align: center; font-size: 15px; opacity: 0.9; }
.nav-disabled { opacity: 0.45; cursor: default; }
.nav-disabled:hover { background: none; color: #c3cddb; }
.nav-note {
  font-size: 11px; color: #5a6b84; padding: 8px 12px 4px;
  text-transform: uppercase; letter-spacing: 0.05em;
}

.side-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,0.08); }
.tenant-badge {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: #dbe3ee;
  padding: 4px 2px 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.online { background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,0.18); }
.status-dot.offline { background: #f87171; }
.status-dot.amber { background: #fbbf24; }
.signout-btn {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
}
.signout-btn:hover { background: rgba(255,255,255,0.12); }

/* --- 메인/탑바 --- */
.app-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 17px; font-weight: 650; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.conn-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em;
  padding: 5px 10px; border-radius: 999px;
}
.conn-badge.online { background: var(--success-bg); color: var(--success); }
.user-chip {
  font-size: 13px; font-weight: 600; color: var(--text);
  background: var(--primary-soft); color: var(--primary);
  padding: 6px 12px; border-radius: 999px;
}

.app-content { padding: 28px; flex: 1; }

/* ===== 공통 컴포넌트 ===== */
.btn-primary-sm {
  background: var(--primary); color: #fff;
  border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 13.5px; font-weight: 600;
  cursor: pointer;
}
.btn-primary-sm:hover:not([disabled]) { filter: brightness(1.06); }
.btn-primary-sm:disabled { opacity: 0.5; cursor: not-allowed; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title { font-size: 15px; font-weight: 650; margin: 0; }

/* ===== 대시보드 ===== */
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { padding: 18px 20px; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-value { font-size: 30px; font-weight: 700; margin: 8px 0 2px; letter-spacing: -0.02em; }
.stat-value small { font-size: 16px; color: var(--muted); font-weight: 500; }
.stat-foot { font-size: 12px; color: var(--muted); }
.stat-foot .up { color: var(--success); font-weight: 600; }

.dash-two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 24px; }
.panel { padding: 20px; }

/* 운영 상태 (Received/Processing/Ready/Issues) */
.ops-list { list-style: none; margin: 0; padding: 0; }
.ops-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer; transition: border-color 0.12s, background 0.12s;
}
.ops-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.ops-left { display: flex; align-items: center; gap: 12px; }
.ops-count { font-size: 18px; font-weight: 700; min-width: 30px; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.pill.blue   { background: #e8f0fe; color: var(--info); }
.pill.amber  { background: var(--warning-bg); color: var(--warning); }
.pill.green  { background: var(--success-bg); color: var(--success); }
.pill.red    { background: var(--danger-bg); color: var(--danger); }
.pill.gray   { background: #eef1f5; color: var(--muted); }

/* Needs attention */
.attn-list { list-style: none; margin: 0; padding: 0; }
.attn-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.attn-item:last-child { border-bottom: none; }
.attn-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.attn-item.amber .attn-dot { background: var(--warning); }
.attn-item.red .attn-dot { background: var(--danger); }

/* Welcome/onboarding banner */
.welcome-banner {
  background: var(--primary-soft);
  border: 1px solid #d6e4ff;
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 16px;
}
.welcome-banner h2 { margin: 0 0 4px; font-size: 17px; color: #1e40af; }
.welcome-banner p { margin: 0; font-size: 13.5px; color: #3b5bb5; }

/* 반응형 */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .app-shell { flex-direction: column; }
  .app-sidebar { width: 100%; height: auto; position: static; }
  .dash-grid { grid-template-columns: 1fr; }
  .app-content { padding: 16px; }
}
/* ===== 추가: 고객/테이블/폼 (garmentflow.css) ===== */
.search-row { display: flex; gap: 10px; }
.search-input {
  flex: 1; padding: 10px 14px; font-size: 14.5px;
  border: 1.5px solid var(--border); border-radius: 10px;
  outline: none; background: #fff;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }

.gf-table { width: 100%; border-collapse: collapse; }
.gf-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.gf-table td { padding: 11px 10px; font-size: 14px; border-bottom: 1px solid #eef1f5; }
.gf-table tr:last-child td { border-bottom: none; }
.gf-table tbody tr:hover { background: #fafbfc; }
.row-action { color: var(--primary); font-size: 13px; font-weight: 600; text-decoration: none; }
.row-action:hover { text-decoration: underline; }

.empty-state { text-align: center; padding: 32px 12px; color: var(--muted); }
.empty-state p { margin-bottom: 14px; font-size: 14.5px; }

/* 폼 */
.gf-form .field { margin-bottom: 14px; }
.gf-form label { display: block; font-size: 12.5px; font-weight: 600; color: #334155; margin-bottom: 5px; }
.gf-form input[type="text"], .gf-form input[type="email"], .gf-form input[type="tel"],
.gf-form input[type="password"], .gf-form select, .gf-form textarea {
  width: 100%; padding: 10px 12px; font-size: 14px;
  border: 1.5px solid var(--border); border-radius: 9px;
  background: #fff; outline: none;
}
.gf-form input:focus, .gf-form select:focus, .gf-form textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width:600px){ .form-grid-2{ grid-template-columns:1fr; } }
.field-checkbox { display: flex; align-items: center; gap: 8px; margin: 6px 0 14px; }
.field-checkbox input { width: 16px; height: 16px; accent-color: var(--primary); }
.field-checkbox label { font-size: 13.5px; margin: 0; }
.form-actions { margin-top: 4px; }

/* 정의목록 (고객 프로필) */
.gf-dl { display: grid; grid-template-columns: 120px 1fr; row-gap: 10px; margin: 0; }
.gf-dl dt { color: var(--muted); font-size: 13px; font-weight: 500; padding-top: 1px; }
.gf-dl dd { margin: 0; font-size: 14px; }

/* 플래시 토스트 */
.flash-notice, .flash-alert {
  border-radius: 10px; padding: 11px 15px; font-size: 13.5px; margin-bottom: 16px;
}
.flash-notice { background: var(--success-bg); color: var(--success); border: 1px solid #b7e4c4; }
.flash-alert  { background: var(--danger-bg); color: var(--danger); border: 1px solid #f5c2c0; }
