/* ============================================================
   SAFETY EDUCATION SYSTEM — Design System
   ============================================================ */

:root {
  /* 深松組ブランドカラー（ロゴ: ネイビー＋グリーン）。KYアプリと共通。 */
  --primary:       #1b3a8f;
  --primary-dark:  #142c6e;
  --primary-light: #e8edf9;
  --success:       #2f9e44;
  --success-light: #e9f6ec;
  --warning:       #c46a00;
  --warning-light: #FEF3C7;
  --error:         #c0392b;
  --error-light:   #FEE2E2;
  --info:          #1b3a8f;

  --bg:            #f4f6fa;
  --card-bg:       #FFFFFF;
  --border:        #E3E8F0;
  --border-light:  #F1F5F9;

  --text-primary:   #1F2733;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;

  --header-bg:    #142c6e;
  --sidebar-bg:   #16285c;
  --sidebar-text: #CBD5E1;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow:    0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);

  --transition: 150ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans',
               'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Meiryo', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

#app { min-height: 100vh; }

/* ─── ADMIN LAYOUT ─────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 256px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}

.admin-main {
  flex: 1;
  margin-left: 256px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.admin-content { flex: 1; padding: 28px 28px 40px; background: var(--bg); }

/* sidebar */
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 10px;
}
.sidebar-logo-text { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.3; }
.sidebar-logo-sub  { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px; }

.sidebar-section {
  padding: 16px 20px 6px;
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase; letter-spacing: 0.1em;
}

.sidebar-nav { flex: 1; padding: 4px 0; }

.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  cursor: pointer;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all var(--transition);
  user-select: none;
}
.sidebar-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-item.active {
  background: rgba(37,99,235,0.18);
  color: #fff;
  border-left-color: var(--primary);
  font-weight: 500;
}
.sidebar-item svg { flex-shrink: 0; opacity: 0.65; }
.sidebar-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sidebar-user-name { font-size: 13px; color: #fff; font-weight: 500; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,0.45); }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ─── LEARNER LAYOUT ───────────────────────────────────── */
.learner-page { display: flex; flex-direction: column; min-height: 100vh; }

.learner-header {
  background: var(--header-bg);
  color: #fff;
  padding: 0 20px;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  flex-shrink: 0;
}
.learner-header-logo { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.learner-header-right { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.learner-header-user { opacity: 0.85; }

.learner-content {
  flex: 1;
  padding: 24px 20px 40px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

/* ─── LOGIN ────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(145deg, #142c6e 0%, #1b3a8f 60%, #2f56c0 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo-icon {
  width: 68px; height: 68px;
  background: var(--primary);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 30px;
  box-shadow: 0 4px 16px rgba(37,99,235,0.4);
}
.login-title    { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.login-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.login-help     { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 20px; }

/* ─── CARDS ────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.card-body   { padding: 20px 24px; }
.card-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

/* ─── BUTTONS ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px;
  border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
  font-family: inherit;
  line-height: 1;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803D; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #B45309; }
.btn-danger  { background: var(--error); color: #fff; }
.btn-danger:hover  { background: #B91C1C; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}
.btn-ghost:hover { background: var(--border-light); }
.btn-sm  { padding: 6px 14px; font-size: 13px; min-height: 36px; }
.btn-lg  { padding: 14px 28px; font-size: 16px; min-height: 52px; border-radius: var(--radius-lg); }
.btn-xl  { padding: 16px 32px; font-size: 16px; min-height: 56px; border-radius: var(--radius-lg); font-weight: 700; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ─── BADGES ───────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px; font-weight: 600;
  white-space: nowrap; line-height: 1.4;
}
.badge-blue   { background: var(--primary-light); color: var(--primary-dark); }
.badge-green  { background: var(--success-light); color: #166534; }
.badge-orange { background: var(--warning-light); color: #92400E; }
.badge-red    { background: var(--error-light);   color: #991B1B; }
.badge-gray   { background: #F1F5F9; color: var(--text-secondary); }
.badge-purple { background: #EDE9FE; color: #5B21B6; }
.badge-teal   { background: #CCFBF1; color: #0F766E; }

/* ─── FORM ──────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.form-label-required::after { content: ' *'; color: var(--error); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px; color: var(--text-primary);
  background: var(--card-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 44px;
  font-family: inherit;
  appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.form-textarea { min-height: 90px; resize: vertical; }
.form-help  { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--error); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── TABLE ─────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table thead { background: #F8FAFC; }
.data-table th {
  padding: 11px 16px;
  text-align: left;
  font-weight: 700; font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: #F8FAFC; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ─── STAT CARDS ────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card-label { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.stat-card-value { font-size: 34px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-card-sub   { font-size: 12px; color: var(--text-muted); }
.stat-card.blue   { border-top: 3px solid var(--primary); }
.stat-card.green  { border-top: 3px solid var(--success); }
.stat-card.orange { border-top: 3px solid var(--warning); }
.stat-card.red    { border-top: 3px solid var(--error); }
.stat-card.blue   .stat-card-value { color: var(--primary); }
.stat-card.green  .stat-card-value { color: var(--success); }
.stat-card.orange .stat-card-value { color: var(--warning); }
.stat-card.red    .stat-card-value { color: var(--error); }

/* ─── PROGRESS ──────────────────────────────────────────── */
.progress-bar { height: 8px; background: var(--border-light); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 100px; transition: width 0.6s ease; }
.progress-fill-blue   { background: var(--primary); }
.progress-fill-green  { background: var(--success); }
.progress-fill-orange { background: var(--warning); }

/* ─── MODAL ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 580px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.2s ease;
}
.modal-lg { max-width: 780px; }
.modal-xl { max-width: 960px; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.modal-body  { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-light);
  display: flex; justify-content: flex-end; gap: 10px;
  flex-shrink: 0;
}

/* ─── TOAST ─────────────────────────────────────────────── */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 380px;
  font-size: 14px;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--error); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info    { border-left: 4px solid var(--primary); }

/* ─── PAGE HEADER ───────────────────────────────────────── */
.page-header { margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-header-left {}
.page-title    { font-size: 22px; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.breadcrumb    { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }

/* ─── FILTER BAR ────────────────────────────────────────── */
.filter-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.filter-bar .form-input, .filter-bar .form-select { flex: 1; min-width: 130px; max-width: 200px; }
.filter-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }

/* ─── MATERIAL CARDS (learner) ──────────────────────────── */
.material-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  transition: box-shadow var(--transition), transform var(--transition);
  margin-bottom: 12px;
}
.material-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.material-card.completed { border-left: 4px solid var(--success); }
.material-card.in-progress { border-left: 4px solid var(--primary); }

.material-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.icon-pdf   { background: #FEE2E2; color: #DC2626; }
.icon-video { background: #e8edf9; color: #1b3a8f; }
.icon-audio { background: #e9f6ec; color: #2f9e44; }

.material-info { flex: 1; min-width: 0; }
.material-title {
  font-weight: 700; color: var(--text-primary); font-size: 15px;
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.material-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.material-action { flex-shrink: 0; }

/* ─── VIDEO PLAYER ──────────────────────────────────────── */
.video-wrapper {
  background: #000;
  border-radius: var(--radius-lg);
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  max-width: 100%;
}
.video-mock {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0a0a1a, #1a1a3a);
  color: rgba(255,255,255,0.2);
  font-size: 60px;
  position: relative;
}
.video-title-bar {
  position: absolute; top: 0; left: 0; right: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.75), transparent);
  padding: 16px;
  color: #fff; font-size: 14px; font-weight: 600;
}
.video-controls-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 12px 16px 14px;
}
.video-progress-row { margin-bottom: 10px; }
.video-progress-track {
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 100px;
  cursor: not-allowed;
  position: relative;
}
.video-progress-fill {
  height: 100%; background: var(--primary);
  border-radius: 100px;
  transition: width 1s linear;
}
.video-controls-row {
  display: flex; align-items: center; gap: 12px; color: #fff;
}
.video-btn {
  background: none; border: none; color: #fff; cursor: pointer;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  transition: background var(--transition);
}
.video-btn:hover { background: rgba(255,255,255,0.15); }
.video-time { font-size: 13px; font-family: monospace; }
.video-no-skip-badge {
  margin-left: auto;
  background: rgba(239,68,68,0.85);
  color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 4px;
}

/* ─── AUDIO PLAYER ──────────────────────────────────────── */
.audio-player {
  background: linear-gradient(145deg, #142c6e, #1b3a8f);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  color: #fff;
  text-align: center;
}
.audio-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.audio-desc  { font-size: 13px; opacity: 0.65; margin-bottom: 20px; }
.audio-wave {
  display: flex; align-items: center; justify-content: center;
  gap: 3px; height: 56px; margin-bottom: 20px;
}
.wave-bar {
  width: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.4);
  transition: height 0.15s ease;
}
.wave-bar.active { background: rgba(255,255,255,0.9); }
.audio-progress-row { margin-bottom: 12px; }
.audio-progress-track {
  height: 6px; background: rgba(255,255,255,0.25);
  border-radius: 100px; cursor: not-allowed; overflow: hidden;
}
.audio-progress-fill { height: 100%; background: #fff; border-radius: 100px; transition: width 1s linear; }
.audio-time-row { display: flex; justify-content: space-between; font-size: 12px; opacity: 0.7; margin-bottom: 20px; }
.audio-controls { display: flex; align-items: center; justify-content: center; gap: 20px; }
.audio-play-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #fff;
  border: none; color: var(--primary);
  font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  transition: transform var(--transition), box-shadow var(--transition);
}
.audio-play-btn:hover { transform: scale(1.07); box-shadow: 0 6px 24px rgba(0,0,0,0.45); }
.audio-no-skip { font-size: 11px; opacity: 0.55; margin-top: 12px; }

/* ─── PDF VIEWER ────────────────────────────────────────── */
.pdf-wrapper {
  background: #525659;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.pdf-toolbar {
  background: #3A3D40;
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between;
  color: #fff; font-size: 13px;
}
.pdf-toolbar-info { display: flex; align-items: center; gap: 16px; }
.pdf-scroll-area {
  height: 480px;
  overflow-y: auto;
  padding: 16px;
  background: #525659;
  scroll-behavior: smooth;
}
.pdf-page {
  background: #fff;
  border-radius: 3px;
  padding: 36px 44px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  min-height: 360px;
}
.pdf-page-num { font-size: 11px; color: #aaa; margin-bottom: 16px; }
.pdf-page-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: #333; }
.pdf-page-text  { font-size: 14px; line-height: 1.9; color: #444; }
.pdf-completion-bar {
  background: #3A3D40;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px; color: #fff; font-size: 12px;
}
.pdf-completion-condition {
  font-size: 12px;
  background: rgba(255,255,255,0.1);
  padding: 4px 10px;
  border-radius: 100px;
  margin-left: auto;
}
.pdf-completion-condition.met { background: rgba(22,163,74,0.3); color: #86efac; }

/* ─── HTML COURSE VIEWER ────────────────────────────────── */
.html-course-page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}
.html-material-shell {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.html-material-frame {
  display: block;
  width: 100%;
  min-height: 320px;
  border: 0;
  background: #fff;
  overflow: hidden;
}
@media (max-width: 560px) {
  .html-course-page {
    padding: 12px 8px 20px;
    max-width: none;
  }
  .html-material-shell {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .html-material-frame {
    min-height: 360px;
  }
}

/* ─── TEST ──────────────────────────────────────────────── */
.test-header {
  background: var(--header-bg);
  color: #fff; padding: 20px 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.test-q-number { font-size: 11px; font-weight: 700; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.test-question-text { font-size: 17px; font-weight: 700; line-height: 1.5; }
.test-choices { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.test-choice {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 15px; background: var(--card-bg);
}
.test-choice:hover { border-color: var(--primary); background: var(--primary-light); }
.test-choice.selected { border-color: var(--primary); background: var(--primary-light); }
.test-choice.correct  { border-color: var(--success); background: var(--success-light); }
.test-choice.wrong    { border-color: var(--error);   background: var(--error-light); }
.choice-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  font-size: 12px; font-weight: 700;
}
.test-choice.selected .choice-dot { border-color: var(--primary); background: var(--primary); color: #fff; }
.test-choice.correct  .choice-dot { border-color: var(--success); background: var(--success); color: #fff; }
.test-choice.wrong    .choice-dot { border-color: var(--error);   background: var(--error);   color: #fff; }

.test-result-circle {
  width: 120px; height: 120px;
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  font-size: 36px;
}
.test-result-circle.pass { background: var(--success-light); border: 4px solid var(--success); }
.test-result-circle.fail { background: var(--error-light); border: 4px solid var(--error); }
.test-result-label { font-size: 14px; font-weight: 700; margin-top: 4px; }
.test-result-circle.pass .test-result-label { color: var(--success); }
.test-result-circle.fail .test-result-label { color: var(--error); }

/* ─── UPLOAD AREA ───────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-icon { font-size: 44px; margin-bottom: 12px; opacity: 0.5; }

/* ─── CSV BULK IMPORT ───────────────────────────────────── */
.step-indicator { display: flex; align-items: center; margin-bottom: 28px; }
.step-item { display: flex; align-items: center; gap: 10px; }
.step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  background: var(--border-light); color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition);
}
.step-item.active .step-num { background: var(--primary); color: #fff; }
.step-item.done   .step-num { background: var(--success); color: #fff; }
.step-text { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.step-item.active .step-text { color: var(--primary); }
.step-item.done   .step-text { color: var(--success); }
.step-connector { flex: 1; height: 2px; background: var(--border); margin: 0 6px; }
.step-connector.done { background: var(--success); }

.import-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.import-summary-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  text-align: center;
}
.import-summary-val  { font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.import-summary-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }

.csv-row-new    { background: #F0FDF4 !important; }
.csv-row-update { background: #EFF6FF !important; }
.csv-row-error  { background: #FEF2F2 !important; }
.csv-row-warn   { background: #FFFBEB !important; }

/* ─── REPORT CARDS ──────────────────────────────────────── */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.report-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
  transition: box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}
.report-card:hover { box-shadow: var(--shadow-md); }
.report-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.report-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.report-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── NOTICE ────────────────────────────────────────────── */
.notice-item {
  background: var(--primary-light);
  border: 1px solid #BFDBFE;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 10px;
  display: flex; align-items: flex-start; gap: 12px;
}
.notice-item.warning {
  background: var(--warning-light);
  border-color: #FDE68A;
  border-left-color: var(--warning);
}
.notice-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.notice-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.notice-body  { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.notice-date  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ─── PACKAGE / MATERIAL MANAGEMENT ───────────────────────*/
.list-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 10px;
  transition: box-shadow var(--transition);
}
.list-item:hover { box-shadow: var(--shadow-md); }
.list-item-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.list-item-info { flex: 1; min-width: 0; }
.list-item-title { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.list-item-meta  { font-size: 12px; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; }
.list-item-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

/* ─── TABS ──────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--border); gap: 0; margin-bottom: 24px; overflow-x: auto; }
.tab-item {
  padding: 10px 20px;
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
}
.tab-item:hover  { color: var(--primary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

/* ─── HAMBURGER ─────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column; gap: 4px;
  padding: 8px; cursor: pointer;
  background: none; border: none;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text-secondary); border-radius: 2px; }

/* ─── EMPTY STATE ───────────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 24px; color: var(--text-muted); }
.empty-state-icon  { font-size: 52px; margin-bottom: 14px; opacity: 0.35; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state-desc  { font-size: 13px; }

/* ─── UTILS ─────────────────────────────────────────────── */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end   { justify-content: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.wrap  { flex-wrap: wrap; }
.mb-2  { margin-bottom: 8px; }
.mb-3  { margin-bottom: 12px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.mb-8  { margin-bottom: 32px; }
.mt-2  { margin-top: 8px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.text-sm    { font-size: 13px; }
.text-xs    { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-bold    { font-weight: 700; }
.font-semibold{ font-weight: 600; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.section-label { font-size: 13px; font-weight: 700; color: var(--text-secondary); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.divider { height: 1px; background: var(--border-light); margin: 20px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 100px; font-size: 12px; background: var(--border-light); color: var(--text-secondary); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.app-home-btn {
  background: rgba(255,255,255,0.14);
  color: #fff;
  min-height: 34px;
  gap: 6px;
  white-space: nowrap;
}
.app-home-btn:hover { background: rgba(255,255,255,0.22); }

/* ─── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-sidebar  { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main     { margin-left: 0; }
  .sidebar-overlay { display: block; pointer-events: none; }
  .sidebar-overlay.visible { pointer-events: all; }
  .hamburger      { display: flex; }
  .stat-grid      { grid-template-columns: repeat(2, 1fr); }
  .form-row       { grid-template-columns: 1fr; }
  .admin-content  { padding: 16px; }
  .report-grid    { grid-template-columns: 1fr; }
  .filter-bar .form-input, .filter-bar .form-select { max-width: 100%; }
  .video-wrapper  { border-radius: var(--radius); }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 28px 20px; }
  .material-card { flex-wrap: wrap; }
  .list-item-actions { flex-direction: column; }
}

/* ===== ランチャー（ホーム：アプリ選択）===== */
.launcher-tiles { display:grid; grid-template-columns:repeat(2,1fr); gap:16px; max-width:680px; }
@media (max-width:560px){ .launcher-tiles{ grid-template-columns:1fr; } }
.launcher-tile {
  background:var(--card-bg); border:1px solid var(--border); border-top:5px solid var(--primary);
  border-radius:var(--radius-lg); padding:22px 20px; cursor:pointer;
  box-shadow:var(--shadow-sm); transition:transform .08s, box-shadow .15s, border-color .15s;
}
.launcher-tile:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); border-color:var(--primary); }
.launcher-tile.lt-edu { border-top-color:var(--success); }
.launcher-tile.lt-portal { border-top-color:#0891B2; }
.launcher-tile.lt-set { border-top-color:#64748B; }
.launcher-tile .lt-icon { font-size:2.2rem; line-height:1; }
.launcher-tile .lt-name { font-size:1.15rem; font-weight:700; margin-top:8px; color:var(--text-primary); }
.launcher-tile .lt-desc { font-size:.85rem; color:var(--text-muted); margin-top:4px; }
.launcher-notices {
  max-width: 680px;
  margin-top: 22px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.launcher-notices-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
}
.launcher-notice-list { display: grid; gap: 0; }
.launcher-notice { padding: 14px 16px; border-bottom: 1px solid var(--border-light); }
.launcher-notice:last-child { border-bottom: 0; }
.launcher-notice-title { font-size: 14px; font-weight: 800; color: var(--text-primary); margin-bottom: 5px; }
.launcher-notice-body { font-size: 13px; line-height: 1.7; color: var(--text-secondary); white-space: pre-wrap; }
.launcher-notice-meta { margin-top: 8px; font-size: 11px; color: var(--text-muted); }

/* ===== KY活動 共通スタイル（安全教育のデザインに統一）===== */
.ky-row { display:flex; justify-content:space-between; gap:12px; padding:5px 0; font-size:14px; }
.ky-row .ky-k { color: var(--text-muted); flex-shrink:0; }
.ky-notice { margin-top:10px; padding:10px 12px; background: var(--primary-light); border-left:3px solid var(--primary); border-radius: var(--radius); font-size:14px; }
.ky-lock { padding:10px 12px; background: var(--warning-light); color: var(--warning); border-radius: var(--radius); font-weight:600; font-size:14px; }
.ky-slot { font-weight:700; color: var(--primary); margin-bottom:14px; font-size:15px; }
.ky-temp-grid { display:flex; gap:12px; margin-top:16px; }
.ky-temp-cell { flex:1; text-align:center; background: var(--bg); border:1px solid var(--border); border-radius: var(--radius); padding:10px 6px; }
.ky-temp-label { font-size:12px; color: var(--text-muted); margin-bottom:4px; }
.ky-temp-val { font-size:20px; font-weight:700; color: var(--text-primary); }
.ky-hazard { border:1px solid var(--border); border-radius: var(--radius); padding:10px 12px; margin-top:8px; background:#fff; }
.ky-hazard .ky-hz-title { font-weight:700; }
.ky-plist-row { display:flex; justify-content:space-between; gap:10px; padding:7px 0; border-bottom:1px solid var(--border-light); font-size:14px; }
.ky-grid2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.ky-grid3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; }
.ky-grid-machine { display:grid; grid-template-columns:minmax(0,1fr) 100px; gap:12px; }
.ky-form-stack { display:grid; gap:12px; }
.ky-section-title { font-size:15px; font-weight:800; color:var(--text-primary); margin-top:6px; }
.ky-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.ky-check-row { display:flex; gap:12px; flex-wrap:wrap; align-items:center; min-height:34px; }
.ky-report-row { display:grid; grid-template-columns:70px minmax(120px,1fr) minmax(110px,140px) auto; gap:10px; align-items:end; margin-bottom:12px; }
.ky-report-row-wide { grid-template-columns:70px minmax(130px,1fr) minmax(130px,1fr) minmax(100px,130px) minmax(95px,120px) auto; }
.ky-report-label { align-self:center; font-weight:700; color:var(--text-primary); }
@media (max-width:760px){
  .ky-grid2, .ky-grid3, .ky-grid-machine, .ky-actions { grid-template-columns:1fr; }
  .ky-report-row, .ky-report-row-wide { grid-template-columns:1fr; align-items:stretch; }
  .ky-report-label { margin-top:4px; }
}

/* ===== KY画面の素のinput/select/labelを安全教育のフォーム部品と同じ質感に（一括）===== */
#ky-body input:not([type=checkbox]):not([type=radio]),
#ky-body select,
#ky-body textarea {
  font: inherit; width: 100%; padding: 10px 12px; min-height: 42px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; color: var(--text-primary);
}
#ky-body input:focus, #ky-body select:focus, #ky-body textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
#ky-body label { display:block; font-size:13px; font-weight:600; color: var(--text-secondary); margin-bottom:4px; }
#ky-body label input[type=checkbox] { width:auto; min-height:0; margin-right:6px; display:inline-block; }
#ky-body label:has(input[type=checkbox]) { display:inline-block; font-weight:400; color:var(--text-primary); margin-right:12px; }
#ky-body .card { margin-bottom: 14px; }
#ky-body strong { display:block; margin: 4px 0 8px; font-size:15px; }

/* ============================================================
   RESPONSIVE REDESIGN 2026-06
   PC: 元請が見る業務ダッシュボード寄り
   Mobile: 現場で片手入力しやすい1カラムUI
   ============================================================ */
:root {
  --bg: #f2f5f8;
  --card-bg: #ffffff;
  --border: #d9e1ea;
  --border-light: #e9eef4;
  --text-primary: #172033;
  --text-secondary: #40516a;
  --text-muted: #7f8da3;
  --primary: #173b88;
  --primary-dark: #0f2b66;
  --primary-light: #e8eef8;
  --sidebar-bg: #122b63;
  --header-bg: #142f70;
  --radius: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --shadow-sm: 0 1px 1px rgba(15, 31, 54, 0.04);
  --shadow: 0 1px 2px rgba(15, 31, 54, 0.08);
  --shadow-md: 0 6px 16px rgba(15, 31, 54, 0.08);
}

body {
  background:
    linear-gradient(180deg, rgba(23,59,136,0.035), rgba(23,59,136,0) 220px),
    var(--bg);
}

.learner-header {
  height: 58px;
  padding: 0 24px;
  background: #17336f;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.learner-header-logo img,
.sidebar-logo-icon img {
  background: #fff;
}

.learner-content {
  max-width: 924px;
  padding: 32px 24px 56px;
}

.admin-header {
  height: 60px;
  box-shadow: none;
}

.admin-content {
  padding: 32px;
}

.page-title,
.portal-title,
.launcher-title {
  letter-spacing: 0;
}

.card,
.list-item,
.filter-bar,
.launcher-tile,
.launcher-notices,
.material-card,
.report-card,
.stat-card {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 15px 22px;
  background: #fbfcfe;
  border-bottom-color: var(--border);
}

.card-body {
  padding: 18px 22px;
}

.btn {
  border-radius: 6px;
  font-weight: 700;
}

.btn-primary {
  background: #183f96;
}

.btn-primary:hover {
  background: #123377;
}

.form-input,
.form-select,
.form-textarea,
#ky-body input:not([type=checkbox]):not([type=radio]),
#ky-body select,
#ky-body textarea {
  border-radius: 6px;
  border-color: #d5deea;
}

.launcher-hero,
.portal-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.launcher-eyebrow {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0;
  margin-bottom: 2px;
}

.launcher-title,
.portal-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 850;
}

.launcher-userline,
.portal-subtitle,
.portal-refresh {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.portal-refresh {
  text-align: right;
}

.launcher-notices {
  max-width: none;
  margin: 0 0 18px;
  border-left: 4px solid #d17a00;
}

.launcher-notices-head {
  background: #fffaf0;
  border-bottom-color: #f1dfbb;
}

.launcher-notice {
  display: grid;
  grid-template-columns: minmax(130px, 0.28fr) minmax(0, 1fr);
  column-gap: 18px;
  align-items: start;
  padding: 13px 16px;
}

.launcher-notice-title {
  margin: 0;
  font-size: 13px;
}

.launcher-notice-body {
  font-size: 13px;
  line-height: 1.65;
}

.launcher-notice-meta {
  grid-column: 2;
  margin-top: 5px;
}

.launcher-tiles {
  max-width: none;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}

.launcher-tile {
  min-height: 132px;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 16px;
  align-content: center;
  border-top-width: 4px;
  position: relative;
}

.launcher-tile:hover {
  transform: translateY(-1px);
}

.launcher-tile .lt-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  grid-row: 1 / span 2;
  color: var(--primary);
  background: #eef3fb;
  border: 1px solid #dbe5f2;
  border-radius: 8px;
  font-size: 0;
}

.launcher-tile .lt-icon svg {
  width: 22px;
  height: 22px;
}

.launcher-tile.lt-portal .lt-icon { color: #087b92; background: #e7f6f8; border-color: #cbeaf0; }
.launcher-tile.lt-edu .lt-icon { color: #278140; background: #eaf6ee; border-color: #ccebd5; }
.launcher-tile.lt-ky .lt-icon { color: #b45309; background: #fff4df; border-color: #f6dfb5; }
.launcher-tile.lt-set .lt-icon { color: #475569; background: #eef2f6; border-color: #dbe3ec; }

.launcher-tile .lt-name {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 850;
}

.launcher-tile .lt-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.portal-stat-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 20px !important;
}

.portal-stat {
  padding: 14px 16px !important;
  min-height: 108px;
}

.stat-card-label {
  color: var(--text-secondary);
  letter-spacing: 0;
  text-transform: none;
}

.stat-card-value {
  font-size: 31px;
}

.portal-section-head {
  margin: 8px 0 12px;
}

.portal-edu-stats {
  grid-template-columns: repeat(4, minmax(110px, 1fr)) !important;
  gap: 10px !important;
  margin-bottom: 14px !important;
}

.portal-edu-company {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--border-light);
}

.portal-company-card {
  margin-bottom: 14px;
}

.portal-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 10px;
}

.portal-member-card {
  border: 1px solid;
  border-radius: 7px;
  padding: 11px 13px;
}

.ky-temp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#ky-body .card {
  border-radius: 8px;
}

#ky-body .card-header {
  background: #fbfcfe;
}

@media (min-width: 1024px) {
  .admin-sidebar {
    width: 240px;
  }

  .admin-main {
    margin-left: 240px;
  }

  .learner-content {
    max-width: 980px;
  }

  #portal-body {
    max-width: 1040px;
    margin: 0 auto;
  }
}

@media (max-width: 760px) {
  body {
    background: #f3f6fa;
  }

  .learner-page {
    min-height: 100svh;
  }

  .learner-header {
    height: 56px;
    padding: 0 12px;
    gap: 8px;
  }

  .learner-header > .flex {
    min-width: 0;
    gap: 8px;
  }

  .learner-header-logo {
    min-width: 0;
    font-size: 14px;
    gap: 7px;
  }

  .learner-header-logo span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .learner-header-logo img {
    height: 30px !important;
    width: 30px !important;
  }

  .learner-header-right {
    gap: 6px;
    font-size: 12px;
  }

  .learner-header-user {
    max-width: 86px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-home-btn {
    min-height: 36px;
    padding: 8px 10px;
  }

  .learner-content {
    max-width: none;
    padding: 18px 12px 28px;
  }

  .launcher-hero,
  .portal-hero {
    align-items: flex-start;
    margin-bottom: 14px;
  }

  .launcher-title,
  .portal-title {
    font-size: 22px;
  }

  .launcher-userline,
  .portal-subtitle,
  .portal-refresh {
    font-size: 12px;
  }

  .portal-refresh {
    text-align: left;
  }

  .launcher-notices {
    margin-bottom: 14px;
    border-left-width: 3px;
  }

  .launcher-notice {
    display: block;
    padding: 12px 14px;
  }

  .launcher-notice-title {
    margin-bottom: 4px;
  }

  .launcher-notice-meta {
    margin-top: 7px;
  }

  .launcher-tiles {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .launcher-tile {
    min-height: 96px;
    padding: 16px;
    grid-template-columns: 40px minmax(0, 1fr);
    column-gap: 13px;
    border-top-width: 0;
    border-left: 4px solid var(--primary);
  }

  .launcher-tile.lt-portal { border-left-color: #0891B2; }
  .launcher-tile.lt-edu { border-left-color: var(--success); }
  .launcher-tile.lt-set { border-left-color: #64748B; }
  .launcher-tile.lt-ky { border-left-color: #d97706; }

  .launcher-tile .lt-icon {
    width: 40px;
    height: 40px;
  }

  .launcher-tile .lt-name {
    font-size: 17px;
  }

  .portal-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9px !important;
  }

  .portal-stat {
    min-height: 92px;
    padding: 12px !important;
  }

  .stat-card-value {
    font-size: 26px;
  }

  .portal-edu-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .portal-edu-company {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
  }

  .portal-edu-company > div:nth-child(2) {
    grid-column: 1 / -1;
    order: 3;
  }

  .portal-member-grid {
    grid-template-columns: 1fr;
  }

  .card-header {
    padding: 13px 14px;
  }

  .card-body {
    padding: 14px;
  }

  .ky-temp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .ky-temp-cell {
    padding: 9px 6px;
  }

  .ky-temp-val {
    font-size: 18px;
  }

  #ky-body .btn-lg,
  #ky-body .btn-block {
    min-height: 52px;
    font-size: 16px;
  }

  #ky-body input:not([type=checkbox]):not([type=radio]),
  #ky-body select,
  #ky-body textarea {
    min-height: 48px;
    font-size: 16px;
  }

  #ky-body .card {
    margin-bottom: 12px;
  }
}

@media (max-width: 380px) {
  .learner-header {
    padding: 0 9px;
  }

  .app-home-btn {
    padding: 8px;
  }

  .app-home-btn svg {
    width: 16px;
    height: 16px;
  }

  .learner-header-user {
    max-width: 70px;
  }
}
