/* ============================================================
   KIZK Hub — hub.css
   統合管理画面スタイル（Meta Suite インスパイア）
   ============================================================ */
:root {
  --hub-bg:       #0F172A;
  --hub-sidebar:  #1E293B;
  --hub-border:   #334155;
  --hub-text:     #E2E8F0;
  --hub-muted:    #94A3B8;
  --hub-surface:  #1E293B;

  --c-blue:   #3B82F6;
  --c-green:  #10B981;
  --c-orange: #F59E0B;
  --c-red:    #EF4444;
  --c-purple: #8B5CF6;

  --platform-tsushin:    #185FA5;
  --platform-naraigoto:  #0095D9;
  --platform-job:        #FF6B35;

  --sidebar-w: 240px;
  --topbar-h:  56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background: var(--hub-bg);
  color: var(--hub-text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }

/* ──────── Layout ──────── */
.hub-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.hub-sidebar {
  width: var(--sidebar-w);
  background: var(--hub-sidebar);
  border-right: 1px solid var(--hub-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}
.hub-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--hub-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.hub-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--c-blue), var(--c-purple));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.hub-logo-text { font-size: 15px; font-weight: 900; letter-spacing: -0.02em; }
.hub-logo-sub  { font-size: 10px; color: var(--hub-muted); }

.hub-nav-section { padding: 8px 0; }
.hub-nav-label {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hub-muted);
}
.hub-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--hub-muted);
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.hub-nav a:hover  { background: rgba(255,255,255,0.06); color: var(--hub-text); }
.hub-nav a.active { background: rgba(59,130,246,0.15); color: #fff; }
.hub-nav a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--c-blue);
  border-radius: 0 3px 3px 0;
}
.hub-nav a i { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.hub-nav .badge {
  margin-left: auto;
  background: var(--c-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Platform colored nav items */
.hub-nav a.plat-tsushin   { border-left: 3px solid transparent; }
.hub-nav a.plat-tsushin.active   { background: rgba(24,95,165,0.2); color: #7EB3F0; }
.hub-nav a.plat-naraigoto.active { background: rgba(0,149,217,0.2); color: #6FD3F7; }
.hub-nav a.plat-job.active       { background: rgba(255,107,53,0.2); color: #FFB07A; }

.sidebar-bottom {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--hub-border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--c-blue);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
}
.sidebar-logout {
  display: block;
  margin-top: 8px;
  padding: 7px 12px;
  background: rgba(239,68,68,0.15);
  color: #FCA5A5;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transition: background 0.15s;
}
.sidebar-logout:hover { background: rgba(239,68,68,0.3); }

/* Main */
.hub-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.hub-topbar {
  height: var(--topbar-h);
  background: var(--hub-sidebar);
  border-bottom: 1px solid var(--hub-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.hub-topbar h1 { font-size: 16px; font-weight: 700; flex: 1; }
.hub-content { padding: 28px 24px; max-width: 1280px; }

/* ──────── Cards ──────── */
.card {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: 12px;
  padding: 20px;
}
.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--hub-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ──────── Stat Grid ──────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: 12px;
  padding: 16px 18px;
}
.stat-num   { font-size: 30px; font-weight: 900; line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--hub-muted); margin-top: 4px; }
.stat-delta { font-size: 11px; margin-top: 6px; }
.delta-up   { color: var(--c-green); }
.delta-dn   { color: var(--c-red); }

/* Platform Overview */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.platform-card {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: 12px;
  overflow: hidden;
}
.platform-card-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--hub-border);
}
.platform-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.platform-card-body { padding: 14px 18px; }
.platform-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.platform-stat-row:last-child { border-bottom: none; }
.platform-stat-val { font-weight: 700; }

/* ──────── Table ──────── */
.hub-table-wrap {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: 12px;
  overflow: hidden;
}
.hub-table-head {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--hub-border);
}
.hub-table-title { font-size: 14px; font-weight: 700; }
table.htable { width: 100%; border-collapse: collapse; }
.htable th {
  background: rgba(255,255,255,0.04);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hub-muted);
  border-bottom: 1px solid var(--hub-border);
}
.htable td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.htable tr:last-child td { border-bottom: none; }
.htable tr:hover td { background: rgba(255,255,255,0.03); }

/* ──────── Badges & Pills ──────── */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}
.pill-green  { background: rgba(16,185,129,0.15); color: #6EE7B7; }
.pill-blue   { background: rgba(59,130,246,0.15);  color: #93C5FD; }
.pill-orange { background: rgba(245,158,11,0.15);  color: #FCD34D; }
.pill-red    { background: rgba(239,68,68,0.15);   color: #FCA5A5; }
.pill-gray   { background: rgba(148,163,184,0.15); color: #94A3B8; }

/* ──────── Subscription checkboxes ──────── */
.sub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.sub-card {
  background: var(--hub-surface);
  border: 1px solid var(--hub-border);
  border-radius: 12px;
  padding: 16px;
}
.sub-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.sub-biz-name { font-size: 14px; font-weight: 700; }
.sub-biz-type { font-size: 11px; color: var(--hub-muted); }
.platform-check-list { display: flex; flex-direction: column; gap: 8px; }
.platform-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}
.platform-check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.platform-check-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--c-blue);
  cursor: pointer;
}
.plan-select {
  padding: 4px 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--hub-border);
  border-radius: 6px;
  color: var(--hub-text);
  font-size: 12px;
  cursor: pointer;
}

/* ──────── Buttons ──────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
  font-family: inherit;
}
.btn:hover    { opacity: 0.85; }
.btn:active   { transform: scale(0.97); }
.btn-primary  { background: var(--c-blue);  color: #fff; }
.btn-success  { background: var(--c-green); color: #fff; }
.btn-danger   { background: var(--c-red);   color: #fff; }
.btn-ghost    { background: rgba(255,255,255,0.08); color: var(--hub-text); }
.btn-sm       { padding: 5px 10px; font-size: 12px; }

/* ──────── Login ──────── */
.hub-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at top, #1E293B 0%, #0F172A 70%);
  padding: 20px;
}
.hub-login-card {
  background: var(--hub-sidebar);
  border: 1px solid var(--hub-border);
  border-radius: 16px;
  padding: 40px 36px;
  width: min(100%, 400px);
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}
.hub-login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.hub-login-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--c-blue), var(--c-purple));
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 14px;
}
.hub-login-title { font-size: 22px; font-weight: 900; }
.hub-login-sub   { font-size: 12px; color: var(--hub-muted); margin-top: 4px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 11px; font-weight: 700; color: var(--hub-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--hub-border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--hub-text);
  outline: none;
  font-family: inherit;
}
.field input:focus { border-color: var(--c-blue); box-shadow: 0 0 0 3px rgba(59,130,246,0.2); }
.login-btn {
  width: 100%;
  padding: 13px;
  background: var(--c-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin-top: 8px;
}
.login-btn:hover { background: #2563EB; }
.login-err { color: #FCA5A5; font-size: 12px; text-align: center; margin-top: 10px; min-height: 16px; }

/* ──────── Alerts ──────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #6EE7B7; }
.alert-error   { background: rgba(239,68,68,0.15);  border: 1px solid rgba(239,68,68,0.3);  color: #FCA5A5; }

/* ──────── Forms ──────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--hub-muted); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--hub-border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--hub-text);
  font-family: inherit;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-textarea { min-height: 80px; resize: vertical; }

/* ──────── Search / Filter ──────── */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.search-input {
  padding: 9px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--hub-border);
  border-radius: 8px;
  color: var(--hub-text);
  font-size: 13px;
  min-width: 220px;
  outline: none;
  font-family: inherit;
}
.search-input:focus { border-color: var(--c-blue); }

/* ──────── Responsive ──────── */
@media (max-width: 768px) {
  .hub-sidebar { transform: translateX(-100%); transition: transform 0.25s; }
  .hub-sidebar.open { transform: translateX(0); }
  .hub-main { margin-left: 0; }
  .hub-content { padding: 20px 16px; }
  .platform-grid, .stat-grid { grid-template-columns: 1fr 1fr; }
}
