.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 40px;
  padding: 36px 0 56px;
  animation: fadeUp .4s ease both;
}

.section {
  margin-bottom: 36px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.section:last-child { margin-bottom: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-head h2 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.section-head .meta {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.section-head .link {
  font-size: 12px;
  color: var(--muted);
}
.section-head .link:hover { color: var(--primary); }

/* Stock table */
.stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.stock-table th {
  text-align: left;
  font-weight: 600;
  color: #94a3b8;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
}
.stock-table th:nth-child(3),
.stock-table th:nth-child(4),
.stock-table th:nth-child(5),
.stock-table th:nth-child(6),
.stock-table td:nth-child(3),
.stock-table td:nth-child(4),
.stock-table td:nth-child(5),
.stock-table td:nth-child(6) {
  text-align: right;
}
.stock-table td {
  padding: 14px 8px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.stock-table tbody tr {
  transition: background .15s ease;
}
.stock-table tbody tr:hover {
  background: #f8fafc;
}
.stock-table tbody tr:last-child td {
  border-bottom: none;
}
.stock-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.stock-logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  background: #64748b;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.rank {
  color: #cbd5e1;
  width: 22px;
  font-weight: 700;
  font-size: 13px;
}
.code-cell {
  color: var(--muted);
  font-size: 12px;
}

/* News */
.news-list { list-style: none; }
.news-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border-light);
  transition: background .15s ease;
  border-radius: 8px;
}
.news-item:hover { background: #f8fafc; }
.news-item:last-child { border-bottom: none; }
.news-item .body { min-width: 0; flex: 1; }
.news-item .title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.news-item .title:hover { color: var(--primary); }
.news-item .rate {
  font-size: 12px;
  color: var(--muted);
}

/* Reports */
.report-list { list-style: none; }
.report-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: background .15s ease;
  border-radius: 8px;
}
.report-item:hover { background: #f8fafc; }
.report-item:last-child { border-bottom: none; }
.report-item a:hover { color: var(--primary); }
.report-icon {
  width: 28px;
  height: 28px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.report-icon svg { width: 14px; height: 14px; }

/* Sidebar widgets */
.widget {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.widget-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.widget-head h3 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.tab {
  position: relative;
  padding: 8px 0 10px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  font-weight: 500;
}
.tab:hover { color: var(--text-secondary); }
.tab.active {
  color: var(--text);
  font-weight: 700;
}
.tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--text);
  border-radius: 2px 2px 0 0;
}

.empty-state {
  text-align: center;
  padding: 28px 12px 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.empty-illust {
  width: 76px;
  height: 86px;
  margin: 0 auto 14px;
  position: relative;
  background: linear-gradient(180deg, #fff9c4 0%, #fff59d 100%);
  border: 1px solid #f0e68c;
  border-radius: 3px 8px 4px 4px;
  box-shadow: 3px 4px 0 rgba(0,0,0,.04);
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-illust::before {
  content: '';
  position: absolute;
  top: -1px;
  right: -1px;
  width: 16px;
  height: 16px;
  background: linear-gradient(225deg, #fff 50%, #ffe082 50%);
  border-left: 1px solid #f0e68c;
  border-bottom: 1px solid #f0e68c;
}
.empty-illust .face {
  width: 28px;
  height: 28px;
  border: 2px solid #f59e0b;
  border-radius: 50%;
  position: relative;
}
.empty-illust .face::before,
.empty-illust .face::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 3px;
  background: #f59e0b;
  border-radius: 50%;
  top: 8px;
}
.empty-illust .face::before { left: 6px; }
.empty-illust .face::after { right: 6px; }
.empty-illust .smile {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 6px;
  height: 8px;
  border-bottom: 2px solid #f59e0b;
  border-radius: 0 0 10px 10px;
}
.empty-state .cta {
  display: inline-flex;
  margin-top: 14px;
}

/* Holding cards (logged-in calendar) */
.holding-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 2px;
}
.holding-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 14px 12px;
  background: #fff;
}
.holding-card .date-label {
  font-size: 12px;
  color: #ef4444;
  font-weight: 700;
  margin-bottom: 10px;
}
.holding-card .stock-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.holding-card .stock-meta {
  min-width: 0;
}
.holding-card .stock-meta .name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.holding-card .stock-meta .sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.holding-rows {
  display: grid;
  gap: 7px;
}
.holding-rows .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  gap: 10px;
}
.holding-rows .row .k { color: #94a3b8; }
.holding-rows .row .v {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.stats-box {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 8px;
  padding: 22px 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  gap: 4px;
}
.stats-box .num {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.03em;
  color: #0f172a;
}
.stats-box .label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}
.stats-box > div:not(:last-child) {
  border-right: 1px solid #e2e8f0;
}

/* Schedule lists (청약/상장) */
.schedule-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 12px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.schedule-section h3 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}
.schedule-list { list-style: none; }
.schedule-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border-light);
}
.schedule-item:last-child { border-bottom: none; }
.schedule-item .info { flex: 1; min-width: 0; }
.schedule-item .name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.schedule-item .code {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.schedule-item .meta {
  text-align: right;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.schedule-item .meta .price {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.schedule-item .meta .date { color: var(--muted); }
.badge-schedule {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  background: #e8fff3;
  color: #50cd89;
}

.calendar-page {
  padding: 36px 0 56px;
  max-width: 820px;
  animation: fadeUp .4s ease both;
}
.calendar-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.calendar-block > h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
  border-radius: 6px;
  color: transparent !important;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
.table-empty,
.list-empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
  font-size: 13px;
}

.api-banner {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-size: 13px;
}
.api-banner.show { display: block; }

@media (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 24px;
  }
  .section { padding: 18px 16px 8px; }
  .stock-table { font-size: 12.5px; }
  .stock-table th:nth-child(6),
  .stock-table td:nth-child(6) { display: none; }
}
