/* e-Gov 社保情報ビューア — swiftra スタイルを踏襲、light メインで配色 */

html, body {
  background-color: #f7f9fa;
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
}
[data-theme="dark"] html,
[data-theme="dark"] body {
  background-color: #121212;
  color: #e6e6e6;
}

/* ===== Layout ===== */
.eg-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 56px 1fr auto;
  grid-template-areas:
    "header header"
    "sidebar main"
    "footer footer";
  min-height: 100vh;
}
@media (max-width: 768px) {
  .eg-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 56px auto 1fr auto;
    grid-template-areas:
      "header"
      "sidebar"
      "main"
      "footer";
  }
}

/* ===== Header ===== */
.eg-header {
  grid-area: header;
  background: #ffffff;
  border-bottom: 1px solid #e2e6ea;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}
[data-theme="dark"] .eg-header {
  background: #1e1e1e;
  border-bottom-color: #2a2a2a;
}
.eg-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
}
.eg-logo i { color: #154734; font-size: 1.3rem; }
[data-theme="dark"] .eg-logo i { color: #4caf7f; }
.eg-header-right {
  display: flex; align-items: center; gap: 10px;
}
.eg-user {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.92rem; opacity: 0.85;
}
.eg-user-name {
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eg-header .button.is-small {
  background: transparent; border: 1px solid #d0d6db; color: inherit;
}
.eg-header .button.is-small:hover {
  background: #f0f3f5; border-color: #b0b8bf;
}
[data-theme="dark"] .eg-header .button.is-small {
  background: #2a2a2a; border-color: #3a3a3a; color: #e6e6e6;
}
[data-theme="dark"] .eg-header .button.is-small:hover {
  background: #333; border-color: #4a4a4a;
}

/* ===== Sidebar ===== */
.eg-sidebar {
  grid-area: sidebar;
  background: #eceff1;
  border-right: 1px solid #d0d6db;
  padding: 12px 0;
  overflow-y: auto;
}
[data-theme="dark"] .eg-sidebar {
  background: #161616; border-right-color: #2a2a2a;
}
.eg-menu { display: flex; flex-direction: column; }
.eg-menu-section {
  padding: 16px 20px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
}
.eg-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  color: inherit !important;
  text-decoration: none;
  border-left: 3px solid transparent;
  font-size: 0.94rem;
  transition: background .1s, border-color .1s;
}
.eg-menu-item:hover { background: #dfe4e7; }
[data-theme="dark"] .eg-menu-item:hover { background: rgba(255,255,255,0.05); }
.eg-menu-item.is-active {
  background: #d5e6dc; color: #154734 !important;
  border-left-color: #154734; font-weight: 600;
}
[data-theme="dark"] .eg-menu-item.is-active {
  background: rgba(21,71,52,0.35); color: #d6f0e0 !important;
  border-left-color: #4caf7f;
}
.eg-menu-item i { width: 18px; text-align: center; opacity: 0.85; }

/* ===== Main ===== */
.eg-main {
  grid-area: main;
  padding: 24px;
  overflow-y: auto;
}
.eg-main .container { max-width: 1280px; }

/* ===== Footer ===== */
.eg-footer {
  grid-area: footer;
  background: #eceff1; color: #555;
  border-top: 1px solid #d0d6db;
  padding: 10px 24px;
  text-align: center;
}
[data-theme="dark"] .eg-footer {
  background: #161616; color: #888; border-top-color: #2a2a2a;
}

/* ===== Auth (login) ===== */
.eg-auth-main {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px;
}
.eg-auth-card {
  background: #ffffff;
  border: 1px solid #e2e6ea;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 28px 32px;
  width: 100%; max-width: 380px;
}
[data-theme="dark"] .eg-auth-card {
  background: #1e1e1e; border-color: #2a2a2a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.eg-auth-card h2 {
  font-size: 1.25rem; font-weight: 600; margin: 0 0 16px;
  display: flex; align-items: center; gap: 8px;
}
.eg-auth-card h2 i { color: #154734; }
[data-theme="dark"] .eg-auth-card h2 i { color: #4caf7f; }

/* ===== Page header ===== */
.eg-page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 20px;
  gap: 12px; flex-wrap: wrap;
}
.eg-page-head h1 {
  font-size: 1.45rem; font-weight: 600; margin: 0;
  display: inline-flex; align-items: center; gap: 10px;
}
.eg-page-head h1 i { color: #154734; }
[data-theme="dark"] .eg-page-head h1 i { color: #4caf7f; }

/* ===== KPI cards ===== */
.eg-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.eg-kpi {
  background: #ffffff;
  border: 1px solid #e2e6ea;
  border-radius: 8px;
  padding: 16px 18px;
}
[data-theme="dark"] .eg-kpi {
  background: #1e1e1e; border-color: #2a2a2a;
}
.eg-kpi .label {
  font-size: 0.82rem; opacity: 0.65;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px;
}
.eg-kpi .value {
  font-size: 1.65rem; font-weight: 700; line-height: 1.1;
}
.eg-kpi .sub {
  font-size: 0.78rem; opacity: 0.6; margin-top: 4px;
}

/* ===== Cards / panels ===== */
.eg-card {
  background: #ffffff;
  border: 1px solid #e2e6ea;
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
[data-theme="dark"] .eg-card {
  background: #1e1e1e; border-color: #2a2a2a;
}
.eg-card h3 {
  font-size: 1rem; font-weight: 600; margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.eg-card h3 i { opacity: 0.6; font-size: 0.95rem; }

/* ===== Tables ===== */
.eg-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
.eg-table thead th {
  text-align: left; font-weight: 600;
  padding: 8px 10px;
  border-bottom: 2px solid #d0d6db;
  background: #f3f5f7;
  color: #555;
}
[data-theme="dark"] .eg-table thead th {
  background: #2a2a2a; color: #c0c0c0; border-bottom-color: #3a3a3a;
}
.eg-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e6ea;
}
[data-theme="dark"] .eg-table tbody td {
  border-bottom-color: #2a2a2a;
}
.eg-table tbody tr:hover td {
  background: #f5f9f6;
}
[data-theme="dark"] .eg-table tbody tr:hover td {
  background: rgba(76,175,127,0.10);
}
.eg-table .right { text-align: right; }
.eg-table .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.86em; }
.eg-table a { color: #154734; text-decoration: none; }
.eg-table a:hover { text-decoration: underline; }
[data-theme="dark"] .eg-table a { color: #79d4a3; }

/* ===== Status tags ===== */
.eg-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.5;
}
.eg-tag.ok    { background: #d4ecdc; color: #14532b; }
.eg-tag.warn  { background: #fde8c8; color: #6b4716; }
.eg-tag.err   { background: #fbd1d1; color: #71171c; }
.eg-tag.muted { background: #e2e6ea; color: #555; }
[data-theme="dark"] .eg-tag.ok    { background: #1e4d34; color: #cdeed8; }
[data-theme="dark"] .eg-tag.warn  { background: #4a3a1a; color: #f0d6a0; }
[data-theme="dark"] .eg-tag.err   { background: #4a1f25; color: #f5b5c0; }
[data-theme="dark"] .eg-tag.muted { background: #2a2a2a; color: #c0c0c0; }

/* ===== Filter bar ===== */
.eg-filter {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.eg-filter .field { margin: 0; }
.eg-filter .input, .eg-filter .select select {
  height: 2.25em;
}

/* Bulma dark overrides */
[data-theme="dark"] .input,
[data-theme="dark"] .textarea,
[data-theme="dark"] .select select {
  background: #2a2a2a !important; color: #e6e6e6 !important; border-color: #3a3a3a !important;
}
[data-theme="dark"] .input::placeholder { color: #888 !important; }

/* ===== Memos ===== */
.eg-memo {
  background: #fff8e1;
  border-left: 3px solid #f0c060;
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  margin: 8px 0;
}
.eg-memo .meta { font-size: 0.78rem; opacity: 0.65; margin-bottom: 4px; }
[data-theme="dark"] .eg-memo {
  background: rgba(240,192,96,0.08); border-left-color: #c89a3a;
}

/* ===== Misc ===== */
.right { text-align: right; }
.muted { color: #777; }
[data-theme="dark"] .muted { color: #999; }
.mono  { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9em; }
.section-spaced { margin-top: 18px; }

/* primary button (login etc) */
.button.is-success,
.button.is-primary {
  background-color: #154734 !important;
  border-color: #154734 !important;
  color: #fff !important;
}
.button.is-success:hover,
.button.is-primary:hover {
  background-color: #22543d !important;
  border-color: #22543d !important;
}

/* logs viewer */
pre.eg-log {
  background: #0e0e0e; color: #d4d4d4;
  padding: 12px; border-radius: 6px;
  font-size: 0.78rem; max-height: 420px; overflow: auto;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  line-height: 1.45;
}
