/* ezai-layout.css - 헤더/사이드바/POS 레이아웃 */
/* 반드시 ezai-theme.css 다음에 로드 */

/* ─── 기본 ─────────────────────────────── */
body.ezai {
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── 공통 헤더 ─────────────────────────── */
.ezai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--header-line);
  flex-shrink: 0;
  z-index: 10;
}
.ezai-header .header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ezai-header .logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
}
.ezai-header .store-info {
  font-size: 12px;
  color: var(--text-muted);
}
.ezai-header .header-center {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.ezai-header .header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ezai-header .employee-name {
  font-size: 13px;
  color: var(--text-secondary);
}
.ezai-header .employee-role {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 4px;
}

/* ─── 앱 바디 (헤더 제외 전체) ─────────── */
.ezai-app-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ─── 사이드바 ─────────────────────────── */
.ezai-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  z-index: 20;
  transition: margin-left 0.25s;
}
.ezai-sidebar.collapsed {
  margin-left: calc(-1 * var(--sidebar-width));
}
.ezai-sidebar-section {
  padding: 12px 0 4px 20px;
  font-size: 11px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ezai-sidebar-divider {
  border: none;
  border-top: 1px solid #222;
  margin: 4px 0;
}
.ezai-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  cursor: pointer;
  color: #888;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-radius: 0;
}
.ezai-nav-item:hover {
  background: rgba(255, 107, 53, 0.08);
  color: #ccc;
}
.ezai-nav-item.active {
  color: var(--accent);
  background: rgba(255, 107, 53, 0.12);
  border-right: 3px solid var(--accent);
}
.ezai-nav-item .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* ─── 메인 콘텐츠 ────────────────────────── */
.ezai-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg-primary);
}
.ezai-content-full {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ─── POS 레이아웃 (QSR/Dine-in) ────────── */
.pos-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* 메뉴 영역 (왼쪽) */
.pos-menu-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border);
  min-width: 0;
}
.pos-menu-categories {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pos-category-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.pos-category-btn:hover,
.pos-category-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pos-menu-grid {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  align-content: start;
}
.pos-menu-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pos-menu-item:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}
.pos-menu-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.pos-menu-item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

/* 카트/액션 영역 (오른쪽) */
.pos-cart-panel {
  width: 300px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: var(--bg-secondary);
}
.pos-cart-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pos-cart-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pos-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}
.pos-cart-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  transition: background 0.15s;
}
.pos-cart-item:hover {
  background: var(--bg-hover);
}
.pos-cart-qty {
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  width: 28px;
  flex-shrink: 0;
}
.pos-cart-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}
.pos-cart-price {
  font-size: 13px;
  font-weight: 600;
  width: 70px;
  text-align: right;
}
.pos-cart-totals {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}
.pos-total-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.pos-total-row.grand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 8px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.pos-action-buttons {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
}
.pos-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ─── 설정 화면 레이아웃 ─────────────────── */
.settings-layout {
  max-width: 900px;
  margin: 0 auto;
}
.settings-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.settings-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* 상단 고정 저장 바 */
.settings-save-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: -24px -24px 24px -24px;
}

/* ─── 빈 상태 ────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state-text {
  font-size: 15px;
}

/* ─── 반응형 ─────────────────────────────── */
@media (max-width: 768px) {
  .ezai-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    margin-left: calc(-1 * var(--sidebar-width));
  }
  .ezai-sidebar.open {
    margin-left: 0;
  }
  .pos-cart-panel {
    width: 100%;
  }
  .pos-layout {
    flex-direction: column;
  }
  .pos-menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}
