/* =========================
   ページ全体
========================= */

.dashboard-page {
  min-height: calc(100vh - 120px);
  padding-top: 0;
  padding-bottom: 30px;
  background-color: var(--background-color);
  box-sizing: border-box;
}

.dashboard-container {
  width: 100%;
  margin: var(--page-margin-desktop);
}

.dashboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.dashboard-label {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

#companyName {
  margin: 4px 0 0;
  font-size: 32px;
  color: #111827;
}

.dashboard-subtitle {
  margin: 0;
  color: #4b5563;
  font-size: 16px;
}

.dashboard-content {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.dashboard-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
  padding: 20px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.mobile-shortcuts {
  display: none;
}

.mobile-shortcuts-label {
  margin: 0 0 10px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.mobile-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mobile-shortcut-button {
  min-height: 58px;
  padding: 8px 6px;
  border-radius: 14px;
  background: transparent;
  border: 1px solid #d1d5db;
  box-shadow: none;
  color: #1f2937;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
}

.shortcut-line {
  display: block;
  word-break: keep-all;
  overflow-wrap: normal;
}

.mobile-shortcut-button:hover {
  color: #111827;
  border-color: #9ca3af;
}

.sidebar-list,
.sidebar-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-item + .sidebar-item {
  margin-top: 12px;
}

.sidebar-link,
.sidebar-sublink {
  display: block;
  color: #111827;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
}

.sidebar-sublist {
  margin-top: 8px;
  padding-left: 16px;
}

.sidebar-sublink {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  padding: 8px 0;
}

.sidebar-sublink:hover,
.sidebar-link:hover {
  color: #1d4ed8;
}

.sidebar-link-static {
  cursor: default;
}

.sidebar-link-static:hover {
  color: #111827;
}

.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-stat-row {
  display: grid;
  gap: 12px;
}

.dashboard-stat-row-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-stat-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card {
  padding: 18px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.stat-label {
  margin: 0 0 10px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.2;
}

.label-line {
  display: block;
  word-break: keep-all;
  overflow-wrap: normal;
}

.stat-value {
  display: block;
  margin: 0;
  color: #111827;
  font-size: 28px;
  font-weight: 800;
}

.dashboard-panels {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.dashboard-panel {
  padding: 24px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title {
  margin: 0;
  color: #111827;
  font-size: 18px;
  font-weight: 700;
}

.panel-link {
  color: #2563eb;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.panel-link:hover {
  text-decoration: underline;
}

.panel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.chart-placeholder {
  min-height: 360px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 16px;
  text-align: center;
}

.chart-placeholder.chart-ready {
  display: block;
  border-style: solid;
  border-color: #dbeafe;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  color: inherit;
}

.dashboard-chart-wrapper {
  width: 100%;
}

.dashboard-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 10px;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-line {
  width: 18px;
  height: 3px;
  border-radius: 999px;
}

.legend-view {
  background: #2563eb;
}

.legend-map {
  background: #f97316;
}

.dashboard-chart {
  width: 100%;
  height: auto;
}

.dashboard-plot-bg {
  fill: #f8fafc;
}

.dashboard-grid-line {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.dashboard-axis-text {
  fill: #64748b;
  font-size: 11px;
  font-weight: 500;
}

.dashboard-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-line-view {
  stroke: #2563eb;
}

.dashboard-line-map {
  stroke: #f97316;
}

.dashboard-sidepanels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.panel-body {
  color: #4b5563;
  font-size: 14px;
  line-height: 1.75;
}

.panel-text {
  margin: 0 0 12px;
}

.notice-preview-item {
  width: 100%;
  text-align: left;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
  cursor: pointer;
  margin-bottom: 10px;
}

.notice-preview-item:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.notice-preview-title {
  display: block;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 6px;
}

.notice-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notice-preview-date {
  color: #6b7280;
  font-size: 12px;
}

.notice-preview-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  background: #ef4444;
}

@media (max-width: 1200px) {
  .dashboard-stat-row-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-content {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: static;
    top: auto;
    margin-bottom: 24px;
    padding: 20px;
  }

  .dashboard-stats {
    gap: 16px;
  }

  .dashboard-stat-row,
  .dashboard-stat-row-4,
  .dashboard-stat-row-2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .dashboard-panels {
    grid-template-columns: 1fr;
  }

  .chart-placeholder {
    min-height: 260px;
  }

  .sidebar-item + .sidebar-item {
    margin-top: 12px;
  }

  .sidebar-sublist {
    padding-left: 12px;
  }

  .sidebar-sublink {
    padding: 10px 0;
  }
}

@media (max-width: 640px) {
  .dashboard-container {
    width: 100%;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
  }

  #companyName {
    font-size: 26px;
  }

  .dashboard-subtitle {
    font-size: 13px;
  }

  .dashboard-content {
    gap: 12px;
  }

  .dashboard-sidebar {
    padding: 14px;
    border-radius: 18px;
    margin-bottom: 0;
  }

  .mobile-shortcuts-label {
    margin-bottom: 8px;
    font-size: 11px;
  }

  .mobile-shortcut-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .mobile-shortcut-button {
    min-height: 50px;
    padding: 5px 4px;
    border-radius: 12px;
    font-size: 9px;
    line-height: 1.1;
    word-break: keep-all;
    overflow-wrap: normal;
  }

  .mobile-shortcuts {
    display: block;
  }

  .sidebar-nav {
    display: none;
  }

  .sidebar-link,
  .sidebar-sublink {
    font-size: 15px;
  }

  .dashboard-stats {
    gap: 6px;
  }

  .dashboard-stat-row,
  .dashboard-stat-row-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .dashboard-stat-row-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .dashboard-panel,
  .stat-card {
    padding: 10px 6px;
  }

  .stat-card {
    border-radius: 14px;
    min-width: 0;
  }

  .stat-label {
    margin-bottom: 6px;
    font-size: 8px;
    line-height: 1.2;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    letter-spacing: -0.02em;
  }

  .stat-value {
    font-size: 15px;
    line-height: 1.05;
  }

  .panel-title {
    font-size: 16px;
  }

  .chart-placeholder {
    min-height: 180px;
  }
  .chart-placeholder.chart-ready {
    max-width: 100%;
  }

  .graph-panel {
    overflow: hidden;
    min-width: 0;
  }

  .dashboard-chart-wrapper {
    width: 100%;
    min-width: 0;
  }

  .dashboard-chart {
    width: 100%;
    max-width: 100%;
  }

  .dashboard-legend {
    font-size: 11px;
    gap: 12px;
  }

  .legend-line {
    width: 14px;
    height: 3px;
  }

  .dashboard-axis-text {
    font-size: 10px;
  }

  .dashboard-line {
    stroke-width: 3;
  }
}

@media (hover: none) {
  .dashboard-page {
    padding-top: 0;
    padding-bottom: 60px;
  }

  .dashboard-container {
    margin: var(--page-margin-mobile);
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  #companyName {
    font-size: 28px;
  }

  .dashboard-subtitle {
    font-size: 14px;
  }

  .dashboard-content {
    gap: 12px;
  }

  .dashboard-sidebar {
    padding: 14px;
    border-radius: 18px;
    margin-bottom: 0;
  }

  .mobile-shortcuts {
    display: block;
  }

  .sidebar-nav {
    display: none;
  }

  .mobile-shortcut-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .mobile-shortcut-button {
    min-height: 50px;
    padding: 5px 4px;
    font-size: 9px;
    line-height: 1.1;
    word-break: keep-all;
    overflow-wrap: normal;
  }

  .dashboard-stats {
    gap: 6px;
  }

  .dashboard-stat-row,
  .dashboard-stat-row-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .dashboard-stat-row-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .stat-card {
    padding: 10px 6px;
    border-radius: 14px;
    min-width: 0;
  }

  .stat-label {
    margin-bottom: 6px;
    font-size: 8px;
    line-height: 1.2;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    letter-spacing: -0.02em;
  }

  .stat-value {
    font-size: 15px;
    line-height: 1.05;
  }
}

@media (hover: none) and (orientation: landscape) and (min-width: 768px) {
  .mobile-shortcuts {
    display: none;
  }

  .sidebar-nav {
    display: block;
  }

  .dashboard-content {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
  }

  .dashboard-sidebar {
    padding: 20px;
    border-radius: 20px;
  }

  .sidebar-link {
    font-size: 16px;
  }

  .sidebar-sublink {
    font-size: 14px;
  }
}

