/* ===================================================
   九州総合歯科グループ — admin.css
   =================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Noto Sans JP', sans-serif;
  background: #f0f2f5;
  color: #2d2d2d;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }
textarea, input, select { font-family: inherit; }

:root {
  --primary: #1a6b8a;
  --primary-dark: #145770;
  --primary-light: #e8f4f9;
  --accent: #2dab7c;
  --accent-light: #e8f8f3;
  --danger: #e53e3e;
  --danger-light: #fff5f5;
  --warn: #dd6b20;
  --warn-light: #fffaf0;
  --text: #2d2d2d;
  --text-light: #718096;
  --border: #e2e8f0;
  --bg: #f0f2f5;
  --white: #fff;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --header-h: 60px;
  --sidebar-w: 220px;
}

/* ===================================================
   ヘッダー
   =================================================== */
.admin-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--primary-dark);
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.admin-header-inner {
  max-width: 100%;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.admin-header-logo .logo-mark {
  font-size: 1.4rem;
  opacity: 0.9;
}
.logo-main {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
}
.logo-sub {
  display: block;
  font-size: 0.72rem;
  opacity: 0.7;
  font-weight: 400;
}
.btn-header-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.85);
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.3);
  transition: all 0.2s;
}
.btn-header-link:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ===================================================
   レイアウト
   =================================================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--header-h);
}

/* ===================================================
   サイドバー
   =================================================== */
.admin-sidebar {
  width: var(--sidebar-w);
  background: #1e2a3a;
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  z-index: 50;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}
.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.6);
  font-size: 0.88rem;
  font-weight: 500;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: all 0.2s;
  position: relative;
}
.sidebar-btn i { font-size: 0.95rem; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-btn span { flex: 1; }
.sidebar-btn:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
.sidebar-btn.active { background: var(--primary); color: #fff; }
.badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 50px;
  min-width: 22px;
  text-align: center;
}
.sidebar-note {
  margin: auto 12px 12px;
  padding: 12px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.sidebar-note i { color: rgba(255,255,255,0.4); font-size: 0.85rem; margin-top: 2px; flex-shrink: 0; }
.sidebar-note p { font-size: 0.72rem; color: rgba(255,255,255,0.45); line-height: 1.6; }

/* ===================================================
   メインコンテンツ
   =================================================== */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px 60px;
  min-width: 0;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-header {
  margin-bottom: 28px;
}
.panel-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.panel-header h1 i { color: var(--primary); }
.panel-header p { font-size: 0.88rem; color: var(--text-light); }
.required-note { margin-left: 12px; font-size: 0.8rem; }

/* ===================================================
   フォームレイアウト（2カラム）
   =================================================== */
.form-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: flex-start;
}

/* ===================================================
   フォームスタイル
   =================================================== */
.case-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.form-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.guideline-badge {
  font-size: 0.72rem;
  background: var(--warn-light);
  color: var(--warn);
  border: 1px solid rgba(221,107,32,0.3);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: auto;
}
.optional-badge {
  font-size: 0.72rem;
  background: #f0f0f0;
  color: #888;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}
.form-group:last-child { margin-bottom: 0; }
.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.form-group input[type="text"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.5;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,107,138,0.12);
}
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(229,62,62,0.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.hint {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.5;
}
.guideline-hint {
  color: var(--warn);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.req {
  display: inline-block;
  font-size: 0.68rem;
  background: var(--danger);
  color: #fff;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 4px;
}
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-icon i {
  position: absolute;
  left: 11px;
  color: #e1306c;
  font-size: 1rem;
  pointer-events: none;
}
.input-with-icon input {
  padding-left: 34px;
  width: 100%;
  padding-top: 9px;
  padding-bottom: 9px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-with-icon input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,107,138,0.12);
}

/* ===================================================
   写真アップロード
   =================================================== */
.photo-note {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.photo-note i { color: var(--primary); }
.photo-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.photo-upload-group { flex: 1; }
.photo-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 3px;
  display: inline-block;
}
.before-label { background: #f0f0f0; color: #555; }
.after-label { background: var(--accent-light); color: var(--accent); }
.photo-arrow {
  color: var(--primary);
  font-size: 1.2rem;
  opacity: 0.5;
  flex-shrink: 0;
  margin-top: 24px;
}
.drop-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fafafa;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2;
}
.drop-zone-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-light);
  pointer-events: none;
  padding: 12px;
  text-align: center;
}
.drop-zone-content i { font-size: 1.8rem; opacity: 0.5; }
.drop-zone-content p { font-size: 0.78rem; font-weight: 500; line-height: 1.4; }
.drop-zone-content span { font-size: 0.68rem; opacity: 0.7; }
.drop-zone-preview {
  position: absolute;
  inset: 0;
  z-index: 3;
}
.drop-zone-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.remove-photo {
  position: absolute;
  top: 6px; right: 6px;
  width: 26px; height: 26px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border-radius: 50%;
  border: none;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 4;
}
.remove-photo:hover { background: var(--danger); }

/* ===================================================
   フォームアクション
   =================================================== */
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 4px;
}
.btn-save {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 14px rgba(26,107,138,0.35);
  transition: all 0.2s;
}
.btn-save:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-cancel {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--text-light);
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  transition: all 0.2s;
}
.btn-cancel:hover { border-color: var(--danger); color: var(--danger); }
.form-errors {
  background: var(--danger-light);
  border: 1px solid rgba(229,62,62,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 12px;
}
.form-errors li {
  font-size: 0.84rem;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
}
.form-errors li::before { content: '✕'; font-weight: 700; }

/* ===================================================
   プレビューパネル
   =================================================== */
.preview-panel {
  position: sticky;
  top: calc(var(--header-h) + 28px);
}
.preview-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.preview-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}
.preview-header h2 i { color: var(--primary); }
.preview-note { font-size: 0.72rem; color: var(--text-light); }
.preview-card-wrap {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 16px;
}
.preview-case-card {}
.preview-img-area {
  background: #f7f8fa;
  padding: 14px 12px 10px;
}
.preview-before-after {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pba-item { flex: 1; }
.pba-label {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 2px 7px;
  border-radius: 3px;
  margin-bottom: 4px;
}
.pba-label.before { background: #f0f0f0; color: #666; }
.pba-label.after { background: var(--accent-light); color: var(--accent); }
.pba-img {
  background: #e8edf0;
  border-radius: 6px;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #bbb;
  font-size: 0.65rem;
  overflow: hidden;
}
.pba-img i { font-size: 1.2rem; }
.pba-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pba-arrow { color: var(--primary); opacity: 0.5; font-size: 0.85rem; flex-shrink: 0; }
.preview-body { padding: 14px 16px 18px; }
.preview-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 8px;
  background: var(--primary-light);
  color: var(--primary);
}
.preview-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text);
  line-height: 1.45;
}
.preview-chief {
  font-size: 0.76rem;
  color: var(--text-light);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
  line-height: 1.5;
}
.preview-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.pmeta-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--text-light);
}
.pmeta-item i { color: var(--primary); opacity: 0.7; margin-top: 2px; font-size: 0.72rem; }
.preview-doctor {
  background: var(--primary-light);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.preview-doctor-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.preview-doctor-inner > i { color: var(--primary); font-size: 1rem; }
.prev-doctor-label { display: block; font-size: 0.68rem; color: var(--text-light); }
.prev-doctor-name { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.prev-instagram {
  margin-left: auto;
  color: #e1306c;
  font-size: 1.2rem;
}
.prev-doctor-comment {
  font-size: 0.76rem;
  color: var(--text-light);
  line-height: 1.6;
  font-style: italic;
}
.preview-guideline-note {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 0.68rem;
  color: var(--text-light);
  line-height: 1.5;
  background: #fafafa;
  padding: 6px 8px;
  border-radius: 4px;
  border-left: 2px solid var(--border);
}
.preview-guideline-note i { color: var(--primary); opacity: 0.6; font-size: 0.72rem; margin-top: 1px; flex-shrink: 0; }

/* ガイドラインチェック */
.guideline-check {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.guideline-check h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.guideline-check h3 i { color: var(--primary); }
#check-list { display: flex; flex-direction: column; gap: 6px; }
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-light);
}
.check-item i { font-size: 0.85rem; flex-shrink: 0; }
.check-item.ok i { color: var(--accent); }
.check-item.ng i { color: var(--danger); }
.check-item.ok { color: var(--text); }
.check-item.ng { color: var(--danger); }

/* ===================================================
   症例一覧
   =================================================== */
.list-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.list-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 8px 16px;
  flex: 1;
  min-width: 200px;
}
.list-search i { color: var(--text-light); }
.list-search input {
  border: none;
  outline: none;
  font-size: 0.88rem;
  color: var(--text);
  background: transparent;
  flex: 1;
}
.list-filter select {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 0.88rem;
  background: var(--white);
  color: var(--text);
  outline: none;
}
.cases-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.empty-state i { font-size: 2.5rem; opacity: 0.3; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 0.9rem; line-height: 1.7; }

/* 一覧カード */
.list-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.list-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.list-card-img {
  display: flex;
  background: #f5f5f5;
  padding: 10px 10px 8px;
  gap: 6px;
  align-items: center;
}
.list-card-thumb {
  flex: 1;
  aspect-ratio: 4/3;
  background: #e8edf0;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 0.7rem;
  flex-direction: column;
  gap: 3px;
}
.list-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-card-thumb i { font-size: 1.1rem; }
.list-card-arrow { color: var(--primary); opacity: 0.4; font-size: 0.8rem; flex-shrink: 0; }
.list-card-body { padding: 12px 14px 14px; }
.list-card-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
  background: var(--primary-light);
  color: var(--primary);
}
.list-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}
.list-card-meta {
  font-size: 0.76rem;
  color: var(--text-light);
  margin-bottom: 10px;
  line-height: 1.5;
}
.list-card-doctor {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 10px;
}
.list-card-doctor i { color: var(--primary); opacity: 0.7; }
.list-card-actions {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.btn-edit, .btn-delete {
  flex: 1;
  padding: 7px 0;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s;
}
.btn-edit { background: var(--primary-light); color: var(--primary); }
.btn-edit:hover { background: var(--primary); color: #fff; }
.btn-delete { background: var(--danger-light); color: var(--danger); }
.btn-delete:hover { background: var(--danger); color: #fff; }

/* ===================================================
   HTMLコード出力
   =================================================== */
.export-panel {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.export-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.export-option-group label:first-child {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.radio-group { display: flex; gap: 16px; }
.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  cursor: pointer;
}
.radio-label input { accent-color: var(--primary); }
.btn-generate {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 11px 24px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 14px rgba(45,171,124,0.3);
  transition: all 0.2s;
}
.btn-generate:hover { background: #27976d; transform: translateY(-1px); }
.export-select-area {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.export-select-note { font-size: 0.82rem; color: var(--text-light); margin-bottom: 10px; }
.export-check-list { display: flex; flex-direction: column; gap: 6px; }
.export-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--white);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
}
.export-check-item input { accent-color: var(--primary); }
.export-output {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.export-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--accent-light);
  border-bottom: 1px solid var(--border);
}
.export-output-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 7px;
}
.btn-copy {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--accent);
  color: #fff;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  transition: all 0.2s;
}
.btn-copy:hover { background: #27976d; }
.btn-copy.copied { background: var(--primary); }
.export-instructions {
  padding: 14px 18px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-light);
}
.export-instructions p { font-weight: 700; color: var(--text); margin-bottom: 6px; }
.export-instructions ol { padding-left: 18px; }
.export-instructions li { margin-bottom: 4px; line-height: 1.6; }
.export-code {
  display: block;
  width: 100%;
  min-height: 280px;
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 0.76rem;
  line-height: 1.6;
  color: #2d3748;
  background: #1a202c;
  color: #a0aec0;
  border: none;
  resize: vertical;
  outline: none;
}
.export-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}
.export-empty i { font-size: 2rem; opacity: 0.3; margin-bottom: 10px; display: block; }

/* ===================================================
   モーダル
   =================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 28px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.modal-icon {
  width: 56px; height: 56px;
  background: var(--warn-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--warn);
  font-size: 1.4rem;
}
.modal-box h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.modal-box p { font-size: 0.88rem; color: var(--text-light); margin-bottom: 4px; font-weight: 600; }
.modal-warn { font-size: 0.8rem !important; color: var(--danger) !important; font-weight: 400 !important; margin-bottom: 20px !important; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.btn-modal-cancel {
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-light);
  transition: all 0.2s;
}
.btn-modal-cancel:hover { border-color: var(--text-light); }
.btn-modal-delete {
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 12px rgba(229,62,62,0.3);
  transition: all 0.2s;
}
.btn-modal-delete:hover { background: #c53030; }

/* ===================================================
   トースト
   =================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1a202c;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.success { background: var(--accent); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }

/* ===================================================
   タグカラー（プレビュー・一覧共通）
   =================================================== */
.tag-implant    { background: #e8f4f9; color: #1a6b8a; }
.tag-wire       { background: #f3e8f9; color: #7a3b9e; }
.tag-invisalign { background: #e8f4f9; color: #1a7a8a; }
.tag-partial    { background: #f0e8f9; color: #6b3b9e; }
.tag-kids       { background: #fff4e8; color: #c97c1a; }
.tag-ceramic    { background: #fdf5e8; color: #a07820; }
.tag-root       { background: #e8f9ef; color: #1a8a5a; }
.tag-insurance  { background: #e8f4e8; color: #3a7a3a; }

/* ===================================================
   レスポンシブ
   =================================================== */
@media (max-width: 1200px) {
  .form-layout { grid-template-columns: 1fr 320px; }
}
@media (max-width: 960px) {
  .form-layout { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; padding: 20px 16px 60px; }
  .form-row-2 { grid-template-columns: 1fr; }
  .photo-upload-row { flex-direction: column; }
  .photo-arrow { transform: rotate(90deg); margin: 0 auto; }
}
