@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap");

:root {

  --primary: #e3262c;
  --primary-dark: #b71c21;
  --primary-darker: #8c1518;
  --primary-light: #ff4d52;

  --bg-tint: #e8f7ff;
  --surface-alt: #eaeaea;
  --surface-alt-2: #ededed;
  --ink: #333333;
  --ink-muted: #9da3a9;
  --ink-soft: #b7bcc1;

  --info: #1e5f8d;
  --info-soft: #e8f2f8;
  --violet: #5d87ff;
  --violet-soft: #eef1ff;
  --success: #81b441;
  --success-soft: #f0f6e8;
  --sky: #49beff;
  --sky-soft: #eaf8ff;
  --ink-light: #ffffff;

  --accent: #e3262c;
  --accent-dark: #b71c21;
  --accent-soft: #fde9ea;

  --status-green: var(--success);
  --status-green-soft: var(--success-soft);
  --status-amber: var(--violet);
  --status-amber-soft: var(--violet-soft);
  --status-gray: var(--ink-muted);
  --status-gray-soft: var(--surface-alt-2);

  --border: #e2e2e2;
  --border-strong: #d4d4d4;
  --surface: #ffffff;
  --bg: #f7f8fa;

--radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 8px;
  --radius-pill: 50px;

  --sidebar-w: 272px;
  --sidebar-w-collapsed: 76px;

  --font-display: "Roboto", -apple-system, "Segoe UI", sans-serif;
  --font: "Roboto", -apple-system, "Segoe UI", sans-serif;

--shadow-xs: rgba(17, 17, 26, 0.05) 0px 1px 0px 0px;
  --shadow-sm: rgba(17, 17, 26, 0.05) 0px 1px 0px 0px, rgba(17, 17, 26, 0.1) 0px 0px 8px 0px;
  --shadow-md: rgba(17, 17, 26, 0.06) 0px 2px 0px 0px, rgba(17, 17, 26, 0.14) 0px 0px 16px 0px;
  --shadow-lg: rgba(17, 17, 26, 0.08) 0px 4px 0px 0px, rgba(17, 17, 26, 0.18) 0px 4px 28px 0px;

--ease: cubic-bezier(0.02, 0.01, 0.47, 1);
  --dur-fast: 0.2s;
  --dur-base: 0.3s;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 22.4px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: 14px; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

a { color: var(--primary); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: 0; }

.app-shell { display: flex; min-height: 100vh; }
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }

.page-content {
  padding: 25px 35px 48px;
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--primary-darker) 0%, var(--primary-dark) 55%, var(--primary) 100%);
  color: var(--ink-light);
  display: flex;
  flex-direction: column;
  transition: width 0.3s var(--ease);
  flex-shrink: 0;
  box-shadow: var(--shadow-lg);
  z-index: 10;
  position: relative;
}

.sidebar::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background-image: url('/images/sidebar-bg.png');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 260% auto;
  opacity: 0.10;
  pointer-events: none;
  z-index: 0;
  transition: width 0.3s var(--ease);

  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 45%, rgba(0,0,0,0.35) 75%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 45%, rgba(0,0,0,0.35) 75%, rgba(0,0,0,0) 100%);
}

.sidebar.collapsed::before {
  width: var(--sidebar-w-collapsed);
  background-size: 100% auto;
  background-position: center top;
}

.sidebar > * { position: relative; z-index: 1; }

.sidebar.collapsed { width: var(--sidebar-w-collapsed); }

.sidebar-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 15px;
  min-height: 72px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-light);
  overflow: hidden;
}
.sidebar-logo .logo-fallback {
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius);
}

.sidebar-logo img, .login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}
.sidebar-logo .logo-fallback, .login-logo .logo-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.sidebar-titles { overflow: hidden; min-width: 0; opacity: 1; transition: opacity 0.2s var(--ease); }
.sidebar.collapsed .sidebar-titles { opacity: 0; width: 0; }
.sidebar-titles .line1 {
  font-size: 12px; color: rgba(255, 255, 255, 0.75);
  white-space: normal; line-height: 1.35; overflow-wrap: break-word;
}
.sidebar-titles .line2 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-top: 2px;
  white-space: normal;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.sidebar-nav { flex: 1; padding: 15px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }

.sidebar-section-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
  padding: 12px 12px 5px;
}
.sidebar.collapsed .sidebar-section-label { display: none; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.sidebar-link:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.sidebar-link.active { background: rgba(255, 255, 255, 0.2); color: #fff; font-weight: 700; }
.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: -12px; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--ink-light);
}

.sidebar-icon { width: 20px; text-align: center; flex-shrink: 0; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.sidebar-icon img { width: 20px; height: 20px; object-fit: contain; display: block; }
.sidebar.collapsed .sidebar-link-label { display: none; }

.sidebar-toggle {
  margin: 10px 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s var(--ease);
}
.sidebar-toggle:hover { background: rgba(255, 255, 255, 0.18); }

.sidebar-footer {
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 15px; }
.card-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin: 0 0 15px; color: var(--ink); display: flex; align-items: center; gap: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 15px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; }
a.stat-card-link { text-decoration: none; color: inherit; transition: box-shadow .2s var(--ease), transform .2s var(--ease); cursor: pointer; }
a.stat-card-link:hover { box-shadow: var(--shadow-md, 0 4px 14px rgba(0,0,0,.12)); transform: translateY(-2px); }
tr.row-edit-requested td { background: #fff8e6 !important; }
.stat-card .stat-label { font-size: 13px; font-weight: 500; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--ink); }
.stat-card.accent-green .stat-value { color: var(--success); }
.stat-card.accent-amber .stat-value { color: var(--violet); }
.stat-card.accent-primary .stat-value { color: var(--primary); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: var(--shadow-sm); color: #fff; }
.btn-primary:focus-visible { outline-color: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover:not(:disabled) { background: var(--accent-dark); box-shadow: var(--shadow-sm); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--ink); box-shadow: none; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-alt-2); border-color: var(--ink-soft); }
.btn-gray { background: var(--surface-alt-2); color: var(--ink); box-shadow: none; }
.btn-gray:hover:not(:disabled) { background: var(--surface-alt); }
.btn-sm { padding: 5px 13px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-muted); margin-bottom: 5px; }
.field input[type="text"], .field input[type="password"], .field input[type="number"],
.field input[type="date"], .field input[type="datetime-local"], .field select, .field textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field input:disabled { background: var(--surface-alt-2); color: var(--ink-muted); }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--bg-tint);
  outline: none;
}

.password-field { position: relative; }
.password-field input { padding-right: 42px !important; }
.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.password-toggle:hover { color: var(--primary); background: var(--surface-alt-2); }
.password-toggle svg { width: 19px; height: 19px; }
.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field input { width: 18px; height: 18px; accent-color: var(--primary); }
.field-hint { font-size: 13px; color: var(--ink-muted); margin-top: 4px; }
.field-warning { font-size: 13px; color: var(--violet); margin-top: 4px; }
.field-validation-error, .text-danger { color: var(--accent); font-size: 13px; margin-top: 4px; display: block; }
.input-validation-error { border-color: var(--accent) !important; }

.form-error, .alert {
  border-radius: var(--radius);
  padding: 12px 15px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 15px;
}
.form-error, .alert-error, .validation-summary-errors {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid #f6c6c8;
}
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.alert-success {
  background: var(--success-soft);
  color: #5c7f2f;
  border: 1px solid #cfe3b3;
}

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 15px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 500; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-green { background: var(--status-green-soft); color: var(--status-green); }
.badge-amber { background: var(--status-amber-soft); color: var(--status-amber); }
.badge-gray { background: var(--status-gray-soft); color: var(--status-gray); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
table.data-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 720px; font-size: 13px; }
table.data-table th, table.data-table td { padding: 10px 13px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
table.data-table thead th {
  background: var(--bg-tint);
  color: var(--info);
  font-weight: 700;
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border-strong);
}
table.data-table tbody tr { transition: background 0.2s var(--ease); }
table.data-table tbody tr:hover { background: var(--bg-tint); }
table.data-table td.text-left, table.data-table th.text-left { text-align: left; }

table.data-table th.freeze, table.data-table td.freeze {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 3;
  text-align: left;
  font-weight: 500;
  box-shadow: 2px 0 0 var(--border);
}
table.data-table thead th.freeze { background: var(--bg-tint); z-index: 4; }
table.data-table tbody tr:hover td.freeze { background: var(--bg-tint); }

tr.block-header td { background: var(--surface-alt-2) !important; font-weight: 700; text-align: left; color: var(--ink); }
tr.total-row td { background: #fdeceb !important; font-weight: 700; color: var(--ink); border-top: 2px solid var(--primary); }

table.data-table td.text-center, table.data-table th.text-center { text-align: center; }
table.report-lines td.text-left { white-space: normal; }
table.report-lines tr.line-section td { background: var(--surface-alt-2); font-weight: 700; color: var(--ink); text-align: left; }
table.report-lines tr.line-group td { background: var(--bg-tint); color: var(--ink-muted); }
table.report-lines tr.line-input td { vertical-align: middle; }
table.report-lines td .js-number-input { width: 100%; min-width: 84px; text-align: right; }
table.report-lines td.js-percent { font-weight: 600; color: var(--primary); }
table.summary-template td.text-left { white-space: normal; min-width: 240px; }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(51, 51, 51, 0.6);
  display: none;
  align-items: center; justify-content: center;
  z-index: 50;
  padding: 15px;
}
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: var(--radius-lg); padding: 25px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.modal-icon {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; margin-bottom: 13px;
}
.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin: 0 0 10px; }
.modal-body { font-size: 14px; color: var(--ink-muted); margin-bottom: 20px; line-height: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.login-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 55%, var(--primary-darker) 100%);
  padding: 15px;
}
.login-card { width: 100%; max-width: 392px; background: #fff; border-radius: var(--radius-lg); padding: 35px 25px; box-shadow: var(--shadow-lg); }
.login-logo {
  width: 58px; height: 58px; border-radius: var(--radius-lg);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 18px; margin: 0 auto 15px;
  overflow: hidden;
}
.login-logo .logo-fallback {
  background: var(--bg-tint);
  border: 1.5px solid var(--sky);
  border-radius: var(--radius-lg);
}
.login-title-1 { text-align: center; font-size: 13px; font-weight: 500; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.login-title-2 { text-align: center; font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--primary); margin: 5px 0 25px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-muted); font-size: 14px; }

.progress-bar-track { background: var(--surface-alt-2); border-radius: var(--radius-pill); height: 10px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--success); border-radius: var(--radius-pill); transition: width 0.3s var(--ease); }

.section-heading { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--ink); margin: 0 0 5px; }
.section-sub { font-size: 14px; color: var(--ink-muted); margin: 0 0 20px; }

.action-group { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.sidebar-mobile-open-btn { display: none; }

@media (max-width: 900px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform 0.3s var(--ease); }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-mobile-open-btn { display: inline-flex; }

.sidebar { overflow: hidden; }
  .sidebar::before {
    position: absolute;
    width: 100%;
    height: 100%;
  }

  .form-grid-2 { grid-template-columns: 1fr; }
  .page-content { padding: 15px; }
  .topbar { padding: 0 15px; }
}

.guide-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.guide-filter select, .guide-filter input { max-width: 260px; }

.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.guide-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: var(--shadow-sm); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.guide-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.12); transform: translateY(-2px); }
.guide-card-cover { height: 120px; background-size: contain; background-repeat: no-repeat; background-position: center; background-color: var(--bg-tint); }
.guide-card-cover-empty { display: flex; align-items: center; justify-content: center; font-size: 38px; color: var(--ink-muted); }
.guide-card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.guide-card-title { font-size: 16px; margin: 0; line-height: 1.35; color: var(--ink); }
.guide-card-summary { font-size: 13px; color: var(--ink-muted); margin: 0; }
.guide-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.guide-card-date { font-size: 12px; color: var(--ink-muted); margin-left: auto; }

.guide-form-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.guide-form-side { display: flex; flex-direction: column; gap: 16px; }
.guide-editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.guide-editor { min-height: 320px; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px;
  background: var(--surface); overflow-y: auto; line-height: 1.6; }
.guide-editor:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.guide-editor img { max-width: 100%; }

.guide-detail-title { font-size: 26px; margin: 8px 0; color: var(--ink); }
.guide-detail-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 16px; }
.guide-detail-cover { max-width: 100%; max-height: 340px; width: auto; object-fit: contain; border-radius: 10px; margin: 8px 0 16px; display: block; }
.guide-content { line-height: 1.75; font-size: 15px; color: var(--ink); }
.guide-content img { max-width: 100%; max-height: 500px; object-fit: contain; border-radius: 8px; }
.guide-content h3, .guide-content h4 { margin: 18px 0 8px; }
.guide-content ul, .guide-content ol { padding-left: 22px; }
.guide-content a { color: var(--primary); }

@media (max-width: 860px) {
  .guide-form-grid { grid-template-columns: 1fr; }
}

.link-muted { color: var(--ink-muted); text-decoration: none; font-size: 14px; }
.link-muted:hover { color: var(--primary); text-decoration: underline; }

.guide-attach-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.guide-attach-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.guide-attachments { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }

@media (max-width: 760px) {

  .report-lines-wrap { overflow-x: visible; }

  table.report-lines { min-width: 0; width: 100%; display: block; }
  table.report-lines thead { display: none; }
  table.report-lines tbody { display: block; }
  table.report-lines tr { display: block; }

table.report-lines tr.line-section td,
  table.report-lines tr.line-group td {
    display: block; width: 100%; white-space: normal;
    padding: 10px 12px; text-align: left;
  }
  table.report-lines tr.line-section { margin-top: 14px; }

table.report-lines tr.line-input {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 10px 0;
    padding: 10px 12px;
    background: var(--surface);
  }
  table.report-lines tr.line-input td {
    display: block; width: 100%;
    border: none; padding: 4px 0; white-space: normal; text-align: left;
  }

table.report-lines td.cell-code {
    font-weight: 700; color: var(--ink-muted); font-size: 12px; padding-bottom: 0;
  }
  table.report-lines td.cell-label {
    font-weight: 600; line-height: 1.45; padding-bottom: 8px;
  }

table.report-lines td.cell-plan::before,
  table.report-lines td.cell-result::before,
  table.report-lines td.cell-percent::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    color: var(--ink-muted);
    margin-bottom: 4px;
  }

  table.report-lines tr.line-input[data-has-plan="0"] td.cell-plan,
  table.report-lines tr.line-input[data-has-plan="0"] td.cell-percent { display: none; }

  table.report-lines td .js-number-input {
    width: 100%; min-width: 0; font-size: 16px;
    padding: 10px 12px; text-align: left;
  }
  table.report-lines td.cell-percent {
    font-weight: 700; color: var(--primary); text-align: left;
  }
}

.guide-content { overflow-wrap: break-word; word-wrap: break-word; }
.guide-content table {
  display: block; width: 100%; max-width: 100%;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
}
.guide-content table td, .guide-content table th {
  border: 1px solid var(--border); padding: 6px 10px;
}
.guide-content pre { white-space: pre-wrap; word-break: break-word; }
.guide-detail-title { overflow-wrap: break-word; }
.guide-attach-list li span { min-width: 0; overflow-wrap: break-word; }

@media (max-width: 760px) {
  .guide-detail-title { font-size: 21px; line-height: 1.3; }
  .guide-content { font-size: 15px; }
  .guide-content img { max-height: 320px; }
  .guide-detail-cover { max-height: 220px; }

.guide-attach-list li {
    flex-direction: column; align-items: stretch; gap: 8px;
  }
  .guide-attach-list li .action-group { justify-content: flex-start; }
  .guide-attach-list li .btn { flex: 1 1 auto; text-align: center; }

.guide-grid { grid-template-columns: 1fr; }

.guide-filter { flex-direction: column; align-items: stretch; }
  .guide-filter select, .guide-filter input { max-width: 100%; width: 100%; }
}

.guide-detail { max-width: 900px; padding: 28px 32px; }
.guide-detail .guide-detail-title { font-size: 27px; font-weight: 700; margin: 10px 0 6px; line-height: 1.3; }

.guide-content { font-size: 16px; line-height: 1.8; }
.guide-content p { margin: 0 0 14px; }
.guide-content h3 { font-size: 20px; font-weight: 700; margin: 26px 0 10px; }
.guide-content h4 { font-size: 17px; font-weight: 700; margin: 20px 0 8px; }
.guide-content li { margin-bottom: 6px; }
.guide-content img { display: block; margin: 16px auto; }
.guide-content blockquote {
  margin: 16px 0; padding: 10px 16px;
  border-left: 4px solid var(--primary); background: var(--bg-tint);
  color: var(--ink);
}
.guide-content table { margin: 16px 0; }
.guide-content table th { background: var(--bg-tint); font-weight: 700; text-align: left; }
.guide-content hr { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

.guide-attachments .card-title { font-size: 16px; margin-bottom: 10px; }
.guide-attach-list li { padding: 12px 14px; }
.guide-attach-list li .action-group { flex-shrink: 0; }

.guide-card-title {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.guide-card-summary {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 760px) {
  .guide-detail { padding: 16px 14px; }
  .guide-detail .guide-detail-title { font-size: 21px; }
  .guide-content { font-size: 15px; line-height: 1.75; }
  .guide-content h3 { font-size: 18px; margin: 20px 0 8px; }
  .guide-content h4 { font-size: 16px; }
  .guide-attach-list li { padding: 10px 12px; }
}

table.guide-manage-table { min-width: 0; width: 100%; table-layout: fixed; }
table.guide-manage-table td, table.guide-manage-table th { white-space: normal; }

table.guide-manage-table .col-title { width: auto; overflow-wrap: break-word; }
table.guide-manage-table th:nth-child(1), table.guide-manage-table td:nth-child(1) { width: 44px; }
table.guide-manage-table th:nth-child(3), table.guide-manage-table td:nth-child(3) { width: 120px; }
table.guide-manage-table th:nth-child(4), table.guide-manage-table td:nth-child(4) { width: 110px; }
table.guide-manage-table th:nth-child(5), table.guide-manage-table td:nth-child(5) { width: 130px; }
table.guide-manage-table th:nth-child(6), table.guide-manage-table td:nth-child(6) { width: 90px; }
table.guide-manage-table th:nth-child(7), table.guide-manage-table td:nth-child(7) { width: 130px; }

table.guide-manage-table .action-group { flex-wrap: nowrap; gap: 6px; justify-content: center; }

@media (max-width: 1100px) {
  table.guide-manage-table { table-layout: auto; min-width: 760px; }
}

.user-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.user-filter input[type="text"] { flex: 1 1 260px; min-width: 200px; }
.user-filter select { flex: 0 1 180px; min-width: 150px; }

@media (max-width: 760px) {
  .user-filter { flex-direction: column; align-items: stretch; }
  .user-filter input[type="text"], .user-filter select { width: 100%; flex: none; }
}

.reminder-modal { max-width: 560px; }
.reminder-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.reminder-icon { font-size: 26px; line-height: 1; }

.reminder-list { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; }
.reminder-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.reminder-list li.is-overdue { border-left: 4px solid var(--primary); background: #fdeceb; }
.reminder-list li.is-upcoming { border-left: 4px solid #E8A33D; background: #fdf7ec; }
.reminder-info { min-width: 0; }
.reminder-name { font-weight: 600; color: var(--ink); overflow-wrap: break-word; }
.reminder-meta { font-size: 13px; color: var(--ink-muted); margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .reminder-modal { max-width: 100%; }
  .reminder-list li { flex-direction: column; align-items: stretch; }
  .reminder-list li .btn { width: 100%; text-align: center; }
}

.profile-value {
  padding: 9px 12px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  min-height: 20px;
  overflow-wrap: break-word;
}
.profile-empty { color: var(--ink-muted); font-style: italic; }
