/* ===================================
   RMS - Risk Management System
   Korea Compliance Institute
   Global Styles - Responsive Version
=================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #00704A;
  --primary-dark: #005236;
  --primary-light: #D4EDDA;
  --secondary: #1E3932;
  --accent: #CBA258;
  --accent-light: #F5EDD3;
  --danger: #D93025;
  --danger-light: #FDECEA;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --info: #2563EB;
  --info-light: #EFF6FF;
  --success: #16A34A;
  --success-light: #F0FDF4;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --sidebar-width: 220px;
  --header-height: 56px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius-sm: 4px;
  --radius: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --mobile-bottom-nav-height: 60px;
}

/* ===================================
   LAYOUT
=================================== */

.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}


/* ===================================
   MOBILE MENU BUTTON
=================================== */

.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 16px;
  color: var(--gray-600);
  flex-shrink: 0;
  margin-right: 8px;
}

/* ===================================
   MAIN CONTENT
=================================== */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
  background: var(--gray-50);
  min-width: 0;
}

/* ===================================
   HEADER
=================================== */

.top-header {
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-500);
  min-width: 0;
}

.header-breadcrumb .breadcrumb-current {
  color: var(--gray-800);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-breadcrumb .sep {
  color: var(--gray-300);
  flex-shrink: 0;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.15s;
}

.header-btn.primary {
  background: var(--primary);
  color: #fff;
}

.header-btn.primary:hover {
  background: var(--primary-dark);
}

.header-btn.secondary {
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

.header-btn.secondary:hover {
  background: var(--gray-200);
}

.header-date {
  font-size: 11px;
  color: var(--gray-500);
  padding: 4px 10px;
  background: var(--gray-100);
  border-radius: var(--radius);
  white-space: nowrap;
}

.header-notif {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--gray-500);
  font-size: 16px;
  background: var(--gray-100);
  text-decoration: none;
  flex-shrink: 0;
}

.header-notif .badge {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #fff;
}

/* ===================================
   PAGE CONTENT
=================================== */

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.page-content::-webkit-scrollbar {
  width: 6px;
}

.page-content::-webkit-scrollbar-track {
  background: var(--gray-100);
}

.page-content::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

/* ===================================
   CARDS
=================================== */

.card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-title .title-icon {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.card-body {
  padding: 14px 16px;
}

/* ===================================
   KPI CARDS
=================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.kpi-card.danger::before { background: var(--danger); }
.kpi-card.warning::before { background: var(--warning); }
.kpi-card.success::before { background: var(--success); }
.kpi-card.info::before { background: var(--info); }
.kpi-card.primary::before { background: var(--primary); }

.kpi-label {
  font-size: 10px;
  color: var(--gray-500);
  font-weight: 500;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-value.danger { color: var(--danger); }
.kpi-value.warning { color: var(--warning); }
.kpi-value.success { color: var(--success); }
.kpi-value.info { color: var(--info); }
.kpi-value.primary { color: var(--primary); }

.kpi-sub {
  font-size: 10px;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-trend {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 10px;
}

.kpi-trend.up { background: var(--danger-light); color: var(--danger); }
.kpi-trend.down { background: var(--success-light); color: var(--success); }
.kpi-trend.flat { background: var(--gray-100); color: var(--gray-500); }

/* ===================================
   GRID LAYOUTS
=================================== */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

.grid-1-2 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
}

.grid-3-2 {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 12px;
}

/* ===================================
   TABLES
=================================== */

.table-scroll-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  background: var(--gray-50);
  padding: 8px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--gray-50);
}

/* ===================================
   BADGES / TAGS
=================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-critical { background: #FEE2E2; color: #991B1B; }
.badge-high { background: #FEE2E2; color: var(--danger); }
.badge-medium { background: var(--warning-light); color: #92400E; }
.badge-low { background: var(--success-light); color: #166534; }
.badge-info { background: var(--info-light); color: #1E40AF; }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

.badge-open { background: var(--info-light); color: #1D4ED8; }
.badge-progress { background: var(--warning-light); color: #B45309; }
.badge-closed { background: var(--success-light); color: #15803D; }
.badge-overdue { background: var(--danger-light); color: var(--danger); }

/* ===================================
   RISK MATRIX
=================================== */

.risk-matrix {
  display: grid;
  grid-template-columns: 24px repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr) 24px;
  gap: 2px;
  aspect-ratio: 1;
}

.matrix-cell {
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  cursor: pointer;
  transition: opacity 0.2s;
  position: relative;
}

.matrix-cell:hover { opacity: 0.85; }

.matrix-cell.low { background: #22C55E; }
.matrix-cell.medium { background: #F59E0B; }
.matrix-cell.high { background: #EF4444; }
.matrix-cell.critical { background: #991B1B; }
.matrix-cell.axis-label {
  background: transparent;
  color: var(--gray-500);
  font-size: 8px;
  font-weight: 400;
}

/* ===================================
   PROGRESS BAR
=================================== */

.progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }
.progress-fill.info { background: var(--info); }
.progress-fill.primary { background: var(--primary); }

/* ===================================
   BUTTONS
=================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-200); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #B91C1C; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

/* ===================================
   FORM ELEMENTS
=================================== */

.form-group {
  margin-bottom: 12px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--gray-800);
  background: #fff;
  transition: border-color 0.15s;
  font-family: inherit;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0,112,74,0.1);
}

select.form-control {
  cursor: pointer;
}

/* ===================================
   TABS
=================================== */

.tab-list {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tab-list::-webkit-scrollbar { display: none; }

.tab-item {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-item:hover { color: var(--primary); }

.tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ===================================
   ALERT / NOTICE
=================================== */

.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.alert-warning {
  background: var(--warning-light);
  border: 1px solid #FDE68A;
  color: #78350F;
}

.alert-danger {
  background: var(--danger-light);
  border: 1px solid #FECACA;
  color: #7F1D1D;
}

.alert-success {
  background: var(--success-light);
  border: 1px solid #BBF7D0;
  color: #14532D;
}

.alert-info {
  background: var(--info-light);
  border: 1px solid #BFDBFE;
  color: #1E3A8A;
}

/* ===================================
   SECTION DIVIDERS
=================================== */

.section-gap { margin-bottom: 12px; }

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-gap {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===================================
   TIMELINE
=================================== */

.timeline {
  position: relative;
  padding-left: 20px;
  margin:0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 0;
  width: 1px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  padding-bottom: 14px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--primary);
}

.timeline-item.warning::before { background: var(--warning); box-shadow: 0 0 0 1px var(--warning); }
.timeline-item.danger::before { background: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.timeline-item.gray::before { background: var(--gray-400); box-shadow: 0 0 0 1px var(--gray-300); }

.timeline-time {
  font-size: 10px;
  color: var(--gray-400);
  margin-bottom: 2px;
}

.timeline-content {
  font-size: 12px;
  color: var(--gray-700);
  line-height: 1.4;
}

/* ===================================
   DONUT CHART PLACEHOLDER
=================================== */

.donut-chart {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

/* ===================================
   RISK SCORE GAUGE
=================================== */

.gauge-container {
  text-align: center;
  padding: 8px 0;
}

.gauge-score {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}

.gauge-label {
  font-size: 10px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* ===================================
   MINI CHART BAR
=================================== */

.mini-bar {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 40px;
}

.mini-bar-item {
  flex: 1;
  border-radius: 2px 2px 0 0;
  transition: opacity 0.2s;
  cursor: pointer;
  min-width: 8px;
}

.mini-bar-item:hover { opacity: 0.8; }

/* ===================================
   SCROLL AREA
=================================== */

.scroll-area {
  overflow-y: auto;
  max-height: 200px;
}

.scroll-area::-webkit-scrollbar {
  width: 4px;
}

.scroll-area::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 2px;
}

/* ===================================
   LOGIN PAGE
=================================== */

.login-page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  background: var(--secondary);
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0D2B22 0%, #1E3932 40%, #2D5A40 100%);
}

.login-bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: repeating-linear-gradient(
    45deg,
    #fff 0,
    #fff 1px,
    transparent 0,
    transparent 50%
  );
  background-size: 30px 30px;
}

.login-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  position: relative;
  z-index: 1;
}

.login-brand {
  margin-bottom: 40px;
}

.login-brand .brand-icon {
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0,112,74,0.4);
}

.login-brand h1 {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.login-brand p {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-feature-item .feat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: rgba(0,112,74,0.25);
  border: 1px solid rgba(0,112,74,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.login-feature-item .feat-text {
  display: flex;
  flex-direction: column;
}

.login-feature-item .feat-text strong {
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
}

.login-feature-item .feat-text span {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

.login-right {
  width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255,255,255,0.97);
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.3);
}

.login-card h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.login-card .login-subtitle {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 28px;
}

.login-form .form-group {
  margin-bottom: 14px;
}

.login-form .form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 5px;
}

.login-form .form-control {
  padding: 10px 12px;
  font-size: 16px; /* iOS zoom prevention */
}

.login-form .form-input-icon {
  position: relative;
}

.login-form .form-input-icon .form-control {
  padding-left: 36px;
}

.login-form .form-input-icon .input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
}

.login-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: block;
  text-align: center;
  margin-top: 20px;
  transition: background 0.2s;
  font-family: inherit;
}

.login-btn:hover {
  background: var(--primary-dark);
}

.login-divider {
  text-align: center;
  margin: 16px 0;
  position: relative;
  font-size: 11px;
  color: var(--gray-400);
}

.login-divider::before, .login-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--gray-200);
}

.login-divider::before { left: 0; }
.login-divider::after { right: 0; }

.login-demo-accounts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.demo-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s;
  text-decoration: none;
}

.demo-account:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.demo-account .demo-role {
  font-weight: 600;
  color: var(--gray-700);
}

.demo-account .demo-dept {
  color: var(--gray-500);
}

.demo-account .demo-arrow {
  color: var(--gray-400);
  font-size: 12px;
}

.login-footer-text {
  text-align: center;
  margin-top: 20px;
  font-size: 10px;
  color: var(--gray-400);
}

.login-provider {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  z-index: 1;
}

.login-provider span {
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}

/* ===================================
   PAGE SPECIFIC - SECTION TITLE
=================================== */

.page-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-section-title::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--primary);
  border-radius: 2px;
}

/* ===================================
   STATUS INDICATORS
=================================== */

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.green { background: var(--success); }
.status-dot.yellow { background: var(--warning); }
.status-dot.red { background: var(--danger); }
.status-dot.gray { background: var(--gray-400); }
.status-dot.blue { background: var(--info); }

/* ===================================
   UTILITY CLASSES
=================================== */

.hide-mobile { display: block; }
.hide-tablet { display: block; }
.show-mobile { display: none; }

/* ===================================
   MOBILE BOTTOM NAVIGATION
=================================== */

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-bottom-nav-height);
  background: #fff;
  border-top: 1px solid var(--gray-200);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
  z-index: 150;
}

.mobile-bottom-nav ul {
  display: flex;
  height: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-bottom-nav li {
  flex: 1;
}

.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-decoration: none;
  color: var(--gray-500);
  font-size: 10px;
  gap: 3px;
  transition: color 0.15s;
}

.mobile-bottom-nav a i {
  font-size: 18px;
}

.mobile-bottom-nav a.active,
.mobile-bottom-nav a:hover {
  color: var(--primary);
}

/* 추가 */
.elevation-4 {background:#1E3932 !important;}

.sidebar-dark-primary .nav-sidebar>.nav-item>.nav-link.active, 
.sidebar-light-primary .nav-sidebar>.nav-item>.nav-link.active {background-color:#1E3932;}

[class*=sidebar-dark-] .nav-treeview>.nav-item>.nav-link.active, 
[class*=sidebar-dark-] .nav-treeview>.nav-item>.nav-link.active:focus, 
[class*=sidebar-dark-] .nav-treeview>.nav-item>.nav-link.active:hover {
    background: rgba(0,112,74,0.25);
    color: #fff;
    border-left-color: var(--primary);
    font-weight: 500;
}

[class*=sidebar-dark-] .nav-sidebar>.nav-item>.nav-link.active {
    box-shadow:none;
}

.nav-pills .nav-link {
    border-radius:0;
}

[class*=sidebar-dark-] .nav-sidebar>.nav-item.menu-open>.nav-link, 
[class*=sidebar-dark-] .nav-sidebar>.nav-item:hover>.nav-link, 
[class*=sidebar-dark-] .nav-sidebar>.nav-item>.nav-link:focus {background-color:#1E3932;}

.nav-item {
    font-size: 12px;
}

.nav-link-item {
  display: flex;
  align-items: center;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-weight: 400;
  cursor: pointer;
  position: relative;
}

.nav-sidebar .nav-treeview>.nav-item>.nav-link>.nav-icon {
    width:18px;
    font-size: 14px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.nav-item .nav-badge.warning {
  background: var(--warning);
  color: var(--gray-800);
}

.sidebar-logo {
  padding: 0 16px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-dark);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar-logo .logo-text span:first-child {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.sidebar-logo .logo-text span:last-child {
  font-size: 9px;
  color: rgba(255,255,255,0.5);
  font-weight: 300;
}

.sidebar-user {
    padding: 0 16px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #fff;
  font-weight: 600;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-info .user-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info .user-role {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
}

.main-header .nav-link {
    height:auto;
}

.main-footer {
    padding: 12px 16px;
    font-size: 9px;
    text-align: center;
    line-height: 1.5;
}

.content-wrapper {
    padding-top: 20px;
}

.risk-heatmap {
    display: grid;
    grid-template-columns: 28px repeat(5, 1fr);
    grid-template-rows: 24px repeat(5, 1fr);
    gap: 3px;
    height: 180px;
}

.hm-axis {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: var(--gray-500);
    font-weight: 500;
}

.hm-cell {
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    cursor: pointer;
    transition: transform 0.15s;
    position: relative;
}

.hm-cell:hover { transform: scale(1.08); z-index: 2; }
.hm-cell.c1 { background: #22C55E; }
.hm-cell.c2 { background: #84CC16; }
.hm-cell.c3 { background: #F59E0B; }
.hm-cell.c4 { background: #EF4444; }
.hm-cell.c5 { background: #991B1B; }
.hm-cell.empty { background: var(--gray-100); color: transparent; }

.risk-category-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}
.rcb-label { width: 90px; font-size: 11px; color: var(--gray-600); flex-shrink: 0; }
.rcb-bar { flex: 1; height: 8px; background: var(--gray-100); border-radius: 4px; overflow: hidden; }
.rcb-fill { height: 100%; border-radius: 4px; }
.rcb-count { width: 24px; font-size: 11px; font-weight: 600; text-align: right; }

.notice-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--gray-100);
}

.notice-item:last-child { border-bottom: none; }
.notice-dot {
    width: 6px; height: 6px; border-radius: 50%;
    flex-shrink: 0; margin-top: 5px;
}
.notice-text { font-size: 11px; color: var(--gray-700); line-height: 1.4; }
.notice-time { font-size: 10px; color: var(--gray-400); margin-top: 2px; }

.top5-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--gray-100);
}
.top5-item:last-child { border-bottom: none; }
.top5-rank {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--gray-200);
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    color: var(--gray-600);
    flex-shrink: 0;
}
.top5-rank.r1 { background: var(--danger); color: #fff; }
.top5-rank.r2 { background: #F97316; color: #fff; }
.top5-rank.r3 { background: var(--warning); color: #fff; }
.top5-name { flex: 1; font-size: 11px; color: var(--gray-700); }
.top5-score {
    font-size: 12px; font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

.dept-row {
    display: grid;
    grid-template-columns: 90px 1fr 40px 50px;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 11px;
}
.dept-row:last-child { border-bottom: none; }

.action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius);
    margin-bottom: 5px;
    border: 1px solid var(--gray-100);
    background: var(--gray-50);
    font-size: 11px;
}
.action-priority {
    width: 6px; height: 28px; border-radius: 3px; flex-shrink: 0;
}

.timeline>div {
    margin-bottom: 0;
    margin-right: 0;
}

.form-control {
    height:auto;
    line-height:normal;

}

.card-body::after, .card-footer::after, .card-header::after {
    display:none;
    clear:none;
}

.filter-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.filter-label { font-size: 11px; font-weight: 600; color: var(--gray-500); white-space: nowrap; }
.risk-level-indicator {
  display: flex; align-items: center; gap: 4px;
}
.risk-dot { width: 10px; height: 10px; border-radius: 50%; }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; display: none;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border-radius: var(--radius-lg);
  width: 580px; max-height: 700px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-close {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--gray-500);
  background: var(--gray-100); border: none; font-size: 14px;
}
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--gray-200);
  display: flex; justify-content: flex-end; gap: 8px;
  position: sticky; bottom: 0; background: #fff;
}
.risk-score-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 22px; border-radius: var(--radius);
  font-size: 11px; font-weight: 700;
}
tr.tr-selected { background: var(--primary-light) !important; }

.rcsa-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.rcsa-card:hover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,112,74,0.08); }
.rcsa-card.selected { border-color: var(--primary); background: var(--primary-light); }

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.1s;
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item:hover { background: var(--gray-50); }

.check-status {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
}
.check-status.pass { background: var(--success); color: #fff; }
.check-status.fail { background: var(--danger); color: #fff; }
.check-status.na { background: var(--gray-300); color: #fff; }
.check-status.pending { background: var(--gray-200); color: var(--gray-400); border: 2px dashed var(--gray-300); }

.score-ring {
  position: relative; width: 90px; height: 90px; margin: 0 auto;
}
.score-ring-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}

.dept-assess-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 12px;
}
.dept-assess-row:last-child { border-bottom: none; }

.law-card {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-md); padding: 14px;
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: flex-start; gap: 12px;
}
.law-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.law-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius); display: flex;
  align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.compliance-score {
  font-size: 28px; font-weight: 800; line-height: 1;
}
.obligation-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; gap: 10px;
}
.obligation-item:last-child { border-bottom: none; }
.obligation-item:hover { background: var(--gray-50); }

.issue-card {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-md); padding: 14px;
  margin-bottom: 8px; cursor: pointer;
  transition: all 0.15s; border-left: 4px solid transparent;
}
.issue-card:hover { box-shadow: var(--shadow-md); }
.issue-card.critical { border-left-color: #991B1B; }
.issue-card.high { border-left-color: var(--danger); }
.issue-card.medium { border-left-color: var(--warning); }
.issue-card.low { border-left-color: var(--success); }

.issue-detail-panel {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-md); height: 100%;
  display: flex; flex-direction: column;
}
.detail-section { padding: 14px; border-bottom: 1px solid var(--gray-100); }
.detail-section:last-child { border-bottom: none; }
.detail-label { font-size: 10px; font-weight: 600; color: var(--gray-400); margin-bottom: 3px; text-transform: uppercase; }
.detail-value { font-size: 12px; color: var(--gray-800); }

.report-card {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-md); padding: 14px;
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: flex-start; gap: 12px;
}
.report-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.report-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}

/* 시스템 설정 */
.setting-section { margin-bottom: 16px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--gray-100);
  font-size: 12px;
}
.setting-row:last-child { border-bottom: none; }
.setting-label { font-weight: 600; color: var(--gray-700); }
.setting-desc { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.toggle-switch {
  position: relative; width: 44px; height: 24px; cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--gray-300); border-radius: 12px; transition: 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.xroll .img_xroll {display:none;}

.flex-d-ini {flex-direction:initial;}


/* ===================================
   PC WIDE: 1441px ~ 1920px
=================================== */

@media (min-width: 1441px) {
  :root {
    --sidebar-width: 240px;
  }

  .kpi-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .page-content {
    padding: 20px 28px;
  }
}

/* ===================================
   PC BASIC: 1025px ~ 1440px
   (default styles apply here)
=================================== */

/* ===================================
   TABLET: 769px ~ 1024px
=================================== */

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 200px;
  }

  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .grid-2-1 {
    grid-template-columns: 1fr;
  }

  .grid-1-2 {
    grid-template-columns: 1fr;
  }

  .grid-3-2 {
    grid-template-columns: 1fr;
  }

  .hide-tablet {
    display: none !important;
  }

  .page-content {
    padding: 12px 16px;
  }

  .db-row1 { grid-template-columns: 1fr 1fr !important; }

  .tbl-wrap.xroll {
    position:relative; 
    overflow-x:auto;
  }
  
  .xroll .img_xroll {
    display:inline-block; 
    position:absolute;
    top:30px;
    left:50%; 
    width:60px; 
    margin-left:-30px;
  }

  .tbl-sty2-1 {
    width:1200px !important;
  }

}

/* ===================================
   MOBILE: up to 768px
=================================== */

@media (max-width: 768px) {
  :root {
    --sidebar-width: 260px;
  }

  /* Sidebar becomes overlay on mobile */
  .sidebar {
    position: static;
    transform: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  /* Show mobile menu button */
  .mobile-menu-btn {
    display: flex;
  }

  /* Show mobile bottom nav */
  .mobile-bottom-nav {
    display: block;
  }

  /* Add bottom padding for mobile nav */
  .page-content {
    padding: 10px 12px;
    padding-bottom: calc(var(--mobile-bottom-nav-height) + 10px);
  }

  .main-content {
    width: 100%;
  }

  /* KPI grid: 2 columns on mobile */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* Grids collapse to single column */
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-2-1 {
    grid-template-columns: 1fr;
  }

  .grid-1-2 {
    grid-template-columns: 1fr;
  }

  .grid-3-2 {
    grid-template-columns: 1fr;
  }

  /* Hide/show utilities */
  .hide-mobile {
    display: none !important;
  }

  .show-mobile {
    display: block !important;
  }

  /* Mobile input font size (prevent iOS zoom) */
  input.form-control,
  select.form-control,
  textarea.form-control {
    font-size: 16px;
  }

  /* Modal mobile sizing */
  .modal-content {
    width: 95vw !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    margin: 5vh auto !important;
  }

  /* Header adjustments */
  .top-header {
    padding: 0 12px;
  }

  .header-date {
    display: none;
  }

  .header-breadcrumb .breadcrumb-parent {
    display: none;
  }

  .header-breadcrumb .sep {
    display: none;
  }

  /* KPI values smaller on mobile */
  .kpi-value {
    font-size: 18px;
  }

  /* Login page stacks vertically */
  .login-page {
    flex-direction: column;
  }

  .login-left {
    padding: 32px 24px;
    flex: none;
  }

  .login-brand h1 {
    font-size: 22px;
  }

  .login-features {
    display: none;
  }

  .login-right {
    width: 100%;
    padding: 20px 16px 40px;
    flex: 1;
  }

  .login-card {
    padding: 24px 20px;
  }

  /* Buttons full width on mobile forms */
  .btn-block-mobile {
    width: 100%;
    justify-content: center;
  }

  /* Tabs scrollable */
  .tab-list {
    overflow-x: auto;
  }

    /* 추가 */
    .content-wrapper {
        padding: 20px 28px;
        padding-bottom:calc(var(--mobile-bottom-nav-height) + 10px);
    }

    .db-row1 { grid-template-columns: 1fr !important; }
    
    .db-row1,
    .db-row2,
    .db-row3 {
        display:block !important;
    }

    .content-wrapper>.content {padding:0;}

    .col, .col-1, .col-10, .col-11, .col-12, .col-2, .col-3, 
    .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-auto, 
    .col-lg, .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, 
    .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, 
    .col-lg-8, .col-lg-9, .col-lg-auto, .col-md, .col-md-1, .col-md-10, 
    .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, 
    .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-auto, .col-sm, 
    .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, 
    .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, 
    .col-sm-auto, .col-xl, .col-xl-1, .col-xl-10, .col-xl-11, .col-xl-12, 
    .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, 
    .col-xl-8, .col-xl-9, .col-xl-auto {
        padding-right:0;
        padding-left:0;
    }

    .container-fluid {
        padding-right:0;
        padding-left:0;
    }


    .compli-box {
        display:block !important;
    }

    .general-box {
      display:block !important;
    }

    .tbl-sty13-1 {
      width:700px;
    }

    /* 보고서 */
    .report-card {margin-top:15px;}
    .report-card:first-child {margin-top:0;}

    .tbl-sty11-1 {
      width:900px;
    }

    /* 법규 준수 관리 */
    .grid-auto {
      margin-top:15px;
      grid-template-columns:auto auto !important;
    }

    .grid-auto2 {
      grid-template-columns:auto auto !important;
    }

    .grid-auto3 {
      display:grid;
      grid-template-columns:auto auto;
    }

    .mw-100 {width:100% !important;}


}

/* ===================================
   VERY SMALL MOBILE: up to 390px
=================================== */

@media (max-width: 390px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .kpi-value {
    font-size: 16px;
  }

  .kpi-label {
    font-size: 9px;
  }

  .page-content {
    padding: 8px 10px;
    padding-bottom: calc(var(--mobile-bottom-nav-height) + 8px);
  }

  .top-header {
    padding: 0 10px;
    gap: 8px;
  }
}

/* ===================================
   COMMON SIDEBAR JS HELPERS
=================================== */

/* Prevent body scroll when sidebar open */
body.sidebar-open {
  overflow: hidden;
}








































