/* =========================================================
   韩国医药数据情报系统 (KPIS) 经典商业智能 (BI) 样式表
   深度复刻高端 SaaS / BI 大屏交互视觉体系
   ========================================================= */

:root {
  --primary-blue: #1D64EC;
  --primary-hover: #1551C6;
  --primary-dark: #0F3BA0;
  --primary-gradient: linear-gradient(135deg, #184BB4 0%, #2563EB 50%, #3B82F6 100%);
  --bg-main: #F4F6F9;
  --bg-card: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border-color: #E2E8F0;
  --success-color: #10B981;
  --danger-color: #EF4444;
  --warning-color: #F59E0B;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* =========================================================
   顶部高质感蓝色品牌导航栏 (Top Navbar) - 防溢出设计
   ========================================================= */
.top-navbar {
  background: var(--primary-gradient);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(29, 100, 236, 0.2);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-logo-icon {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-sub {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.18);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

/* 导航 Tabs 紧凑自适应 */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin-left: 12px;
  flex-shrink: 1;
  overflow-x: auto;
}

.nav-tab-item {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-tab-item:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

.nav-tab-item.active {
  background: #FFFFFF;
  color: var(--primary-blue);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* 右侧工具栏 - 坚固不被挤压 */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-search-box {
  position: relative;
  width: 160px;
  transition: width 0.2s ease;
}

.nav-search-box input {
  width: 100%;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 20px;
  color: #FFFFFF;
  font-size: 12px;
  outline: none;
  transition: all 0.2s;
}

.nav-search-box input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.nav-search-box input:focus {
  background: #FFFFFF;
  color: var(--text-main);
  border-color: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
}

.nav-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
}

.date-badge {
  background: rgba(0, 0, 0, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* =========================================================
   系统主工作区网格布局 (Main App Layout)
   ========================================================= */
.app-container {
  display: flex;
  min-height: calc(100vh - 56px);
  width: 100%;
}

/* 左侧栏 */
.sidebar {
  width: 250px;
  background: #FFFFFF;
  border-right: 1px solid var(--border-color);
  padding: 16px 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.sidebar-status-box {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  color: #065F46;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
}

.quick-converter {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.quick-converter input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 8px;
  outline: none;
}

.quick-result-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.6;
}

.sidebar-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding: 3px 0;
}

.sidebar-stat-row b {
  color: var(--text-main);
}

/* 主内容展示区 */
.main-content {
  flex: 1;
  padding: 16px 20px;
  overflow-x: hidden;
  max-width: calc(100vw - 250px);
}

/* =========================================================
   BI 卡片与大屏组件
   ========================================================= */
.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.panel-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* 顶部查询过滤器 */
.filter-grid {
  display: grid;
  grid-template-columns: 2fr 1.3fr 1.3fr 1fr 100px;
  gap: 10px;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
}

.form-control {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-main);
  background: #FFFFFF;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(29, 100, 236, 0.1);
}

.btn-primary {
  background: var(--primary-blue);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  height: 33px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

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

.btn-secondary {
  background: #F1F5F9;
  color: #334155;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #E2E8F0;
}

/* 顶部 KPI 统计行 */
.kpi-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-gradient-card {
  background: var(--primary-gradient);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kpi-gradient-label {
  font-size: 11px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: 0.02em;
}

.kpi-gradient-val {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  margin: 3px 0 1px 0;
}

.kpi-gradient-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
}

.kpi-white-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.kpi-white-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-white-val {
  font-size: 20px;
  font-weight: 700;
  margin: 2px 0 1px 0;
}

.kpi-white-sub {
  font-size: 11px;
  color: var(--text-light);
}

/* 智能解析横幅 */
.resolve-banner {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-left: 4px solid var(--primary-blue);
  padding: 9px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px;
  color: #1E3A8A;
  margin-bottom: 14px;
}

/* =========================================================
   中间图表双栏区域 (Donut + Country Bar)
   ========================================================= */
.bi-charts-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 16px;
  margin-bottom: 16px;
}

.chart-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.chart-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.country-select-pill {
  padding: 3px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 12px;
  outline: none;
  background: #FFFFFF;
  color: var(--text-main);
  font-weight: 600;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 260px;
}

/* =========================================================
   数据表格与明细列表 (Data Table)
   ========================================================= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
  background: #FFFFFF;
}

.data-table th {
  background: #F8FAFC;
  color: #475569;
  font-weight: 600;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #F1F5F9;
  color: #1E293B;
  vertical-align: middle;
}

.data-table tr:hover {
  background: #F8FAFC;
}

.status-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.status-tag.active {
  background: #ECFDF5;
  color: #059669;
}

.status-tag.inactive {
  background: #FEF2F2;
  color: #DC2626;
}

.status-tag.cmo {
  background: #EFF6FF;
  color: #1E40AF;
}

/* =========================================================
   庄严、简洁、大字体、高端企业级登录界面
   ========================================================= */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, #1E293B 0%, #0F172A 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.login-solemn-box {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  padding: 48px 42px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  text-align: center;
  color: #FFFFFF;
}

.login-emblem {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px auto;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.login-title-solemn {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.login-sub-solemn {
  font-size: 13px;
  color: #94A3B8;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.login-badge-security {
  display: inline-block;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93C5FD;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 32px;
}

.login-form-solemn {
  text-align: left;
}

.login-label-solemn {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #E2E8F0;
  margin-bottom: 8px;
}

.login-input-solemn {
  width: 100%;
  height: 52px;
  padding: 0 18px;
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #FFFFFF;
  font-size: 18px;
  letter-spacing: 2px;
  outline: none;
  transition: all 0.2s ease;
  margin-bottom: 10px;
}

.login-input-solemn::placeholder {
  color: #64748B;
  letter-spacing: 0;
  font-size: 14px;
}

.login-input-solemn:focus {
  border-color: #3B82F6;
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.btn-login-solemn {
  width: 100%;
  height: 50px;
  background: #2563EB;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-login-solemn:hover {
  background: #1D4ED8;
  transform: translateY(-1px);
}

.login-error-msg {
  color: #F87171;
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
  display: none;
  font-weight: 500;
}

.login-footer-solemn {
  margin-top: 28px;
  font-size: 12px;
  color: #64748B;
}
