/* 胖鑫的装修万事屋 · 日式奶油风(暖色浅色主题)
 * 配色: 奶油米白 + 焦糖 + 陶土 + 鼠尾草绿,温馨适合装修受众
 */

:root {
  /* Surfaces —— 奶油浅色 */
  --bg: #F5EFE6;            /* 奶油米底 */
  --bg-elevated: #FBF6EE;   /* 侧栏 / 页头 */
  --card: #FFFFFF;          /* 卡片纯白 */
  --card-hover: #F7F1E8;
  --border: rgba(120,95,60,0.13);
  --border-strong: rgba(120,95,60,0.24);

  /* Text —— 暖棕 */
  --text: #463A2C;
  --text-muted: #8B7A64;
  --text-dim: #B6A78F;

  /* Brand —— 焦糖 / 陶土 / 鼠尾草 */
  --amber: #D27D3E;       /* primary 焦糖 */
  --amber-soft: rgba(210,125,62,0.13);
  --coral: #DD8163;       /* secondary 陶土 */
  --teal: #8AA47B;        /* success 鼠尾草绿 */
  --rose: #CF6353;        /* warning 暖红 */
  --indigo: #BC8A84;      /* info 豆沙粉 */

  /* Layout */
  --sidebar-w: 248px;
  --header-h: 64px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --shadow-card: 0 6px 20px rgba(150,115,70,0.10);
}

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

html, body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, system-ui, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: var(--amber); text-decoration: none; }
img { display: block; max-width: 100%; }

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

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.brand-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--amber), var(--coral));
  display: grid; place-items: center;
  font-size: 22px;
}
.brand-name { font-size: 15px; font-weight: 700; }
.brand-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.nav-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  transition: background .15s, color .15s;
  text-align: left;
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active {
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 600;
}
.nav-icon { width: 20px; text-align: center; font-size: 16px; }
.nav-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--card);
  color: var(--text-muted);
}
.nav-item.active .nav-badge { background: var(--amber); color: #1a1206; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
}
.brand-contact {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  text-align: center;
}
.brand-contact-name { font-size: 13px; color: var(--text); font-weight: 600; margin-bottom: 8px; }
.brand-contact-qr {
  width: 140px; height: 140px;
  margin: 0 auto 8px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--text-dim);
  font-size: 11px;
  text-align: center;
  line-height: 1.4;
  padding: 4px;
  overflow: hidden;
}
.brand-contact-qr:hover { transform: scale(1.05); transition: transform .2s; }
.brand-contact-line { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.privacy-tag {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  background: rgba(20,184,166,0.08);
  border-radius: 6px;
  color: var(--teal);
  font-size: 11px;
  line-height: 1.4;
}

/* ===== Main ===== */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.page-header {
  height: var(--header-h);
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.page-header-left { display: flex; align-items: center; gap: 14px; }
.menu-btn { display: none; font-size: 22px; color: var(--text-muted); padding: 4px 8px; }
.page-title { font-size: 18px; font-weight: 700; }
.page-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; }

.page-body {
  padding: 24px 28px 80px;
  flex: 1;
}

/* ===== Cards ===== */
.notice {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(20,184,166,0.12), rgba(245,158,11,0.06));
  border: 1px solid rgba(20,184,166,0.25);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.notice-icon { font-size: 22px; }
.notice-body { flex: 1; }
.notice-title { font-weight: 600; margin-bottom: 2px; }
.notice-text { font-size: 12.5px; color: var(--text-muted); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  border-top: 3px solid var(--amber);
  position: relative;
  overflow: hidden;
}
.stat-card.c-coral { border-top-color: var(--coral); }
.stat-card.c-teal  { border-top-color: var(--teal); }
.stat-card.c-indigo{ border-top-color: var(--indigo); }
.stat-head { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-label { font-size: 12.5px; color: var(--text-muted); }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 6px; }
.stat-foot { font-size: 11.5px; color: var(--text-dim); margin-top: 6px; }
.stat-icon {
  font-size: 18px;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--amber-soft);
  display: grid; place-items: center;
}
.stat-card.c-coral .stat-icon { background: rgba(251,113,133,0.15); }
.stat-card.c-teal  .stat-icon { background: rgba(20,184,166,0.15); }
.stat-card.c-indigo .stat-icon { background: rgba(129,140,248,0.15); }

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--border);
}
.panel-title { font-size: 14px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.panel-empty { color: var(--text-dim); font-size: 13px; padding: 30px 0; text-align: center; }

/* ===== Stage list ===== */
.stage-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background .12s;
  cursor: pointer;
}
.stage-row:hover { background: var(--card-hover); }
.stage-row + .stage-row { border-top: 1px solid var(--border); }
.stage-icon { font-size: 18px; width: 28px; text-align: center; }
.stage-name { flex: 1; font-size: 13.5px; }
.stage-pct { font-size: 11.5px; color: var(--text-muted); }
.stage-status {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-dim);
}
.stage-status.s-doing { background: var(--amber-soft); color: var(--amber); }
.stage-status.s-done  { background: rgba(20,184,166,0.15); color: var(--teal); }

/* ===== Workflow page ===== */
.stage-tab-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.stage-tab {
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--card);
  color: var(--text-muted);
  font-size: 12.5px;
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px;
}
.stage-tab:hover { background: var(--card-hover); color: var(--text); }
.stage-tab.active {
  background: var(--amber);
  color: #1a1206;
  border-color: var(--amber);
  font-weight: 600;
}

.stage-detail .panel {
  margin-bottom: 16px;
}
.task {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.task:last-child { border-bottom: none; }
.task input[type=checkbox] {
  width: 18px; height: 18px;
  accent-color: var(--amber);
  margin-top: 2px;
  cursor: pointer;
}
.task-body { flex: 1; }
.task-title { font-size: 13.5px; }
.task-done .task-title { text-decoration: line-through; color: var(--text-dim); }
.task-note { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.6; }

.tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-muted);
}
.tag.tag-warn { background: rgba(244,63,94,0.12); color: var(--rose); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  transition: all .15s;
}
.btn:hover { background: var(--card-hover); border-color: var(--amber); }
.btn-primary {
  background: var(--amber);
  color: #1a1206;
  border-color: var(--amber);
  font-weight: 600;
}
.btn-primary:hover { background: #fbbf24; color: #1a1206; }
.btn-sm { padding: 5px 10px; font-size: 11.5px; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sidebar {
    position: fixed; left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform .25s;
    z-index: 100;
    box-shadow: 0 0 40px rgba(0,0,0,.5);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: block; }
  .page-body { padding: 16px 14px 60px; }
  .page-header { padding: 0 14px; }
}
