:root {
  --primary: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #0284c7;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.header-brand h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

.header-brand .subtitle {
  font-size: 0.825rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Global Service Navigation Bar */
.service-nav-bar {
  background: #ffffff;
  border-bottom: 2px solid var(--border);
  display: flex;
  padding: 0 2rem;
  gap: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.nav-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.nav-tab-item:hover {
  color: var(--primary);
}

.nav-tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

.nav-tab-item.active-pension {
  color: #059669;
  border-bottom-color: #059669;
  font-weight: 700;
}

.nav-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}

.nav-tab-item.active .nav-num {
  background: #eff6ff;
  color: var(--primary);
}

.nav-tab-item.active-pension .nav-num {
  background: #ecfdf5;
  color: #059669;
}

/* Green theme accents for pension page */
.sector-tab-btn.active-green {
  background: #059669 !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

/* Service Outage / Maintenance Warning Banner */
.portal-outage-banner {
  background: #fff1f2;
  border: 2px solid #fecdd3;
  border-left: 6px solid #e11d48;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.outage-icon {
  width: 44px;
  height: 44px;
  background: #ffe4e6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e11d48;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.outage-content h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #9f1239;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.outage-content p {
  font-size: 0.875rem;
  color: #4c0519;
  line-height: 1.6;
  margin-top: 0.35rem;
}

.outage-details {
  background: #ffffff;
  border: 1px dashed #fda4af;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.825rem;
  color: #881337;
  line-height: 1.6;
}

/* Main Area */
.app-main {
  flex: 1;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-sm);
}

.card-header {
  margin-bottom: 1.25rem;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.tag-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.live-badge {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  transition: all 0.3s;
}

.card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* RFP Config Card */
.rfp-config-card {
  border-left: 5px solid var(--primary);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.preset-controls {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

.preset-dropdown {
  min-width: 250px;
  font-weight: 600;
  border-color: #93c5fd;
  color: #1e3a8a;
}

.rfp-table-box {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 1rem;
}

.rfp-table-header {
  background: #f1f5f9;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #cbd5e1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rfp-table-header strong {
  color: #1e293b;
  font-size: 0.95rem;
}

.note-text {
  font-size: 0.8rem;
  color: #64748b;
}

.rfp-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-save {
  background-color: #16a34a;
  color: #ffffff;
}

.btn-save:hover {
  background-color: #15803d;
}

/* RFP Document (HWP / PDF) Attachment & Extraction Panel Styles */
.rfp-doc-attach-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border: 1.5px dashed #60a5fa;
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
}

.rfp-doc-attach-bar.drag-over {
  background: #dbeafe;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.rfp-attach-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.rfp-attach-icon {
  font-size: 1.75rem;
  background: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.1);
  border: 1px solid #bfdbfe;
}

.rfp-attach-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.badge-format {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: #1e40af;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.rfp-attach-desc {
  font-size: 0.82rem;
  color: #475569;
  margin-top: 0.2rem;
}

.rfp-attach-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rfp-extracted-panel {
  background: #ffffff;
  border: 2px solid #3b82f6;
  border-radius: var(--radius-md);
  margin-bottom: 1.15rem;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(30, 64, 175, 0.08);
  animation: fadeInDown 0.25s ease-out;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.rfp-extracted-header {
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.rfp-extracted-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: #1e3a8a;
}

.extracted-status-badge {
  background: #16a34a;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.extracted-file-name {
  font-size: 0.8rem;
  color: #64748b;
}

.rfp-extracted-header-btns {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.rfp-extracted-body {
  padding: 1rem 1.25rem;
}

.rfp-extracted-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.extracted-meta-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
}

.extracted-meta-card .meta-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 0.25rem;
}

.extracted-meta-card .meta-value {
  font-size: 0.86rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.45;
}

.extracted-qual-note {
  background: #fefce8;
  border: 1px solid #fde047;
  color: #854d0e;
  font-size: 0.82rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
}

.extracted-table-wrapper {
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.extracted-table-caption {
  background: #f1f5f9;
  padding: 0.5rem 0.9rem;
  font-size: 0.82rem;
  color: #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #cbd5e1;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.extracted-auto-notice {
  font-size: 0.78rem;
  font-weight: 700;
  color: #15803d;
}

.extracted-tier-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 0.88rem;
}

.extracted-tier-table th {
  background: #f8fafc;
  color: #1e3a8a;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #cbd5e1;
}

.extracted-tier-table td {
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
  padding: 0.6rem 0.75rem;
  border-right: 1px solid #e2e8f0;
}

.extracted-tier-table th:last-child,
.extracted-tier-table td:last-child {
  border-right: none;
}

.rfp-grid-table {
  display: flex;
  flex-direction: column;
}

.grid-row {
  display: grid;
  grid-template-columns: 180px repeat(5, 1fr);
  text-align: center;
}

.grid-head {
  background: #f8fafc;
  font-weight: 700;
  font-size: 0.9rem;
  color: #334155;
  border-bottom: 1px solid #cbd5e1;
}

.grid-cell {
  padding: 0.75rem 1rem;
  border-right: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-cell:last-child {
  border-right: none;
}

.col-label {
  background: #f1f5f9;
  font-weight: 700;
  color: #1e3a8a;
  justify-content: center;
  text-align: center;
  padding: 0.75rem 1rem;
}

.grid-inputs {
  background: #ffffff;
}

.score-input {
  width: 90px;
  padding: 0.45rem 0.6rem;
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
  color: #1e40af;
  border: 2px solid #93c5fd;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  transition: all 0.2s;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.score-input:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  background: #ffffff;
}

.sub-criteria-summary {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.sub-criteria-pill {
  flex: 1;
  min-width: 300px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #475569;
}

.sub-criteria-pill strong {
  color: #1e3a8a;
}

/* Upload Banner */
.upload-banner {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1px dashed #93c5fd;
}

.upload-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.upload-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e3a8a;
}

.upload-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  max-width: 800px;
}

.upload-controls {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.stat-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #334155;
  text-align: center;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0.35rem 0;
  text-align: center;
}

.stat-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* Sector Tabs */
.sector-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.sector-tab-btn {
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
}

.sector-tab-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.sector-tab-btn.active {
  background: #1e40af;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.2);
}

/* Filter Controls & Column Config Dropdown */
.filter-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  position: relative;
}

.col-config-wrapper {
  position: relative;
}

.col-config-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 330px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
  z-index: 200;
  display: none;
}

.col-config-dropdown.show {
  display: block;
}

.col-config-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.col-config-head-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

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

.col-checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
  max-height: 280px;
  overflow-y: auto;
}

.col-check-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.825rem;
  color: #334155;
  cursor: pointer;
}

.col-check-item input {
  cursor: pointer;
  accent-color: var(--primary);
}

/* Sortable Table Headers */
.th-sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s;
  position: relative;
}

.th-sortable:hover {
  background-color: #e2e8f0 !important;
}

.sort-icon {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

.sort-icon.active {
  color: #1e40af;
  font-weight: bold;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease-in-out;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border-color: #bfdbfe;
}

.btn-outline:hover {
  background-color: var(--primary-light);
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.table th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-align: center;
}

.table td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: #1e293b;
  text-align: center;
}

.table tbody tr:hover {
  background-color: #f8fafc;
}

/* IBK Highlight styling across all tables & reports (Requested: Yellow Highlight) */
.row-ibk-highlight {
  background: #fef08a !important; /* Soft bright yellow */
  border-left: 5px solid #eab308 !important; /* Golden yellow accent border */
  font-weight: 700 !important;
}

.row-ibk-highlight td {
  background-color: transparent !important;
  color: #854d0e !important; /* Dark warm brown-gold for high contrast & elegance */
}

.table tbody tr.row-ibk-highlight:hover {
  background: #fde047 !important; /* Slightly richer yellow on hover */
}

.ibk-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #ca8a04;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-left: 0.45rem;
  vertical-align: middle;
  box-shadow: 0 1px 3px rgba(202, 138, 4, 0.3);
}

.col-highlight {
  background-color: #eff6ff !important;
  color: #1e40af !important;
  font-weight: 700;
}

.col-score {
  font-weight: 800;
  color: #1e40af;
  font-size: 1rem;
  text-align: right;
}

/* Badges for Ratings */
.badge-grade {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.grade-aaa { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.grade-aaplus { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.grade-aa { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.grade-aaminus { background: #fdf2f8; color: #9d174d; border: 1px solid #fbcfe8; }
.grade-aplus { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* Rank Pills */
.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.8rem;
}

.rank-top1 { background: #fef08a; color: #854d0e; border: 1px solid #fde047; }
.rank-top2 { background: #e2e8f0; color: #334155; }
.rank-other { background: #f1f5f9; color: #64748b; }

.search-input, .select-input {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  outline: none;
}

.chart-container {
  margin: 1.25rem 0;
  background: #fafafa;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid var(--border);
  height: 380px;
  position: relative;
}

/* REPORT MODAL & PRINT STYLES */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.report-modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1080px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  gap: 1rem;
  flex-wrap: wrap;
}

.modal-title-area h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e3a8a;
}

.modal-title-area p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.modal-actions-top {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.report-select {
  min-width: 320px;
  font-weight: 600;
}

.report-preview-body {
  padding: 2rem;
  overflow-y: auto;
  background: #f1f5f9;
}

/* Formal Report Paper Design */
.report-document {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: var(--shadow-md);
  padding: 2.25rem;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  border-radius: 4px;
  color: #1e293b;
  font-family: 'Pretendard', sans-serif;
  box-sizing: border-box;
}

.report-header {
  text-align: center;
  border-bottom: 2px solid #1e3a8a;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.report-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e3a8a;
}

.report-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 0.5rem;
}

.approval-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 2px solid #1e3a8a;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.report-title-left h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e3a8a;
}

.approval-table {
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: center;
}

.approval-table th, .approval-table td {
  border: 1px solid #475569;
  padding: 0.35rem;
}

.approval-table th {
  background: #f8fafc;
}

.report-summary-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 0.85rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.6;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.report-sec-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e40af;
  margin: 1.25rem 0 0.5rem 0;
  border-left: 3px solid #1e40af;
  padding-left: 0.5rem;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
  table-layout: auto;
}

.report-table th, .report-table td {
  border: 1px solid #cbd5e1;
  padding: 0.45rem 0.6rem;
  white-space: nowrap !important;
  word-break: keep-all !important;
  vertical-align: middle;
  text-align: center;
}

.report-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: #334155;
  text-align: center;
  font-size: 0.82rem;
}

.mt-2 { margin-top: 0.75rem; }

/* ========================================================= */
/* CRITICAL FIX: PERFECT CLEAN PRINT STYLES WITH TOP BINDING MARGIN */
/* ========================================================= */
@page {
  size: A4 portrait;
  /* 상부 철(스태플러, 바인더 펀칭 결재용)을 위해 상단 35mm 여백 확보 */
  margin-top: 35mm;
  margin-bottom: 20mm;
  margin-left: 20mm;
  margin-right: 20mm;
}

@media print {
  /* 1. 뒷배경 대시보드 화면 및 헤더/푸터 완벽히 숨김 (겹침 버그 100% 차단) */
  .app-layout {
    display: none !important;
  }
  .app-header, .app-main, .app-footer, .card, .table-responsive {
    display: none !important;
  }

  /* 2. 모달 다이얼로그의 배경 오버레이 및 닫기 버튼 숨김 */
  .modal-header, .modal-actions-top {
    display: none !important;
  }

  /* 3. 모달 백드롭 및 프리뷰 영역만 순수 도큐먼트로 인쇄 */
  body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .modal-backdrop {
    position: static !important;
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    backdrop-filter: none !important;
  }

  .report-modal-dialog {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .report-preview-body {
    padding: 0 !important;
    background: #ffffff !important;
    overflow: visible !important;
  }

  .report-document {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* 결재란 및 테이블 헤더 페이지 넘김 시 깨짐 방지 */
  .approval-header-row, .report-summary-box, tr {
    page-break-inside: avoid;
  }

  .report-table th, .report-table td {
    white-space: nowrap !important;
    word-break: keep-all !important;
    padding: 0.45rem 0.55rem !important;
    font-size: 0.8rem !important;
    text-align: center;
  }

  .report-table th {
    background-color: #f1f5f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: #ffffff;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Page 3: Pension Fee Calculator & Ranking Styles (Indigo / Purple Accents)
   ========================================================================== */

.nav-tab-item.active-fee {
  color: #7c3aed;
  border-bottom-color: #7c3aed;
  font-weight: 700;
}

.nav-tab-item.active-fee .nav-num {
  background: #f5f3ff;
  color: #7c3aed;
}

.fee-calc-hero {
  background: linear-gradient(135deg, #f8fafc 0%, #f5f3ff 100%);
  border: 1px solid #e0e7ff;
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.fee-input-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.fee-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fee-input-group label {
  font-weight: 700;
  color: #1e293b;
  font-size: 0.95rem;
}

.reserve-input-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.reserve-input-wrapper input {
  width: 140px;
  padding: 0.6rem 2.5rem 0.6rem 0.85rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e1b4b;
  text-align: right;
  border: 2px solid #7c3aed;
  border-radius: var(--radius-sm);
  outline: none;
  background: #faf5ff;
}

.reserve-input-wrapper input:focus {
  border-color: #6d28d9;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.unit-tag {
  position: absolute;
  right: 0.75rem;
  font-weight: 700;
  color: #7c3aed;
  font-size: 0.95rem;
}

.quick-amount-btns {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-chip {
  padding: 0.4rem 0.75rem;
  font-size: 0.825rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-chip:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.btn-chip.active {
  background: #7c3aed;
  color: #ffffff;
  border-color: #7c3aed;
}

.fee-mode-selector {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
}

.fee-mode-btn {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #475569;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fee-mode-btn.active {
  background: #ffffff;
  color: #7c3aed;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calc-rule-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.calc-rule-checha {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.calc-rule-danil {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.fee-amount-cell {
  font-weight: 700;
  color: #0f172a;
  font-family: 'SF Mono', Consolas, monospace;
}

.fee-rate-cell {
  color: #4338ca;
  font-weight: 700;
}

.diff-checha-info {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 2px;
}

.tier-breakdown-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.tier-breakdown-modal.hidden {
  display: none;
}

.tier-modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 96%;
  max-width: 1220px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.tier-modal-header {
  padding: 1.15rem 1.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.tier-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.tier-modal-body {
  padding: 1.35rem 1.75rem;
  overflow-x: auto;
}

/* 계산내역 팝업 내부 표: 완벽한 가운데 정렬 및 줄바꿈 방지 */
.modal-clean-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  border: 1px solid #cbd5e1;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
}

.modal-clean-table th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 700;
  padding: 0.55rem 0.65rem;
  border: 1px solid #cbd5e1;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}

.modal-clean-table td {
  padding: 0.55rem 0.65rem;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}


.formula-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  line-height: 1.6;
}

.formula-card code {
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  color: #1e293b;
}

.sector-tab-btn.active-purple {
  background: #7c3aed !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}

/* Ensure strict center alignment and unified typography for pension fee table */
.table th.text-center,
.table td.text-center {
  text-align: center !important;
  vertical-align: middle !important;
}

/* 통일된 폰트 크기, 글꼴, 진하기 적용 (1페이지, 2페이지, 3페이지 전체 통일) */
#rankingTableBody td,
#reservesTableBody td,
#feeTableBody td {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 0.875rem !important;
  font-weight: 400 !important;
  color: #1e293b !important;
  text-align: center !important;
  vertical-align: middle !important;
  padding: 0.65rem 0.45rem !important;
  line-height: 1.4 !important;
}

#feeTableBody td [data-formula],
#feeTableBody td[data-formula] {
  cursor: default !important;
}

/* 계산 버튼 줄바꿈 방지 및 통일된 크기 */
#feeTableBody .btnViewBreakdown {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 0.8125rem !important;
  font-weight: 500 !important;
  padding: 3px 10px !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  border-radius: 4px !important;
  display: inline-block !important;
}

/* 마우스 호버 시 ? 없이 즉시 뜨는 계산식 툴팁 */
.global-calc-tooltip {
  position: fixed;
  z-index: 99999;
  background: #0f172a;
  color: #f8fafc;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* 스크롤을 내려도 테이블 헤더가 화면 상단에 깔끔한 격자로 고정되도록 설정 (1·2·3페이지 공통) */
.sticky-fee-table-wrap {
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
}

.sticky-fee-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  width: 100%;
}

.sticky-fee-table thead th {
  position: sticky;
  z-index: 30;
  background-color: #f1f5f9 !important;
  color: #1e293b !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  border-right: 1px solid #cbd5e1 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  border-left: none !important;
  border-top: none !important;
  box-sizing: border-box !important;
  text-align: center !important;
}

.sticky-fee-table thead tr.fee-thead-row1 th:last-child,
.sticky-fee-table tbody td:last-child {
  border-right: none !important;
}

.sticky-fee-table thead tr.fee-thead-row1 th {
  top: 0;
  height: 38px;
  padding: 0.45rem 0.5rem !important;
}

/* 1단 헤더(1페이지, 2페이지) 하단 굵은 구분선 및 높이 통일 */
.sticky-fee-table thead tr.fee-thead-row1:only-child th {
  height: 44px;
  padding: 0.55rem 0.5rem !important;
  border-bottom: 2px solid #94a3b8 !important;
}

.sticky-fee-table thead tr.fee-thead-row1 th[rowspan="2"] {
  height: 74px;
  z-index: 32;
  border-bottom: 2px solid #94a3b8 !important;
}

.sticky-fee-table thead tr.fee-thead-row2 th {
  top: 38px;
  height: 36px;
  padding: 0.35rem 0.5rem !important;
  z-index: 31;
  background-color: #f8fafc !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  color: #475569 !important;
  border-bottom: 2px solid #94a3b8 !important;
}

.sticky-fee-table tbody td {
  border-right: 1px solid #e2e8f0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

/* IBK기업은행 행 전체 하이라이트 강조 (1·2·3페이지 전체 통일) */
#rankingTableBody tr.highlight-ibk-row,
#reservesTableBody tr.highlight-ibk-row,
#feeTableBody tr.highlight-ibk-row,
tr.highlight-ibk-row {
  background-color: #dbeafe !important;
}

#rankingTableBody tr.highlight-ibk-row td,
#reservesTableBody tr.highlight-ibk-row td,
#feeTableBody tr.highlight-ibk-row td,
tr.highlight-ibk-row td {
  background-color: #eff6ff !important;
  color: #1e3a8a !important;
  font-weight: 700 !important;
  border-top: 2px solid #3b82f6 !important;
  border-bottom: 2px solid #3b82f6 !important;
}

#rankingTableBody tr.highlight-ibk-row td:first-child,
#reservesTableBody tr.highlight-ibk-row td:first-child,
#feeTableBody tr.highlight-ibk-row td:first-child,
tr.highlight-ibk-row td:first-child {
  border-left: 4px solid #1d4ed8 !important;
}

#rankingTableBody tr.highlight-ibk-row td:last-child,
#reservesTableBody tr.highlight-ibk-row td:last-child,
#feeTableBody tr.highlight-ibk-row td:last-child,
tr.highlight-ibk-row td:last-child {
  border-right: 2px solid #3b82f6 !important;
}

#rankingTableBody tr.highlight-ibk-row:hover td,
#reservesTableBody tr.highlight-ibk-row:hover td,
#feeTableBody tr.highlight-ibk-row:hover td,
tr.highlight-ibk-row:hover td {
  background-color: #dbeafe !important;
}

#rankingTableBody tr.highlight-ibk-row .rank-badge,
#reservesTableBody tr.highlight-ibk-row .rank-badge,
#feeTableBody tr.highlight-ibk-row .rank-badge {
  background-color: #1d4ed8 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(29, 78, 216, 0.3);
}

#feeTableBody tr.highlight-ibk-row .btnViewBreakdown {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border-color: #1d4ed8 !important;
  font-weight: 700 !important;
}

.hidden {
  display: none !important;
}

