/* =====================================================
   リンク・スマイル 管理画面 デザインシステム
   ===================================================== */

:root {
  /* --- カラーパレット (柔らかいピンク系) --- */
  --c-primary:        #d4728a;
  --c-primary-hover:  #bf5f77;
  --c-primary-light:  #fbeef3;
  --c-primary-subtle: #f5d8e2;

  --c-secondary:      #7ab5a5;
  --c-secondary-light:#edf7f4;

  --c-bg:      #faf8f6;
  --c-surface: #ffffff;
  --c-border:  #e8ddd8;
  --c-border-soft: #f0e8e4;

  --c-text:       #3d3030;
  --c-text-muted: #9a8080;
  --c-text-light: #baaaa8;

  --c-success:       #5fa87a;
  --c-success-light: #edf7f0;
  --c-warning:       #c88c3a;
  --c-warning-light: #fef6e8;
  --c-danger:        #d45a5a;
  --c-danger-light:  #fde8e8;
  --c-info:          #5a8ad4;
  --c-info-light:    #e8f0fd;

  /* --- レイアウト --- */
  --sidebar-w:   240px;
  --topbar-h:    56px;

  /* --- タイポグラフィ --- */
  --font: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;

  /* --- 角丸 --- */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* --- 影 --- */
  --shadow-xs: 0 1px 3px rgba(160, 90, 110, 0.08);
  --shadow-sm: 0 2px 8px rgba(160, 90, 110, 0.10);
  --shadow-md: 0 4px 16px rgba(160, 90, 110, 0.14);
  --shadow-lg: 0 8px 32px rgba(160, 90, 110, 0.18);

  /* --- トランジション --- */
  --t: 0.2s ease;
  --t-slow: 0.35s ease;
}

/* ===== リセット / ベース ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.7;
  min-height: 100dvh;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

ul, ol { list-style: none; }

button { cursor: pointer; font-family: var(--font); }

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

/* ===== レイアウト ===== */
.layout {
  min-height: 100dvh;
}

/* ===== サイドバー ===== */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-slow);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--c-border-soft);
  flex-shrink: 0;
}

.brand-logo img,
.brand-logo svg {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 11px;
  color: var(--c-text-muted);
}

/* サイドバーナビ */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}

.sidebar-nav ul { padding: 0 8px; }

.sidebar-nav li { margin-bottom: 2px; }

.nav-item,
.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--c-text-muted);
  background: none;
  border: none;
  text-align: left;
  transition: background var(--t), color var(--t);
  text-decoration: none;
}

.nav-item:hover,
.nav-group-toggle:hover {
  background: var(--c-primary-light);
  color: var(--c-primary);
  text-decoration: none;
}

.nav-item.active,
.nav-group-toggle.active {
  background: var(--c-primary-light);
  color: var(--c-primary);
  font-weight: 600;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-label { flex: 1; }

.nav-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform var(--t);
}

.nav-chevron svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.nav-group.open > .nav-group-toggle .nav-chevron {
  transform: rotate(180deg);
}

/* サブメニュー */
.nav-children {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--t-slow);
  padding-left: 10px;
}

.nav-group.open > .nav-children {
  max-height: 600px;
}

.nav-child {
  display: block;
  padding: 7px 10px 7px 30px;
  font-size: 13px;
  color: var(--c-text-muted);
  border-radius: var(--r-sm);
  transition: background var(--t), color var(--t);
  text-decoration: none;
  position: relative;
}

.nav-child::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c-border);
}

.nav-child:hover,
.nav-child.active {
  background: var(--c-primary-light);
  color: var(--c-primary);
  text-decoration: none;
}

.nav-child.active::before { background: var(--c-primary); }

/* サイドバーフッター */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--c-border-soft);
  flex-shrink: 0;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  color: var(--c-text-muted);
  background: none;
  border: none;
  transition: background var(--t), color var(--t);
}

.btn-logout:hover {
  background: var(--c-danger-light);
  color: var(--c-danger);
}

.btn-logout svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===== メインエリア ===== */
.layout-main {
  margin-left: var(--sidebar-w);
  width: calc(100% - var(--sidebar-w));
  min-width: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* トップバー */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  box-shadow: var(--shadow-xs);
}

.topbar-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  border-radius: var(--r-sm);
  color: var(--c-text-muted);
  transition: background var(--t);
}

.topbar-menu-btn:hover { background: var(--c-primary-light); color: var(--c-primary); }

.topbar-menu-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text);
  flex: 1;
}

.topbar-right { margin-left: auto; }

.topbar-user {
  font-size: 13px;
  color: var(--c-text-muted);
  background: var(--c-primary-light);
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-weight: 500;
}

/* ページコンテンツ */
.page-content {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  width: 100%;
  min-width: 0;
}

/* ===== カード ===== */
.card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  min-width: 0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border-soft);
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
}

.card-body { padding: 20px; }

.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--c-border-soft);
  background: var(--c-bg);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== ボタン ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 500;
  border: 1.5px solid transparent;
  transition: background var(--t), color var(--t), border-color var(--t), box-shadow var(--t);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.5;
}

.btn:hover { text-decoration: none; }

.btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-primary {
  background: var(--c-primary);
  color: white;
  border-color: var(--c-primary);
}
.btn-primary:hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); color: white; }

.btn-secondary {
  background: var(--c-secondary);
  color: white;
  border-color: var(--c-secondary);
}
.btn-secondary:hover { opacity: 0.88; }

.btn-outline {
  background: transparent;
  color: var(--c-primary);
  border-color: var(--c-primary);
}
.btn-outline:hover { background: var(--c-primary-light); }

.btn-ghost {
  background: transparent;
  color: var(--c-text-muted);
  border-color: var(--c-border);
}
.btn-ghost:hover { background: var(--c-bg); color: var(--c-text); }

.btn-danger {
  background: var(--c-danger);
  color: white;
  border-color: var(--c-danger);
}
.btn-danger:hover { opacity: 0.88; }

.btn-danger-outline {
  background: transparent;
  color: var(--c-danger);
  border-color: var(--c-danger);
}
.btn-danger-outline:hover { background: var(--c-danger-light); }

.btn-success {
  background: var(--c-success);
  color: white;
  border-color: var(--c-success);
}
.btn-success:hover { opacity: 0.88; }

.btn-sm {
  padding: 5px 12px;
  font-size: 12.5px;
  border-radius: var(--r-sm);
}

.btn-lg {
  padding: 11px 24px;
  font-size: 15px;
}

.btn:disabled, .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== フォーム ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text);
}

.form-label .required {
  color: var(--c-danger);
  margin-left: 3px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: 14px;
  color: var(--c-text);
  background: var(--c-surface);
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
}

.form-control:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(212, 114, 138, 0.12);
}

.form-control::placeholder { color: var(--c-text-light); }

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

select.form-control { cursor: pointer; }

.form-hint {
  font-size: 12px;
  color: var(--c-text-muted);
  line-height: 1.5;
}

.form-error {
  font-size: 12px;
  color: var(--c-danger);
}

/* チェックボックス・ラジオ */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--c-primary);
  cursor: pointer;
}

/* グリッドレイアウト */
.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.content-grid {
  display: grid;
  grid-template-columns: minmax(320px, var(--form-col-w, 400px)) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.content-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

/* ===== テーブル ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  max-width: 100%;
}

table.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.file-list-table {
  min-width: 0;
  table-layout: fixed;
}

.file-list-table th:first-child,
.file-list-table td:first-child {
  width: auto;
}

.file-list-table th:nth-child(2),
.file-list-table td:nth-child(2) {
  width: 70px;
}

.file-list-table th.col-actions,
.file-list-table td.col-actions {
  width: 76px;
  text-align: right;
}

.data-table th,
.data-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--c-border-soft);
  vertical-align: middle;
}

.data-table thead th {
  background: var(--c-bg);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-bottom: 1px solid var(--c-border);
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover td { background: var(--c-primary-light); }

.data-table tbody tr.disabled td { background: #f5f0ef; color: var(--c-text-muted); }

.data-table tbody tr.period-out td { background: #fde8e8; }

.data-table .col-actions { white-space: nowrap; width: 1%; }

.data-table .col-status { white-space: nowrap; width: 1%; text-align: center; }

/* テーブルの行ドラッグハンドル */
.drag-handle {
  cursor: grab;
  color: var(--c-text-light);
  padding: 0 4px;
}

.drag-handle:active { cursor: grabbing; }

.drag-handle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ===== バッジ ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--r-full);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary  { background: var(--c-primary-light);  color: var(--c-primary); }
.badge-success  { background: var(--c-success-light);  color: var(--c-success); }
.badge-warning  { background: var(--c-warning-light);  color: var(--c-warning); }
.badge-danger   { background: var(--c-danger-light);   color: var(--c-danger); }
.badge-muted    { background: var(--c-bg);             color: var(--c-text-muted); border: 1px solid var(--c-border); }

/* カテゴリバッジ (カラー設定可能) */
.badge-color {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
}

/* ===== モーダル ===== */
.app-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  border: none;
  border-radius: var(--r-xl);
  padding: 0;
  box-shadow: var(--shadow-lg);
  max-width: min(560px, 95vw);
  max-height: calc(100dvh - 32px);
  width: 100%;
  height: fit-content;
}

.app-dialog::backdrop {
  background: rgba(60, 30, 40, 0.35);
  backdrop-filter: blur(2px);
}

.app-modal { max-width: min(760px, 95vw); }

.app-modal .dialog-body {
  max-height: 70vh;
  overflow-y: auto;
  padding: 20px 24px;
}

.dialog-inner { display: flex; flex-direction: column; min-height: 0; }

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--c-border-soft);
}

.dialog-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text);
}

.dialog-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: var(--r-full);
  color: var(--c-text-muted);
  transition: background var(--t), color var(--t);
}

.dialog-close:hover { background: var(--c-danger-light); color: var(--c-danger); }

.dialog-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.dialog-body { padding: 20px 24px; }

.dialog-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--c-border-soft);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* confirm dialog */
#confirmDialog .dialog-inner { padding: 28px 24px 20px; gap: 20px; }
.dialog-message { font-size: 14.5px; line-height: 1.8; text-align: center; }
.dialog-actions { display: flex; justify-content: center; gap: 10px; }

/* ===== トースト ===== */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toastIn 0.3s ease forwards;
  max-width: 360px;
  border: 1px solid transparent;
}

.toast.removing { animation: toastOut 0.3s ease forwards; }

.toast-success { background: var(--c-success-light); color: var(--c-success); border-color: #c0e8c8; }
.toast-error   { background: var(--c-danger-light);  color: var(--c-danger);  border-color: #f0c0c0; }
.toast-warning { background: var(--c-warning-light); color: var(--c-warning); border-color: #f0d8a0; }
.toast-info    { background: var(--c-info-light);    color: var(--c-info);    border-color: #b8d0f0; }

.toast svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ===== スピナー ===== */
.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250, 248, 246, 0.7);
  backdrop-filter: blur(1px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-overlay.hidden { display: none; }

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== ページ固有コンポーネント ===== */

/* ページヘッダー */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.page-header-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
}

/* ダッシュボードカードグリッド */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.dash-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: var(--c-text);
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
  box-shadow: var(--shadow-xs);
}

.dash-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--c-primary-subtle);
  text-decoration: none;
  color: var(--c-text);
}

.dash-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  background: var(--c-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-card-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--c-primary);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dash-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
}

.dash-card-desc {
  font-size: 11.5px;
  color: var(--c-text-muted);
  line-height: 1.5;
}

/* ファイルドロップゾーン */
.dropzone {
  border: 2px dashed var(--c-border);
  border-radius: var(--r-lg);
  padding: 36px 24px;
  text-align: center;
  color: var(--c-text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--c-primary);
  background: var(--c-primary-light);
}

.dropzone svg {
  width: 40px;
  height: 40px;
  stroke: var(--c-text-light);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dropzone.dragover svg { stroke: var(--c-primary); }

/* カラーピッカープレビュー */
.color-preview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(0,0,0,0.08);
}

.file-preview-row {
  cursor: pointer;
}

.file-preview-row .col-actions {
  cursor: default;
}

.file-preview-row .col-actions .btn {
  cursor: pointer;
}

.file-preview-name {
  color: var(--c-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-row:hover .file-preview-name {
  text-decoration: underline;
}

.file-preview-frame iframe {
  display: block;
  width: 100%;
  height: min(70vh, 720px);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg);
}

.file-preview-image {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 240px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 16px;
}

.file-preview-image img {
  max-width: 100%;
  max-height: min(70vh, 720px);
  object-fit: contain;
}

/* 表示期間フォーム */
.period-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 並べ替えゴースト */
.sortable-ghost { opacity: 0.4; background: var(--c-primary-light); }
.sortable-drag   { background: white; box-shadow: var(--shadow-md); }

/* ===== ユーティリティ ===== */
.hidden  { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-muted   { color: var(--c-text-muted); }
.text-danger  { color: var(--c-danger); }
.text-success { color: var(--c-success); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-sm      { font-size: 12.5px; }
.fw-600       { font-weight: 600; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.d-flex    { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* ===== レスポンシブ ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(60,30,40,0.4);
  z-index: 99;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-overlay.open { display: block; }

  .layout-main {
    margin-left: 0;
    width: 100%;
  }

  .topbar { padding: 0 16px; }
  .topbar-menu-btn { display: flex; }

  .page-content { padding: 16px; }

  .dashboard-grid { grid-template-columns: 1fr; }

  .form-grid-2 { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .content-grid,
  .content-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ===== ログインページ ===== */
.login-page {
  min-height: 100dvh;
  background: linear-gradient(135deg, #faf8f6 0%, #f5e8ed 50%, #faf8f6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--c-border);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .logo-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--c-primary-light);
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo .logo-circle img,
.login-logo .logo-circle svg {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.login-logo h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-primary);
}

.login-logo p {
  font-size: 12.5px;
  color: var(--c-text-muted);
  margin-top: 4px;
}

.login-error {
  background: var(--c-danger-light);
  color: var(--c-danger);
  border: 1px solid #f0c0c0;
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}
