/* ファイルパス: public/css/base.css */
:root{
  --bg:#f8fafc;
  --surface:#ffffff;
  --surface-soft:#f9fafb;
  --surface-blue:#f5f7ff;
  --border:#e5e7eb;
  --border-strong:#d9def0;
  --text:#111827;
  --text-muted:#667085;
  --text-soft:#98a2b3;
  --primary:#4f46e5;
  --primary-2:#2563eb;
  --primary-soft:#eef2ff;
  --success:#16a34a;
  --success-soft:#ecfdf3;
  --danger:#dc2626;
  --danger-soft:#fff1f2;
  --warning:#d97706;
  --warning-soft:#fffbeb;
  --info:#2563eb;
  --info-soft:#eff6ff;
  --care:#0f766e;
  --care-soft:#ecfdf5;
  --shadow-sm:0 1px 2px rgba(16,24,40,.05);
  --shadow-md:0 12px 34px rgba(15,23,42,.08);
  --shadow-lg:0 22px 64px rgba(15,23,42,.12);
  --radius-sm:10px;
  --radius-md:14px;
  --radius-lg:18px;
  --radius-xl:24px;
  --header-h:70px;
  --sidebar-w:244px;
  --font:Inter,"Noto Sans JP",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
*{box-sizing:border-box}
html{min-height:100%;background:var(--bg);font-family:var(--font);color:var(--text);-webkit-text-size-adjust:100%}
body{margin:0;min-height:100vh;background:linear-gradient(180deg,#fff 0,#f8fafc 260px);font-family:var(--font);color:var(--text);font-size:14px;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.55}
img,svg{max-width:100%}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.muted{color:var(--text-muted)}
.small{font-size:12px}
.text-danger{color:var(--danger)}
.text-success{color:var(--success)}
.text-primary{color:var(--primary)}
.stack{display:grid;gap:16px}
.stack-sm{display:grid;gap:10px}
.row{display:flex;align-items:center;gap:12px}
.row-wrap{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.spacer{flex:1}
.divider{height:1px;background:var(--border);border:0;margin:4px 0}
.app-shell{min-height:100vh}
.app-header{
  height:var(--header-h);display:flex;align-items:center;gap:18px;padding:0 24px;
  position:sticky;top:0;z-index:40;background:rgba(255,255,255,.94);
  border-bottom:1px solid var(--border);backdrop-filter:blur(16px)
}
.brand{display:flex;align-items:center;gap:10px;min-width:150px}
.brand img{width:116px;height:auto;display:block}
.header-context{display:flex;align-items:center;gap:10px;min-width:0}
.header-context strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.header-context span{font-size:12px;color:var(--text-muted)}
.header-actions{margin-left:auto;display:flex;align-items:center;gap:10px}
.user-chip{display:flex;align-items:center;gap:10px;padding:7px 10px;border:1px solid var(--border);border-radius:999px;background:#fff}
.user-avatar{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:var(--primary-soft);color:var(--primary);font-weight:800;font-size:12px}
.user-chip-copy{display:grid;line-height:1.2}
.user-chip-copy strong{font-size:12px}
.user-chip-copy span{font-size:11px;color:var(--text-muted);margin-top:2px}
.app-layout{display:grid;grid-template-columns:var(--sidebar-w) minmax(0,1fr);min-height:calc(100vh - var(--header-h))}
.sidebar{border-right:1px solid var(--border);background:rgba(255,255,255,.74);padding:20px 14px;position:sticky;top:var(--header-h);height:calc(100vh - var(--header-h));overflow:auto}
.sidebar-section-title{padding:8px 12px;color:var(--text-soft);font-size:11px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
.nav-list{display:grid;gap:6px}
.nav-item{display:flex;align-items:center;gap:11px;min-height:44px;padding:0 12px;border-radius:11px;color:#475467;font-weight:700;font-size:13px}
.nav-item:hover{background:#f7f8ff;color:var(--primary)}
.nav-item.active{background:var(--primary-soft);color:var(--primary)}
.nav-icon{width:28px;height:28px;border-radius:9px;border:1px solid var(--border);background:#fff;display:grid;place-items:center;font-size:12px;font-weight:850;color:inherit}
.sidebar-note{margin-top:auto;padding:14px;border:1px solid var(--border);border-radius:14px;background:#fff;color:var(--text-muted);font-size:12px;line-height:1.65}
.main{padding:28px 30px 48px;min-width:0}
.content-wrap{max-width:1240px;margin:0 auto}
.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:22px}
.page-title-group{min-width:0}
.eyebrow{font-size:12px;color:var(--primary);font-weight:800;letter-spacing:.04em;margin-bottom:7px}
.page-title{margin:0;font-size:28px;line-height:1.22;letter-spacing:-.035em}
.page-subtitle{margin:8px 0 0;color:var(--text-muted);font-size:14px;line-height:1.7}
.page-actions{display:flex;gap:9px;flex-wrap:wrap;justify-content:flex-end}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm)}
.card-pad{padding:20px}
.card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}
.card-title{margin:0;font-size:16px;line-height:1.45;letter-spacing:-.015em}
.card-subtitle{margin:5px 0 0;color:var(--text-muted);font-size:12px;line-height:1.6}
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.grid-4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.metric-card{padding:17px 18px}
.metric-label{display:block;font-size:12px;color:var(--text-muted);font-weight:700}
.metric-value{display:block;margin-top:6px;font-size:25px;letter-spacing:-.04em}
.metric-foot{display:block;margin-top:4px;font-size:11px;color:var(--text-soft)}
.btn{min-height:42px;padding:0 16px;border-radius:11px;border:1px solid var(--border);background:#fff;color:var(--text);font-size:13px;font-weight:750;display:inline-flex;align-items:center;justify-content:center;gap:8px;box-shadow:var(--shadow-sm)}
.btn:hover{background:#fbfcff;border-color:var(--border-strong)}
.btn-primary{border-color:var(--primary);background:linear-gradient(135deg,var(--primary) 0%,#5b35f5 100%);color:#fff;box-shadow:0 10px 22px rgba(79,70,229,.20)}
.btn-primary:hover{background:linear-gradient(135deg,#4338ca 0%,#4f2ddd 100%)}
.btn-soft{background:var(--primary-soft);border-color:#d9ddff;color:var(--primary)}
.btn-success{background:var(--success);border-color:var(--success);color:#fff}
.btn-danger{background:#fff;border-color:#fecaca;color:var(--danger)}
.btn-ghost{background:transparent;border-color:transparent;box-shadow:none}
.btn-sm{min-height:34px;padding:0 11px;border-radius:9px;font-size:12px}
.btn-lg{min-height:48px;padding:0 20px;font-size:14px}
.icon-btn{width:40px;height:40px;padding:0;border-radius:11px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.form-group{display:grid;gap:7px;min-width:0}
.form-group.full{grid-column:1/-1}
.form-label{font-size:12px;font-weight:800;color:#475467}
.form-hint{font-size:11px;color:var(--text-muted);line-height:1.55}
.input,.select,.textarea{width:100%;border:1px solid var(--border);background:#fff;color:var(--text);border-radius:11px;outline:none;transition:border-color .15s,box-shadow .15s}
.input,.select{height:44px;padding:0 13px}
.textarea{min-height:98px;padding:11px 13px;resize:vertical}
.input:focus,.select:focus,.textarea:focus{border-color:#a5b4fc;box-shadow:0 0 0 3px rgba(79,70,229,.10)}
.checkbox-row{display:flex;align-items:center;gap:8px;min-height:34px}
.checkbox-row input{width:17px;height:17px;accent-color:var(--primary)}
.segmented{display:flex;gap:8px;flex-wrap:wrap}
.segment{border:1px solid var(--border);background:#fff;border-radius:999px;padding:8px 12px;font-size:12px;font-weight:700;color:#475467}
.segment.active{background:var(--primary-soft);border-color:#c7d2fe;color:var(--primary)}
.badge{display:inline-flex;align-items:center;gap:6px;min-height:26px;padding:0 9px;border-radius:999px;font-size:11px;font-weight:800;white-space:nowrap;background:#f2f4f7;color:#475467}
.badge.primary{background:var(--primary-soft);color:var(--primary)}
.badge.success{background:var(--success-soft);color:#15803d}
.badge.warning{background:var(--warning-soft);color:#b45309}
.badge.danger{background:var(--danger-soft);color:#be123c}
.badge.info{background:var(--info-soft);color:#1d4ed8}
.badge.care{background:var(--care-soft);color:var(--care)}
.status-dot{width:7px;height:7px;border-radius:999px;background:currentColor}
.table-wrap{overflow:auto;border:1px solid var(--border);border-radius:14px;background:#fff}
.table{width:100%;border-collapse:collapse;min-width:760px}
.table th{padding:12px 14px;text-align:left;background:#fbfcff;color:#667085;border-bottom:1px solid var(--border);font-size:11px;letter-spacing:.02em}
.table td{padding:14px;border-bottom:1px solid var(--border);font-size:13px;vertical-align:middle}
.table tr:last-child td{border-bottom:0}
.table tr:hover td{background:#fcfcff}
.empty-state{padding:42px 20px;text-align:center;border:1px dashed var(--border-strong);border-radius:16px;background:#fcfcff}
.empty-icon{width:52px;height:52px;margin:0 auto 12px;border-radius:16px;display:grid;place-items:center;background:var(--primary-soft);color:var(--primary);font-size:20px;font-weight:850}
.empty-state h3{margin:0;font-size:15px}
.empty-state p{margin:7px auto 0;max-width:460px;color:var(--text-muted);font-size:12px;line-height:1.7}
.notice{display:flex;gap:12px;padding:14px 15px;border-radius:13px;border:1px solid var(--border);background:#fff;font-size:12px;line-height:1.65}
.notice.info{border-color:#bfdbfe;background:#f8fbff;color:#1e3a5f}
.notice.warning{border-color:#fed7aa;background:#fffaf5;color:#7c3f0d}
.notice.success{border-color:#bbf7d0;background:#f7fff9;color:#14532d}
.timeline{display:grid;gap:0}
.timeline-item{display:grid;grid-template-columns:18px minmax(0,1fr);gap:10px;min-height:54px}
.timeline-rail{position:relative}
.timeline-rail::before{content:"";position:absolute;left:7px;top:15px;bottom:-2px;width:1px;background:#e4e7ec}
.timeline-item:last-child .timeline-rail::before{display:none}
.timeline-dot{position:relative;z-index:1;width:15px;height:15px;border-radius:50%;border:4px solid #eef2ff;background:var(--primary)}
.timeline-copy{padding-bottom:14px}
.timeline-copy strong{display:block;font-size:12px}
.timeline-copy span{display:block;margin-top:3px;color:var(--text-muted);font-size:11px}
.modal-backdrop{position:fixed;inset:0;z-index:80;background:rgba(15,23,42,.42);display:grid;place-items:center;padding:20px}
.modal{width:min(620px,100%);max-height:90vh;overflow:auto;background:#fff;border-radius:20px;box-shadow:var(--shadow-lg);border:1px solid rgba(255,255,255,.7)}
.modal-head{padding:20px 22px 12px;display:flex;align-items:flex-start;justify-content:space-between;gap:15px}
.modal-body{padding:6px 22px 22px}
.toast-region{position:fixed;right:20px;bottom:20px;z-index:120;display:grid;gap:9px;width:min(360px,calc(100vw - 40px))}
.toast{padding:13px 14px;border-radius:12px;background:#111827;color:#fff;box-shadow:var(--shadow-lg);font-size:12px;line-height:1.55}
.toast.success{background:#14532d}
.toast.error{background:#7f1d1d}
.loading{opacity:.62;pointer-events:none}
.skeleton{min-height:44px;border-radius:10px;background:linear-gradient(90deg,#f2f4f7 25%,#f8fafc 50%,#f2f4f7 75%);background-size:200% 100%;animation:shine 1.2s infinite}
@keyframes shine{to{background-position:-200% 0}}
@media(max-width:980px){
  .app-layout{grid-template-columns:1fr}
  .sidebar{position:static;height:auto;border-right:0;border-bottom:1px solid var(--border);padding:10px 14px;overflow:auto}
  .sidebar .nav-list{display:flex;gap:8px;overflow:auto}
  .sidebar-section-title,.sidebar-note{display:none}
  .nav-item{min-width:max-content}
  .main{padding:22px 18px 40px}
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:720px){
  body{font-size:14px}
  .app-header{padding:0 14px;height:64px}
  :root{--header-h:64px}
  .brand{min-width:auto}.brand img{width:94px}
  .header-context{display:none}
  .user-chip-copy{display:none}
  .main{padding:18px 14px 34px}
  .page-head{flex-direction:column}
  .page-actions{justify-content:flex-start}
  .page-title{font-size:24px}
  .grid-2,.grid-3,.grid-4,.form-grid{grid-template-columns:1fr}
  .form-group.full{grid-column:auto}
  .card-pad{padding:16px}
  .modal-backdrop{padding:10px}
}


/* 余白・配置ユーティリティ */
.mt-9 { margin-top: 9px; }
.mt-11 { margin-top: 11px; }
.mt-12 { margin-top: 12px; }
.mt-13 { margin-top: 13px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; }
.justify-end { justify-content: flex-end; }
.app-loading { margin: 40px; }
.profile-title { margin: 0; }
.copy-muted { color: var(--text-muted); line-height: 1.8; }
.copy-muted-small { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.7; }
.divider-spaced { margin: 20px 0; }
.offer-title { margin: 9px 0 0; }
