:root { font-family: 'IBM Plex Sans JP', system-ui, -apple-system, 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif; color: #1A2433; background: #EEF1F5; line-height: 1.5; font-size: 14px; -webkit-font-smoothing: antialiased; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: #2E5AAC; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; border: 1px solid #E3E8EF; border-radius: 8px; padding: 8px 13px; background: white; color: #1A2433; font-size: 12.5px; }
button:disabled { cursor: wait; opacity: .55; }
select { border: 1px solid #E3E8EF; border-radius: 8px; padding: 9px 10px; color: #1A2433; background: white; }
.btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border: 1px solid #E3E8EF; background: #fff; color: #5A6678; padding: 8px 14px; border-radius: 8px; font: inherit; font-size: 12.5px; font-weight: 600; }
.btn:hover { background: #F2F4F8; }
.btn-primary { border-color: #E08A2B; background: #E08A2B; color: #fff; }
.btn-primary:hover { background: #C9781F; }
.btn-blue { border-color: #C9D7EC; background: #fff; color: #2E5AAC; }
.btn-danger { border-color: #F5D5D3; background: #fff; color: #C5392F; }
.btn-danger:hover { background: #FCE9E7; }

/* ---- Shell: sidebar + main ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; flex-shrink: 0; background: #FFFFFF; border-right: 1px solid #E3E8EF; display: flex; flex-direction: column; color: #5A6678; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { padding: 18px 18px 16px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid #EEF1F5; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: #E08A2B; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; font-weight: 700; }
.brand { color: #1A2433; font-weight: 600; font-size: 14.5px; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: #8A97A8; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 1px; }
.nav-group { padding: 13px 8px 6px; font-size: 10px; letter-spacing: 1px; color: #8A97A8; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 7px; color: #5A6678; font-size: 13px; cursor: pointer; }
.nav-item:hover { background: #F2F4F8; }
.nav-item.active { background: #F2F4F8; color: #1A2433; font-weight: 600; }
.nav-item span { width: 18px; text-align: center; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: #E08A2B; color: #fff; font-size: 10px; font-weight: 600; font-family: 'IBM Plex Mono', monospace; border-radius: 9px; padding: 1px 6px; min-width: 18px; text-align: center; }
.sidebar-user { padding: 13px 14px; border-top: 1px solid #EEF1F5; display: flex; align-items: center; gap: 11px; }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: #E9F0FB; color: #2E5AAC; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.user-name { color: #1A2433; font-size: 13px; font-weight: 500; }
.user-role { font-size: 10px; font-weight: 600; color: #E08A2B; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 62px; flex-shrink: 0; background: #fff; border-bottom: 1px solid #E3E8EF; display: flex; align-items: center; padding: 0 22px; gap: 16px; }
.topbar-title { min-width: 0; }
.page-title { font-size: 16px; font-weight: 600; color: #1A2433; line-height: 1.2; }
.page-sub { font-size: 11.5px; color: #8A97A8; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.content { flex: 1; padding: 24px 28px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ---- Cards ---- */
.toolbar, .panel, .stat, .login-card { background: white; border: 1px solid #E3E8EF; border-radius: 10px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding: 16px 20px; }
.toolbar h1 { margin: 0; font-size: 1.35rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 15px 16px; display: flex; flex-direction: column; gap: 7px; }
.stat dt { color: #8A97A8; font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat dd { margin: 0; font-size: 27px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.panel { margin-bottom: 20px; padding: 20px; scroll-margin-top: 80px; }
.panel h2 { margin: 0 0 14px; font-size: 14px; font-weight: 600; color: #1A2433; }

/* ---- Forms ---- */
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
label { display: grid; gap: 5px; color: #5A6678; font-size: 12px; }
input { width: 100%; border: 1px solid #E3E8EF; border-radius: 8px; padding: 9px 10px; color: #1A2433; background: white; font-size: 12.5px; }
input:focus, select:focus { outline: 2px solid rgba(224,138,43,.3); border-color: #E08A2B; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 700px; font-size: 12.5px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #EEF1F5; vertical-align: top; }
th { color: #8A97A8; background: #FAFBFC; font-size: 11px; font-weight: 600; }
td { color: #1A2433; }
tr:hover td { background: #FAFBFC; }
.mono { font-family: 'IBM Plex Mono', monospace; font-size: 12px; }
.muted { color: #8A97A8; }
.empty { padding: 28px; text-align: center; color: #8A97A8; font-size: 13px; }

/* ---- Notice / Toast ---- */
.notice { margin-bottom: 16px; border-left: 4px solid #E08A2B; padding: 11px 14px; color: #7A4A10; background: #FDF3E7; border-radius: 6px; }
.error { border-left-color: #C5392F; color: #7F1D1D; background: #FEF2F2; }

/* ---- Login ---- */
.login { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: #EEF1F5; }
.login-card { width: min(420px, 100%); padding: 28px; }
.login-card h1 { margin-top: 0; font-size: 1.35rem; }
.login-card form { display: grid; gap: 14px; }
.login-card .btn-primary { width: 100%; margin-top: 5px; }

/* ---- Admin / Region ---- */
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 14px; }
.admin-grid > div { min-width: 0; }
.admin-grid table { min-width: 620px; }
.region-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.region-head h2 { margin: 0; }
.region-head label { min-width: 150px; }
.region-alert td { color: #9A3412; background: #FFF7ED; font-weight: 650; }

/* ---- Responsive ---- */
@media (max-width: 900px) { .sidebar { width: 64px; } .sidebar-brand div:not(.brand-mark), .brand-sub, .nav-item span:not(:first-child), .nav-badge, .nav-group, .sidebar-user div { display: none; } .sidebar-brand { justify-content: center; padding: 14px 0; } .nav-item { justify-content: center; } .nav-item span { width: auto; } }
@media (max-width: 800px) { .content { padding: 16px; } .topbar { padding: 14px 16px; } .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .toolbar { align-items: flex-start; flex-direction: column; } }
@media (max-width: 800px) { .admin-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .region-head { align-items: flex-start; flex-direction: column; } }
@media (max-width: 480px) { .stats, .filters { grid-template-columns: 1fr; } .topbar { align-items: flex-start; flex-direction: column; } }
