/* Mirrors ccs-app-ui-service MUI theme — keep in sync with src/theme + src/constants/Colors.ts. */
:root {
  /* Primary (CCB Blue) */
  --primary: #0815ca;
  --primary-hover: #0712b2;
  --primary-dark: #010033;
  --primary-light: #eaedfa;
  --primary-lighter: #dbdff7;

  /* Text */
  --text: #303030;
  --text-muted: #595959;
  --text-subtle: #999999;

  /* Surfaces & borders */
  --bg: #ffffff;
  --bg-muted: #fafafa;
  --bg-subtle: #f5f5f5;
  --bg-grey: #f0f0f0;
  --border: #dddddd;
  --border-strong: #dddddd;

  /* Status */
  --success: #04865f;
  --success-bg: #e6f4ea;
  --warning: #fffaaa;
  --warning-bg: #fffaaa;
  --warning-text: #404040;
  --danger: #e4261b;
  --danger-bg: #fdecea;

  /* Shape (MuiPaper default borderRadius) */
  --radius: 4px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text); background: var(--bg);
  font-size: 14px; line-height: 1.5;
}
a { color: var(--primary); }

h1, .h1 { font-weight: 400; font-size: 2rem; line-height: 1.21; margin: 10px 0 36px 0; }
h2, .h2 { font-weight: 300; font-size: 1.875rem; line-height: 1.5; }
h3, .h3 { font-weight: 600; font-size: 1.5rem; line-height: 1.33; }
h4, .h4 { font-weight: 600; font-size: 1.25rem; line-height: 1.4; }
h5, .h5 { font-weight: 500; font-size: 1.25rem; line-height: 1.6; letter-spacing: 0.0075em; }
h6, .h6 { font-weight: 700; font-size: 0.75rem; line-height: 1.57; }

.topbar {
  display: grid; grid-template-columns: 240px 1fr 240px;
  align-items: center; padding: 14px 24px; min-height: 60px;
  border-bottom: 1px solid var(--border);
}
.topbar .logo { display: flex; align-items: center; gap: 10px; font-weight: 600; line-height: 1.1; }
.topbar .logo-mark {
  width: 32px; height: 32px; background: var(--primary); color: white;
  border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
}
.topbar .title { text-align: center; font-size: 17px; }
.topbar .right { display: flex; justify-content: flex-end; align-items: center; gap: 16px; }
.topbar .alerts { color: var(--text); font-size: 13px; }
.topbar .avatar-circle { width: 32px; height: 32px; border-radius: 50%; background: #4b5563; }

.layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 65px); }
.sidebar { padding: 20px 24px 24px 24px; border-right: 1px solid var(--border); }
.sidebar .back { display: block; color: var(--text); text-decoration: none; font-size: 14px; margin-bottom: 24px; }
.sidebar .back:hover { color: var(--primary); }
.sidebar .group-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: block; padding: 7px 0 7px 12px; color: var(--text); text-decoration: none;
  border-left: 3px solid transparent; margin-left: -15px;
}
.sidebar nav a:hover { background: var(--bg-muted); }
.sidebar nav a.active { color: var(--primary); font-weight: 600; border-left-color: var(--primary); }

.content-wrap { padding: 32px 48px; max-width: 1000px; }
.page-title { font-size: 2rem; font-weight: 400; line-height: 1.21; margin: 0 0 8px 0; }
.page-subtitle { color: var(--text-muted); margin: 0 0 32px 0; font-size: 14px; }

.steps { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 28px; font-size: 13px; }
.steps .step { padding: 4px 12px; border-radius: 12px; background: var(--bg-subtle); color: var(--text-muted); }
.steps .step.active { background: var(--primary); color: white; }
.steps .step.done { background: var(--success); color: white; }
.steps .arrow { color: var(--text-subtle); }

/* MUI button: textTransform initial, radius 4, darken-on-hover. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 6px 16px; font-size: 0.875rem; font-weight: 500; line-height: 1.75;
  font-family: inherit; text-transform: initial;
  border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); color: white; }
.btn-secondary { background: white; color: var(--primary); border-color: var(--primary); }
.btn-secondary:hover { background: var(--primary-light); border-color: var(--primary-dark); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b71c1c; color: white; }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-light); color: var(--primary); }
.btn-large { padding: 8px 22px; font-size: 0.9375rem; }

.cta-card {
  display: block; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text); margin-bottom: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cta-card:hover { border-color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.cta-card h3 { margin: 0 0 6px 0; font-size: 1.25rem; font-weight: 600; }
.cta-card p { margin: 0; color: var(--text-muted); font-size: 14px; }
.cta-card.primary { border-width: 2px; }

.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.choice-card {
  display: block; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text); cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.choice-card:hover { border-color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.choice-card .badge {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: var(--bg-subtle); color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 12px;
}
.choice-card h3 { margin: 0 0 8px 0; font-size: 1rem; font-weight: 600; }
.choice-card p { margin: 0 0 12px 0; color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.choice-card ul { margin: 8px 0 0 0; padding-left: 18px; color: var(--text-muted); font-size: 13px; }
.choice-card ul li { margin-bottom: 4px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field .help { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.field input[type="text"], .field input[type="url"], .field input[type="email"],
.field input[type="password"], .field input[type="search"], .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-size: 14px; font-family: inherit; background: white;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* MUI Alert: borderRadius 2, padding 4px 16px; warning uses yellow + dark grey. */
.alert { padding: 4px 16px; border-radius: 2px; border: 1px solid transparent; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; min-height: 36px; }
.alert-info { background: var(--primary-light); border-color: var(--primary-lighter); color: var(--primary-dark); }
.alert-success { background: var(--success-bg); border-color: #a7d7b8; color: var(--success); }
.alert-warning { background: var(--warning-bg); border-color: #f7e066; color: var(--warning-text); }
.alert-danger { background: var(--danger-bg); border-color: #f5b7b1; color: var(--danger); }
.alert .icon { font-weight: 700; font-size: 14px; line-height: 1.4; min-width: 14px; margin-top: 6px; }

.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.toolbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--bg-muted); border-bottom: 1px solid var(--border); gap: 12px; }
.toolbar .left { display: flex; align-items: center; gap: 12px; flex: 1; }
.toolbar .selected-count { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.toolbar input[type="search"] { width: 240px; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 13px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chips a { padding: 4px 10px; font-size: 12px; border-radius: 12px; background: white; border: 1px solid var(--border-strong); color: var(--text); text-decoration: none; }
.filter-chips a.active { background: var(--primary); color: white; border-color: var(--primary); }
.table { width: 100%; border-collapse: collapse; background: white; }
.table th { text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; background: var(--bg-muted); border-bottom: 1px solid var(--border); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-muted); }
.table .checkbox-cell { width: 40px; }
.table .name-cell { display: flex; align-items: center; gap: 10px; }
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-subtle); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 500; flex-shrink: 0; border: 1px solid #d1d1d1; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.summary-box { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: white; }
.summary-box .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.summary-box .value { font-size: 28px; font-weight: 600; line-height: 1.1; }
.summary-box .sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.section { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; }
.section h2 { margin: 0 0 16px 0; font-size: 1.25rem; font-weight: 400; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.section h3 { margin: 0 0 12px 0; font-size: 0.9375rem; font-weight: 600; }
.section p { margin: 0 0 12px 0; }
.section .divider { height: 1px; background: var(--border); margin: 20px 0; }

.kv-list { list-style: none; padding: 0; margin: 0; }
.kv-list li { padding: 8px 0; display: flex; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--border); }
.kv-list li:last-child { border-bottom: none; }
.kv-list .icon-yes { color: var(--success); font-weight: 700; min-width: 14px; }
.kv-list .icon-no { color: var(--text-subtle); font-weight: 700; min-width: 14px; }
.kv-list .icon-warn { color: var(--warning-text); font-weight: 700; min-width: 14px; }
.kv-list .label { font-weight: 600; min-width: 180px; }
.kv-list .desc { color: var(--text-muted); }

.progress { height: 8px; background: var(--bg-subtle); border-radius: var(--radius); overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); transition: width 0.3s; }
.progress-bar.success { background: var(--success); }
.progress-bar.danger { background: var(--danger); }

/* Tag/Badge: rounded pill, 20px radius, Open Sans, weight bold — matches .boardtag-wrapper. */
.badge { display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 700; border-radius: 20px; letter-spacing: 0.04em; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--primary-light); color: var(--primary-dark); }
.badge-muted { background: var(--bg-grey); color: #404040; }

.actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.actions.between { justify-content: space-between; align-items: center; }
.actions.center { justify-content: center; }

.confirm-box { border: 2px solid var(--danger); background: var(--danger-bg); border-radius: var(--radius); padding: 20px; margin-top: 24px; }
.confirm-box h3 { margin: 0 0 8px 0; color: var(--danger); font-size: 1rem; }
.confirm-box p { color: var(--danger); margin: 0 0 12px 0; }
.confirm-box .checkbox-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 10px; background: white; border-radius: var(--radius); }

.row-status { display: flex; align-items: center; gap: 8px; min-width: 180px; font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot.success { background: var(--success); }
.dot.warning { background: var(--warning-text); }
.dot.danger { background: var(--danger); }
.dot.info { background: var(--primary); }
.dot.muted { background: var(--text-subtle); }
.dot.pulse { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 56px 24px; text-align: center; background: var(--bg-muted); transition: border-color 0.15s; }
.dropzone:hover { border-color: var(--primary); }
.dropzone .label { font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.dropzone .hint { color: var(--text-muted); font-size: 13px; }

.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.note { font-size: 13px; color: var(--text-muted); padding: 12px 14px; border-left: 3px solid var(--border); background: var(--bg-muted); border-radius: 0 var(--radius) var(--radius) 0; }
.code-pill { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 12px; background: var(--bg-subtle); padding: 2px 6px; border-radius: 3px; }

.demo-banner { font-size: 12px; color: var(--warning-text); padding: 8px 14px; background: var(--warning-bg); border: 1px dashed #f7e066; border-radius: var(--radius); margin-bottom: 16px; }
.demo-banner strong { color: var(--warning-text); }
