:root {
  --brand-dark: #2f343c;
  --brand-accent: #f28523;
  --brand-slate: #4a4f59;
  --bg: #f3f5f7;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #d5dbe1;
  --shadow: 0 10px 24px rgba(31, 41, 51, 0.08);
  --radius: 8px;
  --gap: 16px;
  --font-ui: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-title: "IBM Plex Serif", "Times New Roman", serif;
}

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

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.erp-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.erp-header {
  background: var(--brand-slate);
  color: #fff;
  border-left: 5px solid var(--brand-accent);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.erp-header h1 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.erp-header a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.erp-header .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

.content {
  flex: 1;
  padding: 28px 32px 40px;
}

.section-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.section-subtitle {
  color: var(--muted);
  margin-bottom: 24px;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap);
}

.module-card {
  background: var(--card);
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(31, 41, 51, 0.12);
}

.module-card.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.module-icon {
  font-size: 1.6rem;
}

.module-title {
  font-weight: 600;
}

.module-desc {
  font-size: 0.9rem;
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  background: #e8edf2;
  color: #3d4b5c;
  padding: 3px 8px;
  border-radius: 999px;
  width: fit-content;
}

.search-panel {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 140px 140px;
  gap: 12px;
  margin-bottom: 16px;
}

.search-panel input,
.search-panel select,
.search-panel button {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  font-family: var(--font-ui);
}

.search-panel button {
  background: var(--brand-dark);
  color: #fff;
  border: none;
  cursor: pointer;
}

.search-panel button:hover {
  background: #1f242b;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table th,
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.9rem;
}

.table th {
  background: #eef2f6;
  font-weight: 600;
}

.table tbody tr:hover {
  background: #f8fafc;
}
.table tbody tr.is-subrow td {
  color: var(--muted);
  font-size: 0.85rem;
  background: #fafbfc;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 18px;
}

.panel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.panel-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text);
}

.panel-row input,
.panel-row select,
.panel-row textarea,
.panel-row button {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-family: var(--font-ui);
}

.panel-row button {
  background: var(--brand-dark);
  color: #fff;
  border: none;
  cursor: pointer;
}

.panel-row button:hover {
  background: #1f242b;
}

.help-box {
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 8px 0 14px;
  font-size: 0.9rem;
  color: var(--text);
}

.help-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.field-error {
  color: #b42318;
  font-size: 0.8rem;
  margin-top: 4px;
}

.banner-error {
  background: #ffe4e7;
  border: 1px solid #fda4af;
  color: #9f1239;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.panel-col {
  flex: 1 1 320px;
}

.chip-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.chip {
  border: 1px solid var(--border);
  background: #e8edf2;
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.85rem;
}

.chip.active {
  background: var(--brand-accent);
  color: #fff;
  border-color: var(--brand-accent);
}

.workplan-btn {
  background: #4a4f59;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
}

.workplan-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.workplan-row td {
  padding: 0;
  border-bottom: none;
}

.workplan-panel {
  padding: 12px 14px 16px;
  background: #f7f9fc;
}

.workplan-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.workplan-table th,
.workplan-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  text-align: left;
}

.workplan-table th {
  background: #eef2f6;
  font-weight: 600;
}

.workplan-ops-btn {
  background: #2f343c;
  color: #fff;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

.workplan-ops-row td {
  background: #f9fbff;
  padding: 8px 12px;
}

.workplan-ops-panel {
  padding: 8px 10px;
}

.workplan-ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.workplan-ops-table th,
.workplan-ops-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.workplan-ops-table th {
  background: #edf2f7;
  font-weight: 600;
}

.action-link {
  color: var(--brand-accent);
  text-decoration: none;
  font-weight: 600;
}

.action-link:hover {
  text-decoration: underline;
}

.status {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.notice {
  padding: 12px 14px;
  border-radius: 6px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  margin-top: 12px;
}

.footer {
  background: #1f242b;
  color: #9aa3ad;
  font-size: 0.75rem;
  padding: 8px 16px;
  text-align: center;
}

@media (max-width: 720px) {
  .content {
    padding: 20px 18px 28px;
  }

  .search-panel {
    grid-template-columns: 1fr;
  }

  .erp-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
