/* ============================================================
   CSS Variables & Reset
   ============================================================ */
:root {
  --primary: #6366F1;
  --primary-light: #A5B4FC;
  --primary-bg: #EEF2FF;
  --primary-hover: #4F46E5;
  --danger: #EF4444;
  --danger-bg: #FEF2F2;
  --success: #10B981;
  --success-bg: #ECFDF5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --font: Arial, 'Yu Gothic Medium', 'Yu Gothic', 'YuGothic', sans-serif;
  --header-h: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Screens
   ============================================================ */
.screen { display: none; height: 100%; }
.screen.active { display: flex; flex-direction: column; }

/* ============================================================
   Login
   ============================================================ */
.login-container {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; padding: 24px 20px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: linear-gradient(135deg, #667eea08 0%, #764ba208 100%);
}
.login-logo {
  text-align: center; margin-bottom: 40px;
}
.login-logo .material-icons-round {
  font-size: 56px; color: var(--primary);
}
.login-logo h1 {
  font-size: 22px; font-weight: 700; margin-top: 8px; color: var(--gray-800);
  letter-spacing: -0.5px;
}
.login-logo-img {
  height: 48px; width: auto;
}
.header-logo {
  height: 24px; width: auto;
}
.sidebar-logo {
  height: 32px; width: auto;
}
.login-form {
  width: 100%; max-width: 360px;
  background: #fff;
  padding: 32px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.login-form .btn-block {
  margin-top: 12px; padding: 14px 20px; font-size: 16px;
  border-radius: var(--radius-sm);
}
.login-form .form-group {
  margin-bottom: 20px;
}
.login-form .form-group label {
  font-size: 13px; margin-bottom: 8px; color: var(--gray-600); font-weight: 600;
}
.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"] {
  font-size: 16px; padding: 14px 14px;
  border-radius: var(--radius-sm);
}

/* パスワード表示トグル */
.password-input-wrap {
  position: relative; display: flex; align-items: center;
}
.password-input-wrap input {
  flex: 1; padding-right: 48px !important;
}
.password-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 6px;
  color: var(--gray-400); display: flex; align-items: center;
}
.password-toggle:hover { color: var(--gray-600); }
.password-toggle .material-icons-round { font-size: 22px; }

/* フォームエラーメッセージ */
.form-error {
  background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius-sm);
  color: #dc2626; font-size: 13px; padding: 10px 14px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}

/* ============================================================
   Header
   ============================================================ */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); padding: 0 20px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0; z-index: 100;
  position: sticky; top: 0;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-left h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; color: var(--gray-800); }
.header-center {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.header-center img { pointer-events: auto; }
.header-right { display: flex; align-items: center; gap: 10px; }
.user-name { font-size: 12px; color: var(--gray-400); font-weight: 500; }
.header-left .material-icons-round,
.header-right .material-icons-round {
  cursor: pointer; color: var(--gray-500);
  transition: color 0.15s;
}
.header-left .material-icons-round:hover,
.header-right .material-icons-round:hover { color: var(--gray-800); }

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 200; pointer-events: none;
}
.sidebar.open { pointer-events: auto; }
.sidebar-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.25); opacity: 0; transition: opacity 0.3s;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.sidebar.open .sidebar-overlay { opacity: 1; }
.sidebar-content {
  position: absolute; top: 0; left: 0; width: 280px; height: 100%;
  background: #fff; transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 16px 0; overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.08);
}
.sidebar.open .sidebar-content { transform: translateX(0); }
.sidebar-header {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  font-size: 18px; font-weight: 700; color: var(--primary);
  border-bottom: 1px solid var(--gray-100); margin-bottom: 8px;
}
.sidebar-header .material-icons-round { font-size: 28px; }
.nav-list { list-style: none; }
.nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px; cursor: pointer; color: var(--gray-500);
  transition: all 0.2s; border-radius: 0; margin: 2px 8px;
  border-radius: var(--radius-sm); font-weight: 500;
}
.nav-item:hover { background: var(--gray-50); color: var(--gray-700); }
.nav-item.active {
  color: var(--primary); background: var(--primary-bg); font-weight: 600;
}
.nav-item .material-icons-round { font-size: 22px; }

/* ============================================================
   Main Content
   ============================================================ */
.main-content {
  flex: 1; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: var(--safe-bottom);
}
.page { display: none; padding: 20px; }
.page.active { display: block; }

/* 打刻ページ */
#page-punch { padding: 0; }
#page-punch.active { display: block; }

/* ============================================================
   Calendar
   ============================================================ */
.calendar-controls {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
}
.calendar-controls h3 { font-size: 16px; font-weight: 700; min-width: 120px; text-align: center; letter-spacing: -0.3px; }
.calendar-filters-wrap { margin-bottom: 10px; }
.filter-toggle-btn {
  display: flex; align-items: center; gap: 4px;
  background: none; border: 1px solid var(--gray-200); border-radius: 8px;
  padding: 6px 12px; font-size: 13px; color: var(--gray-500);
  cursor: pointer; font-weight: 500; margin-bottom: 8px;
  transition: all 0.2s;
}
.filter-toggle-btn:hover { background: var(--gray-50); color: var(--gray-700); }
.filter-toggle-btn .material-icons-round { font-size: 18px; transition: transform 0.2s; }
.filter-toggle-btn.open .material-icons-round { transform: rotate(180deg); }
.calendar-filters {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 20px; font-size: 12px;
  background: var(--gray-100); color: var(--gray-500);
  cursor: pointer; border: 1.5px solid transparent; transition: all 0.2s;
  font-weight: 500;
}
.filter-chip:hover { background: var(--gray-200); }
.filter-chip.active { background: var(--primary-bg); color: var(--primary); border-color: var(--primary-light); }
.filter-chip .color-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

.calendar-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  overflow: hidden; background: #fff;
  max-width: 100%;
}
.cal-header {
  padding: 10px 2px; text-align: center; font-size: 11px;
  font-weight: 600; color: var(--gray-400); background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.cal-header:nth-child(1) { color: var(--danger); }
.cal-header:nth-child(7) { color: var(--primary); }

.cal-cell {
  min-height: 80px; padding: 4px; border-right: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100); cursor: pointer;
  transition: background 0.2s; position: relative;
  overflow: hidden; min-width: 0;
}
.cal-cell:hover { background: #F8FAFF; }
.cal-cell.other-month { background: var(--gray-50); opacity: 0.4; }
.cal-cell.today { background: #EEF2FF; }
.cal-cell .day-number {
  font-size: 12px; font-weight: 600; margin-bottom: 2px; color: var(--gray-600);
}
.cal-cell:nth-child(7n+1) .day-number { color: var(--danger); }
.cal-cell:nth-child(7n) .day-number { color: var(--primary); }
.cal-cell.today .day-number {
  background: var(--primary); color: #fff; width: 22px; height: 22px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

.shift-dot {
  display: flex; align-items: center; gap: 2px;
  padding: 1px 4px; margin-bottom: 1px; border-radius: 4px;
  font-size: 10px; line-height: 1.3; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.shift-dot.member-0  { background: #2563EB; color: #fff; }
.shift-dot.member-1  { background: #DC2626; color: #fff; }
.shift-dot.member-2  { background: #059669; color: #fff; }
.shift-dot.member-3  { background: #D97706; color: #fff; }
.shift-dot.member-4  { background: #7C3AED; color: #fff; }
.shift-dot.member-5  { background: #0891B2; color: #fff; }
.shift-dot.member-6  { background: #DB2777; color: #fff; }
.shift-dot.member-7  { background: #4338CA; color: #fff; }
.shift-dot.member-8  { background: #0D9488; color: #fff; }
.shift-dot.member-9  { background: #B45309; color: #fff; }
.shift-dot.member-10 { background: #6D28D9; color: #fff; }
.shift-dot.member-11 { background: #475569; color: #fff; }

.cal-cell .more-count {
  font-size: 10px; color: var(--gray-400); text-align: center;
}

/* ============================================================
   View Tabs (日/週/月 切替)
   ============================================================ */
.view-tabs {
  display: flex; gap: 4px; margin-bottom: 14px;
  background: var(--gray-100); border-radius: var(--radius-sm); padding: 4px;
}
.view-tab {
  flex: 1; padding: 8px 0; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600; font-family: var(--font);
  background: transparent; color: var(--gray-400); cursor: pointer;
  transition: all 0.2s;
}
.view-tab.active {
  background: #fff; color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ============================================================
   Week View
   ============================================================ */
.week-view {
  display: flex; flex-direction: column; gap: 8px;
}
.week-day-card {
  background: #fff; border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); cursor: pointer; transition: all 0.2s;
  border: 1px solid transparent;
}
.week-day-card:hover { box-shadow: var(--shadow-md); border-color: var(--gray-200); }
.week-day-card.week-day-today {
  border-left: 3px solid var(--primary); background: linear-gradient(135deg, #EEF2FF 0%, #fff 100%);
}
.week-day-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.week-day-dow {
  font-size: 12px; color: var(--gray-400); font-weight: 600; min-width: 20px;
  text-transform: uppercase;
}
.week-day-num {
  font-size: 16px; font-weight: 800; color: var(--gray-800);
}
.week-day-num.today-badge {
  background: var(--primary); color: #fff; width: 28px; height: 28px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.week-day-shifts {
  display: flex; flex-direction: column; gap: 4px;
}
.week-shift-item {
  padding: 5px 10px; border-radius: 6px; font-size: 12px;
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-weight: 500;
}
.week-no-shift {
  font-size: 12px; color: var(--gray-300); text-align: center; padding: 4px;
}

/* ============================================================
   Day View
   ============================================================ */
.day-view {
  display: flex; flex-direction: column; gap: 10px;
}
.day-shift-card {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); border: 1px solid var(--gray-100);
  transition: all 0.2s;
}
.day-shift-card:hover { box-shadow: var(--shadow-md); }
.day-shift-avatar {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.day-shift-info { flex: 1; }
.day-shift-name { font-size: 15px; font-weight: 700; color: var(--gray-800); }
.day-shift-time { font-size: 14px; color: var(--primary); font-weight: 600; margin-top: 2px; }
.day-shift-meta { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.day-no-shift {
  text-align: center; padding: 48px 16px; color: var(--gray-300);
}
.day-no-shift .material-icons-round { font-size: 48px; display: block; margin-bottom: 8px; }
.day-no-shift p { font-size: 14px; }

/* ============================================================
   My Shifts
   ============================================================ */
.my-shift-list { display: flex; flex-direction: column; gap: 8px; }
.shift-card {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); cursor: pointer; transition: all 0.2s;
  border: 1px solid var(--gray-100);
}
.shift-card:hover { box-shadow: var(--shadow-md); border-color: var(--gray-200); }
.shift-card .shift-date-badge {
  width: 50px; height: 50px; border-radius: 14px;
  background: var(--primary-bg); color: var(--primary);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.shift-date-badge .day { font-size: 18px; font-weight: 800; line-height: 1; }
.shift-date-badge .dow { font-size: 10px; font-weight: 600; }
.shift-card .shift-info { flex: 1; }
.shift-info .shift-time { font-size: 15px; font-weight: 600; }
.shift-info .shift-meta { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.shift-card .location-tag {
  padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600;
}

/* ============================================================
   Dashboard
   ============================================================ */
.dashboard-grid { display: grid; gap: 12px; }
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); border: 1px solid var(--gray-100);
  transition: all 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card .stat-label { font-size: 12px; color: var(--gray-400); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; margin: 6px 0; letter-spacing: -1px; }
.stat-card .stat-sub { font-size: 12px; color: var(--gray-400); }

.stats-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 600px) { .stats-row { grid-template-columns: repeat(4, 1fr); } }

/* ============================================================
   Cost & Budget Tables
   ============================================================ */
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table th {
  background: var(--gray-50); padding: 12px 14px;
  text-align: left; font-weight: 600; color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.data-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--gray-100);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

.alert-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600;
}
.alert-badge.alert-late { background: var(--warning-bg); color: #B45309; }
.alert-badge.alert-early { background: var(--warning-bg); color: #B45309; }
.alert-badge.alert-overtime { background: var(--danger-bg); color: var(--danger); }
.alert-badge.alert-absent { background: var(--danger-bg); color: var(--danger); }
.alert-badge.alert-unplanned { background: var(--primary-bg); color: var(--primary); }
.alert-badge.alert-ok { background: var(--success-bg); color: var(--success); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: #fff; border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); border: 1px solid var(--gray-100);
}
.card h3 { font-size: 16px; font-weight: 700; margin-bottom: 18px; letter-spacing: -0.3px; }
.mt-16 { margin-top: 16px; }

/* ============================================================
   Form Elements
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--gray-600); margin-bottom: 6px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="file"],
select, textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 14px; font-family: var(--font);
  transition: all 0.2s; background: #fff;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-label {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  background: var(--gray-50); cursor: pointer; font-size: 13px;
  border: 1.5px solid transparent; transition: all 0.2s;
  font-weight: 500;
}
.checkbox-label:hover { border-color: var(--gray-200); }
.checkbox-label input { width: auto; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: all 0.2s;
  letter-spacing: -0.2px;
}
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 12px rgba(99,102,241,0.35); }
.btn-outline {
  background: #fff; border: 1.5px solid var(--gray-200); color: var(--gray-700);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 2px 8px rgba(239,68,68,0.25); }
.btn-danger:hover { background: #DC2626; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  background: transparent; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500); transition: all 0.2s;
}
.btn-icon:hover { background: var(--gray-100); color: var(--gray-700); }

.fab {
  position: fixed; bottom: calc(80px + var(--safe-bottom)); right: 24px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none;
  box-shadow: 0 4px 16px rgba(99,102,241,0.4); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 50; transition: all 0.2s;
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(99,102,241,0.5); }
.fab .material-icons-round { font-size: 28px; }

/* ============================================================
   Shift Type Chips
   ============================================================ */
.shift-type-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.shift-type-chip {
  padding: 8px 18px; border-radius: 24px; font-size: 13px;
  background: var(--gray-100); color: var(--gray-500);
  cursor: pointer; border: 2px solid transparent; transition: all 0.2s;
  font-weight: 500;
}
.shift-type-chip.active {
  background: var(--primary-bg); color: var(--primary);
  border-color: var(--primary);
}

/* ============================================================
   Modal
   ============================================================ */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 300; display: none; align-items: flex-end; justify-content: center;
}
.modal.open { display: flex; }
.modal-backdrop {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modal-content {
  position: relative; width: 100%; max-width: 480px; max-height: 90vh;
  background: #fff; border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.modal-header .material-icons-round { cursor: pointer; color: var(--gray-400); transition: color 0.15s; }
.modal-header .material-icons-round:hover { color: var(--gray-700); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 16px 24px; border-top: 1px solid var(--gray-100);
}

/* ============================================================
   Warnings
   ============================================================ */
.warnings-container {
  background: var(--warning-bg); border: 1px solid #FCD34D;
  border-radius: var(--radius-sm); padding: 14px;
}
.warning-item {
  display: flex; align-items: flex-start; gap: 8px; font-size: 13px;
  color: #92400E;
}
.warning-item .material-icons-round { font-size: 18px; color: var(--warning); flex-shrink: 0; }

/* ============================================================
   Loading & Toast
   ============================================================ */
.loading-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255,255,255,0.85); z-index: 999;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.spinner {
  width: 40px; height: 40px; border: 3px solid var(--gray-200);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast-container {
  position: fixed; bottom: calc(80px + var(--safe-bottom)); left: 50%;
  transform: translateX(-50%); z-index: 400;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 14px 24px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: #fff; box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.3s; min-width: 200px; text-align: center;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: #000; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Page Header
   ============================================================ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 8px; flex-wrap: wrap;
}
.page-header h3 { font-size: 16px; font-weight: 700; }

/* ============================================================
   Staff List
   ============================================================ */
.staff-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 8px; border: 1px solid var(--gray-100);
  transition: all 0.2s;
}
.staff-list-item:hover { box-shadow: var(--shadow-md); }
.staff-list-item .staff-avatar-sm {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 700;
}
.staff-list-item .staff-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.staff-list-item .staff-info .name { font-weight: 600; }
.staff-list-item .staff-info .meta { font-size: 12px; color: var(--gray-400); }
.staff-list-item .staff-actions { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

.org-chart-card {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid #DBEAFE;
  background:
    radial-gradient(900px 260px at 100% -20%, rgba(37,99,235,0.16), transparent 62%),
    radial-gradient(740px 240px at -8% -18%, rgba(14,165,233,0.14), transparent 56%),
    linear-gradient(180deg, #F8FAFF 0%, #FFFFFF 100%);
  box-shadow: 0 10px 22px rgba(30,58,138,0.08);
}
.org-editor-card {
  margin-bottom: 14px;
  border: 1px solid #E5E7EB;
  background: #fff;
}
.org-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}
.org-editor-title {
  font-size: 14px;
  font-weight: 800;
  color: #1f2937;
}
.org-editor-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: var(--gray-500);
}
.org-editor-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.org-editor-layer {
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 12px;
  background: #F9FAFB;
  margin-top: 10px;
}
.org-editor-layer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.org-editor-layer-index {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}
.org-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
}
.org-editor-sub-layer-hint {
  margin: 2px 0 8px;
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
}
.org-editor-section-title {
  margin: 2px 0 8px;
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 700;
}
.org-editor-section-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
}
.org-editor-section-row input {
  min-width: 0;
}
.org-editor-add-section-btn {
  margin-top: 2px;
}
.org-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.org-chart-title {
  font-size: 15px;
  font-weight: 800;
  color: #1E3A8A;
  letter-spacing: 0.01em;
}
.org-chart-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.55;
}
.org-chart-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.org-chart-stat-chip {
  font-size: 11px;
  font-weight: 700;
  color: #1D4ED8;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.org-chart-stat-chip.muted {
  color: var(--gray-500);
  background: var(--gray-100);
  border-color: var(--gray-200);
}
.org-chart-level {
  --layer-accent: #2563EB;
  --layer-soft: #BFDBFE;
  --layer-bg: #EFF6FF;
  border: 1px solid var(--layer-soft);
  border-left: 6px solid var(--layer-accent);
  border-radius: 14px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.95) 0%, #fff 100%),
    var(--layer-bg);
  box-shadow: 0 6px 16px rgba(15,23,42,0.05);
}
.org-chart-level.is-sublayer {
  border-style: dashed;
}
.org-chart-unassigned {
  border-color: #FECACA;
  background: #FEF2F2;
  border-left-color: #EF4444;
}
.org-chart-level + .org-chart-level {
  margin-top: 12px;
}
.org-chart-level-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.org-chart-level-path {
  margin-bottom: 5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.org-chart-level-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--layer-accent);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--layer-soft);
}
.org-chart-level-parent {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
}
.org-chart-level-label {
  font-size: 15px;
  font-weight: 800;
  color: var(--gray-800);
  line-height: 1.35;
}
.org-chart-level-hint {
  font-size: 12px;
  color: #475569;
  margin-top: 2px;
}
.org-chart-level-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--layer-accent);
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--layer-soft);
  border-radius: 999px;
  padding: 3px 10px;
}
.org-chart-section {
  border: 1px solid rgba(148,163,184,0.24);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,0.9);
  margin-top: 9px;
}
.org-chart-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.org-chart-section-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  background: rgba(148,163,184,0.12);
  border-radius: 999px;
  padding: 3px 10px;
}
.org-chart-section-count {
  font-size: 11px;
  color: #475569;
  font-weight: 700;
}
.org-chart-empty {
  font-size: 12px;
  color: #64748b;
  padding: 8px 4px;
  background: rgba(148,163,184,0.08);
  border-radius: 8px;
}
.org-chart-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.org-chart-member {
  border: 1px solid rgba(203,213,225,0.72);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(15,23,42,0.06);
}
.org-chart-member-main {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}
.org-chart-member-info {
  min-width: 0;
  padding-top: 1px;
}
.org-chart-member-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-chart-member-meta {
  font-size: 11px;
  color: #475569;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.45;
}
.org-chart-member-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}
.org-chart-tag {
  font-size: 10px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #F1F5F9;
  color: #334155;
  font-weight: 600;
}
.org-chart-tag.is-registered {
  background: var(--success-bg);
  color: var(--success);
}
.org-chart-tag.is-pending {
  background: #FEF3C7;
  color: #92400E;
}
.org-chart-tag.is-employment {
  background: #EEF2FF;
  color: #4338CA;
}
.org-chart-tag.is-auto {
  background: #E0E7FF;
  color: #4338CA;
}
.org-chart-flow {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #60A5FA;
  margin: 6px 0;
}
.org-chart-flow .material-icons-round {
  font-size: 22px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 999px;
  padding: 2px;
}
.org-chart-view-switch {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.org-chart-tree-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
}
.org-chart-tree {
  min-width: max-content;
  padding: 4px 6px 10px;
}
.org-chart-tree ul {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 0;
  padding: 24px 0 0;
  position: relative;
}
.org-chart-tree > ul {
  padding-top: 0;
}
.org-chart-tree li {
  list-style: none;
  text-align: center;
  position: relative;
  padding: 24px 8px 0;
}
.org-chart-tree > ul > li {
  padding-top: 0;
}
.org-chart-tree li::before,
.org-chart-tree li::after {
  content: '';
  position: absolute;
  top: 0;
  width: 50%;
  height: 24px;
  border-top: 2px solid #CBD5E1;
}
.org-chart-tree li::before {
  left: 0;
  border-right: 1px solid #CBD5E1;
}
.org-chart-tree li::after {
  right: 0;
  border-left: 1px solid #CBD5E1;
}
.org-chart-tree li:only-child::before,
.org-chart-tree li:only-child::after {
  display: none;
}
.org-chart-tree li:first-child::before,
.org-chart-tree li:last-child::after {
  border: none;
}
.org-chart-tree li:last-child::before {
  border-right: 2px solid #CBD5E1;
  border-radius: 0 10px 0 0;
}
.org-chart-tree li:first-child::after {
  border-radius: 10px 0 0 0;
}
.org-chart-tree ul ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 24px;
  border-left: 2px solid #CBD5E1;
  transform: translateX(-50%);
}
.org-tree-node {
  --layer-accent: #2563EB;
  --layer-soft: #BFDBFE;
  --layer-bg: #EFF6FF;
  width: 238px;
  border: 1px solid var(--layer-soft);
  border-top: 4px solid var(--layer-accent);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.97) 0%, #fff 100%),
    var(--layer-bg);
  padding: 10px;
  box-shadow: 0 7px 18px rgba(15,23,42,0.08);
  text-align: left;
}
.org-tree-node-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
}
.org-tree-node-role {
  font-size: 12px;
  color: #475569;
  margin-top: 2px;
  line-height: 1.45;
}
.org-tree-node-meta {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--layer-accent);
}
.org-tree-node-chips {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.org-tree-node-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(148,163,184,0.14);
  color: #334155;
  font-size: 10px;
  font-weight: 700;
}
.org-tree-node-members {
  margin-top: 8px;
  font-size: 11px;
  color: #334155;
  line-height: 1.5;
}
.org-chart-tree-unassigned {
  margin-top: 12px;
}

.active-workers-page {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.active-workers-page:empty { display: none; }
.active-workers-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.18);
}
.active-workers-summary .count {
  font-size: 22px;
  font-weight: 800;
  color: #059669;
  line-height: 1;
}
.active-workers-summary.is-empty {
  background: #fff;
  border-color: var(--gray-100);
}
.active-workers-summary.is-empty .count {
  color: var(--gray-500);
}
.active-workers-summary .label {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 600;
}
.active-workers-list {
  display: grid;
  gap: 10px;
}
.active-workers-table-head {
  display: none;
}
.active-worker-item {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow);
}
.active-worker-item:hover { box-shadow: var(--shadow-md); }
.active-worker-item .worker-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.active-worker-item .worker-main {
  flex: 1;
  min-width: 0;
}
.active-worker-item .worker-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 4px;
}
.active-worker-item .worker-sub {
  font-size: 12px;
  color: var(--gray-400);
}
.active-worker-item .worker-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--gray-500);
}
.active-worker-item .worker-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--gray-50);
}
.active-worker-item .worker-badge.status-in {
  background: rgba(16,185,129,0.12);
  color: #059669;
  font-weight: 700;
}
.active-worker-item .worker-badge.status-out {
  background: rgba(148,163,184,0.14);
  color: #475569;
  font-weight: 700;
}
.active-worker-item .worker-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.active-worker-item .time-block {
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--gray-100);
}
.active-worker-item .time-label {
  font-size: 11px;
  color: var(--gray-400);
  margin-bottom: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.active-worker-item .time-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--gray-800);
  line-height: 1.1;
}
.active-worker-item .time-value.active {
  color: #059669;
}
.active-workers-updated {
  margin-left: auto;
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 600;
}
.active-workers-empty {
  padding: 28px 18px;
  text-align: center;
  background: #fff;
  border: 1px dashed var(--gray-200);
  border-radius: var(--radius);
  color: var(--gray-500);
}

.punch-fix-info-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  margin-bottom: 16px;
}
.punch-fix-info-card.error {
  color: var(--danger);
  background: var(--danger-bg);
}
.punch-fix-info-label {
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 700;
  margin-bottom: 4px;
}
.punch-fix-info-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-800);
}
.punch-fix-info-sub {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}
.punch-fix-request-card,
.punch-fix-admin-item {
  padding: 14px 16px;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.punch-fix-request-card + .punch-fix-request-card,
.punch-fix-admin-item + .punch-fix-admin-item {
  margin-top: 10px;
}
.punch-fix-request-head,
.punch-fix-admin-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.punch-fix-request-date {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 2px;
}
.punch-fix-request-time {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-800);
}
.punch-fix-request-meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--gray-400);
}
.punch-fix-request-reason {
  margin-top: 10px;
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.6;
}
.punch-fix-review-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
  font-size: 12px;
  color: var(--gray-500);
}
.punch-fix-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.punch-fix-status.status-pending {
  background: #FEF3C7;
  color: #B45309;
}
.punch-fix-status.status-approved {
  background: #DCFCE7;
  color: #15803D;
}
.punch-fix-status.status-rejected {
  background: #FEE2E2;
  color: #B91C1C;
}
.punch-fix-admin-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
}
.punch-fix-admin-title span {
  font-size: 12px;
  color: var(--gray-400);
  margin-left: 8px;
  font-weight: 600;
}
.punch-fix-admin-times {
  margin-top: 6px;
  font-size: 13px;
  color: var(--gray-500);
}
.punch-fix-admin-main {
  flex: 1;
  min-width: 0;
}
.punch-fix-admin-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ============================================================
   Meeting Results
   ============================================================ */
.meeting-slot {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 8px;
  border: 1px solid var(--gray-100); transition: all 0.2s;
}
.meeting-slot:hover { box-shadow: var(--shadow-md); }
.meeting-slot .slot-date {
  font-weight: 600; min-width: 100px;
}
.meeting-slot .slot-time {
  color: var(--primary); font-weight: 600;
}
.meeting-slot .slot-coverage {
  margin-left: auto; font-size: 12px; color: var(--gray-400); font-weight: 500;
}
.meeting-slot .slot-confirm-btn {
  margin-left: 8px; padding: 6px 14px; border: none; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 700;
  font-family: var(--font); cursor: pointer; white-space: nowrap;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(99,102,241,0.25);
}
.meeting-slot .slot-confirm-btn:hover { background: var(--primary-hover); }
.meeting-slot .slot-confirm-btn:active { transform: scale(0.97); }
.meeting-confirm-info {
  background: var(--gray-50); border-radius: var(--radius-sm); padding: 14px;
  margin-bottom: 16px; font-size: 14px; line-height: 1.8;
}
.meeting-confirm-info .label { color: var(--gray-400); font-size: 12px; font-weight: 600; }
.meeting-confirm-info .value { font-weight: 600; color: var(--gray-800); }

/* ============================================================
   Icon Color / Emoji Picker
   ============================================================ */
.icon-type-tabs {
  display: flex; gap: 4px; margin-bottom: 12px;
  background: var(--gray-100); border-radius: 8px; padding: 3px;
}
.icon-type-tab {
  flex: 1; padding: 6px 0; border: none; border-radius: 6px;
  font-size: 12px; font-weight: 600; font-family: var(--font);
  background: transparent; color: var(--gray-400); cursor: pointer;
  transition: all 0.2s;
}
.icon-type-tab.active {
  background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.icon-color-preview {
  width: 56px; height: 56px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 24px; font-weight: 700;
  margin: 0 auto 12px; background: var(--primary);
  transition: background 0.15s;
}
.icon-color-preview.emoji-mode {
  background: var(--gray-100) !important; font-size: 32px;
}
.icon-color-picker {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
}
.icon-color-option {
  width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: all 0.15s; display: flex; align-items: center; justify-content: center;
}
.icon-color-option:hover { transform: scale(1.15); }
.icon-color-option.selected {
  border-color: var(--gray-800); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gray-800);
}
.icon-emoji-picker {
  display: flex; flex-wrap: wrap; gap: 4px; justify-content: center;
  max-height: 180px; overflow-y: auto; padding: 4px;
}
.icon-emoji-option {
  width: 36px; height: 36px; border-radius: 8px; border: 2px solid transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 22px; transition: all 0.15s; background: transparent;
  padding: 0;
}
.icon-emoji-option:hover { background: var(--gray-100); transform: scale(1.15); }
.icon-emoji-option.selected {
  border-color: var(--primary); background: var(--primary-bg);
}
.staff-avatar-emoji {
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; background: var(--gray-100); line-height: 1;
}
.shift-dot-emoji {
  display: inline; margin-right: 2px; font-size: 10px; line-height: 1;
}
.register-emoji-preview {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; background: var(--gray-100);
  transition: all 0.15s;
}

/* ============================================================
   My Shift Calendar View (マイシフトカレンダー)
   ============================================================ */
#my-shift-calendar {
  display: block; border: 1px solid var(--gray-200); border-radius: var(--radius);
  overflow: hidden; background: #fff;
}
#my-shift-calendar .cal-header {
  display: grid; grid-template-columns: repeat(7, 1fr);
}
#my-shift-calendar .cal-header-cell {
  padding: 10px 2px; text-align: center; font-size: 11px;
  font-weight: 600; color: var(--gray-400); background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
#my-shift-calendar .cal-header-cell.sun { color: var(--danger); }
#my-shift-calendar .cal-header-cell.sat { color: var(--primary); }
#my-shift-calendar .cal-body { }
#my-shift-calendar .cal-row {
  display: grid; grid-template-columns: repeat(7, 1fr);
}
#my-shift-calendar .cal-cell {
  min-height: 64px; padding: 4px; border-right: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100); cursor: pointer;
  transition: background 0.15s; position: relative;
}
#my-shift-calendar .cal-cell:hover { background: var(--gray-50); }
#my-shift-calendar .cal-cell.empty { cursor: default; }
#my-shift-calendar .cal-cell.today { background: var(--primary-bg); }
#my-shift-calendar .cal-day-num {
  font-size: 12px; font-weight: 600; margin-bottom: 2px;
}
#my-shift-calendar .cal-row .cal-cell:nth-child(7n+1) .cal-day-num { color: var(--danger); }
#my-shift-calendar .cal-row .cal-cell:nth-child(7n) .cal-day-num { color: var(--primary); }
#my-shift-calendar .cal-cell.today .cal-day-num {
  background: var(--primary); color: #fff; width: 22px; height: 22px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   My Page (マイページ)
   ============================================================ */
.mypage-container {
  max-width: 560px; margin: 0 auto; padding: 0 4px;
}
.mypage-summary {
  display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px;
}
.mypage-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; border-radius: var(--radius); background: #fff;
  box-shadow: var(--shadow); border-left: 4px solid transparent;
  border: 1px solid var(--gray-100);
}
.mypage-card.card-shift { border-left: 4px solid #2563EB; }
.mypage-card.card-actual { border-left: 4px solid #059669; }
.mypage-card.card-diff.diff-remaining { border-left: 4px solid #D97706; }
.mypage-card.card-diff.diff-positive { border-left: 4px solid #059669; }
.mypage-card-icon {
  width: 42px; height: 42px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.card-shift .mypage-card-icon { background: #EFF6FF; color: #2563EB; }
.card-actual .mypage-card-icon { background: #ECFDF5; color: #059669; }
.card-diff.diff-remaining .mypage-card-icon { background: #FFFBEB; color: #D97706; }
.card-diff.diff-positive .mypage-card-icon { background: #ECFDF5; color: #059669; }
.mypage-card-body { flex: 1; }
.mypage-card-label { font-size: 12px; color: var(--gray-400); margin-bottom: 2px; font-weight: 600; }
.mypage-card-value { font-size: 28px; font-weight: 800; line-height: 1.2; color: var(--gray-800); letter-spacing: -1px; }
.mypage-card-value small { font-size: 14px; font-weight: 500; color: var(--gray-400); margin-left: 2px; }
.mypage-card-sub { font-size: 14px; color: var(--gray-500); margin-top: 2px; }

.mypage-cards-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

.mypage-target-section {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px; border: 1px solid var(--gray-100);
}
.mypage-target-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--gray-700); margin-bottom: 12px;
}
.mypage-target-header .material-icons-round { font-size: 20px; color: var(--primary); }
.mypage-target-header strong { color: var(--gray-800); }
.mypage-target-progress { margin-bottom: 10px; }
.mypage-target-bar {
  height: 10px; background: var(--gray-100); border-radius: 5px; overflow: hidden;
  margin-bottom: 6px;
}
.mypage-target-fill {
  height: 100%; border-radius: 5px; transition: width 0.6s ease;
  background: linear-gradient(90deg, var(--primary), #10B981);
}
.mypage-target-stats {
  display: flex; justify-content: space-between; font-size: 13px;
}
.target-done { color: #059669; font-weight: 700; }
.target-remain { color: var(--gray-400); }

.mypage-pace {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
}
.mypage-pace .material-icons-round { font-size: 18px; }
.pace-ahead { background: #ECFDF5; color: #059669; }
.pace-on-track { background: #EFF6FF; color: #2563EB; }
.pace-behind { background: #FEF2F2; color: #DC2626; }
.pace-past { background: var(--gray-50); color: var(--gray-400); }

.mypage-daily-header {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
  padding: 10px 12px; font-size: 11px; color: var(--gray-400); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 2px solid var(--gray-200);
}
.mypage-daily-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
  padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--gray-100);
  align-items: center; transition: background 0.15s;
}
.mypage-daily-row:hover { background: var(--gray-50); }
.mypage-daily-row.weekend { background: #FAFAFA; }
.daily-date { font-weight: 700; color: var(--gray-700); }
.daily-shift { color: #2563EB; font-weight: 600; }
.daily-actual { color: #059669; font-weight: 600; }
.daily-diff.positive { color: #059669; }
.daily-diff.negative { color: #DC2626; }
.mypage-empty {
  text-align: center; padding: 40px 16px; color: var(--gray-300); font-size: 14px;
}

/* ============================================================
   Punch Clock (打刻)
   ============================================================ */
.punch-container {
  display: flex; flex-direction: column; align-items: center;
  padding: 32px 16px 40px;
}
.punch-clock {
  font-size: 64px; font-weight: 800; letter-spacing: -2px;
  color: var(--gray-800); font-variant-numeric: tabular-nums;
  line-height: 1;
}
.punch-date {
  font-size: 16px; color: var(--gray-400); margin-top: 8px; font-weight: 600;
}
.punch-status {
  display: flex; align-items: center; gap: 8px;
  margin-top: 24px; padding: 10px 20px;
  background: var(--gray-100); border-radius: 24px;
  font-size: 14px; color: var(--gray-500); font-weight: 500;
}
.punch-status .material-icons-round { font-size: 20px; }
.punch-status.status-in {
  background: var(--success-bg); color: var(--success);
}
.punch-status.status-out {
  background: var(--primary-bg); color: var(--primary);
}
.punch-buttons {
  display: flex; gap: 24px; margin-top: 36px;
}
.punch-btn {
  width: 130px; height: 130px; border-radius: 50%;
  border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; font-family: var(--font); font-weight: 800;
  font-size: 18px; transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.punch-btn .material-icons-round { font-size: 36px; }
.punch-btn:active { transform: scale(0.95); }
.punch-btn:disabled {
  opacity: 0.3; cursor: not-allowed; transform: none;
  box-shadow: none;
}
.punch-btn.punch-in {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #fff;
}
.punch-btn.punch-in:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}
.punch-btn.punch-out {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #fff;
}
.punch-btn.punch-out:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
}
.punch-quick-add {
  width: 100%;
  max-width: 480px;
  margin-top: 18px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.punch-quick-title {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}
.punch-quick-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.punch-quick-btn {
  min-width: 76px;
  font-weight: 700;
}
.punch-quick-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.punch-quick-note {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
}
.punch-log {
  margin-top: 36px; width: 100%; max-width: 360px;
}
.punch-log-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 8px; border: 1px solid var(--gray-100);
}
.punch-log-label { font-size: 13px; color: var(--gray-400); font-weight: 600; }
.punch-log-time { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.punch-log-time.time-in { color: var(--success); }
.punch-log-time.time-out { color: var(--warning); }
.punch-log-work {
  text-align: center; padding: 14px; background: var(--primary-bg);
  border-radius: var(--radius); color: var(--primary);
  font-weight: 700; font-size: 15px;
}

/* ============================================================
   Onboarding
   ============================================================ */
.onboarding-container {
  max-width: 560px; margin: 0 auto; padding: 24px 16px;
  height: 100%; overflow-y: auto;
}
.onboarding-header {
  text-align: center; margin-bottom: 24px;
}
.onboarding-header h2 {
  font-size: 22px; font-weight: 800; margin-top: 8px; letter-spacing: -0.5px;
}
.onboarding-subtitle {
  font-size: 13px; color: var(--gray-400); margin-top: 4px;
}

.step-indicator {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 28px; padding: 0 8px;
}
.step-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  position: relative; flex-shrink: 0;
}
.step-circle {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gray-200); color: var(--gray-400);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; transition: all 0.3s;
}
.step-item.active .step-circle,
.step-item.completed .step-circle {
  background: var(--primary); color: #fff;
}
.step-item.completed .step-circle {
  background: var(--success);
}
.step-label {
  font-size: 11px; color: var(--gray-400); white-space: nowrap;
  transition: color 0.3s;
}
.step-item.active .step-label { color: var(--primary); font-weight: 600; }
.step-item.completed .step-label { color: var(--success); }
.step-line {
  flex: 1; height: 2px; background: var(--gray-200);
  min-width: 20px; margin: 0 4px; margin-bottom: 18px;
  transition: background 0.3s;
}
.step-line.completed { background: var(--success); }

.onboarding-step {
  display: none; animation: fadeInUp 0.3s ease;
}
.onboarding-step.active { display: block; }
.onboarding-step h3 {
  font-size: 16px; font-weight: 700; margin-bottom: 16px;
  padding-bottom: 8px; border-bottom: 2px solid var(--primary-bg);
}
.onboarding-divider {
  border: none; border-top: 1px solid var(--gray-200);
  margin: 20px 0;
}
.required {
  color: var(--danger); font-weight: 700;
}
.form-hint {
  display: block; font-size: 11px; color: var(--gray-400); margin-top: 4px;
}
.input-error {
  border-color: var(--danger) !important;
}
.form-error-msg {
  display: block; font-size: 12px; color: var(--danger); margin-top: 4px;
}

.onboarding-nav {
  display: flex; align-items: center; gap: 8px;
  margin-top: 24px; padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}

input[type="tel"] {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 14px; font-family: var(--font);
  transition: all 0.2s; background: #fff;
  -webkit-appearance: none;
}
input[type="tel"]:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
textarea {
  resize: vertical;
}

/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }

/* ============================================================
   Mobile-first responsive enhancements
   ============================================================ */

/* --- Extra small screens (< 360px) --- */
@media (max-width: 359px) {
  body { font-size: 13px; }

  .login-container { padding: 16px 16px; justify-content: flex-start; padding-top: 60px; }
  .login-logo { margin-bottom: 24px; }
  .login-logo .material-icons-round { font-size: 44px; }
  .login-logo h1 { font-size: 18px; }
  .login-logo-img { height: 36px; }
  .login-form { padding: 24px 20px; }
  .header-logo { height: 20px; }

  .punch-clock { font-size: 48px; }
  .punch-btn { width: 100px; height: 100px; font-size: 15px; }
  .punch-btn .material-icons-round { font-size: 28px; }
  .punch-buttons { gap: 12px; }
  .punch-quick-add { max-width: 360px; }
  .punch-quick-btn { min-width: 66px; font-size: 12px; padding: 7px 8px; }

  .cal-cell { min-height: 60px; padding: 2px; }
  .shift-dot { font-size: 9px; padding: 0 2px; }
  .cal-header { font-size: 10px; padding: 4px 1px; }
  .cal-cell .day-number { font-size: 11px; }

  .step-circle { width: 26px; height: 26px; font-size: 12px; }
  .step-label { font-size: 10px; }

  .header-left h2 { font-size: 15px; }
  .user-name { display: none; }

  .staff-list-item { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .staff-list-item .staff-actions {
    width: 100%; justify-content: flex-end;
  }

  .meeting-slot { flex-direction: column; align-items: flex-start; gap: 4px; }
  .meeting-slot .slot-coverage { margin-left: 0; }

  .mypage-daily-header,
  .mypage-daily-row {
    font-size: 11px;
    padding: 8px 8px;
    gap: 4px;
  }
}

/* --- Small screens (< 480px) --- */
@media (max-width: 479px) {
  .login-container {
    padding: 20px 16px; justify-content: flex-start;
    padding-top: 10vh;
  }
  .login-logo { margin-bottom: 28px; }
  .login-logo .material-icons-round { font-size: 48px; }
  .login-logo h1 { font-size: 20px; }
  .login-logo-img { height: 40px; }
  .login-form { max-width: 100%; }

  .form-row { grid-template-columns: 1fr; gap: 0; }

  .header-center { display: none; }
  .user-name { display: none; }
  .app-header { padding: 0 12px; }

  .calendar-controls h3 { font-size: 14px; min-width: 100px; }

  .data-table th, .data-table td {
    padding: 8px 6px; font-size: 12px;
  }

  .stat-card .stat-value { font-size: 22px; }
  .stat-card { padding: 14px; }

  .view-tab { padding: 8px 0; font-size: 12px; }

  .filter-chip { padding: 4px 8px; font-size: 11px; }

  .staff-list-item .staff-info .meta {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100vw - 120px);
  }

  .page { padding: 14px; }

  .punch-log { max-width: 100%; }
  .punch-log-time { font-size: 18px; }

  .modal-content { max-height: 95vh; }
  .modal-body { padding: 16px; }
  .modal-header { padding: 14px 16px; }
  .modal-footer { padding: 12px 16px; }

  .onboarding-container { padding: 16px 12px; }
  .onboarding-header h2 { font-size: 20px; }
  .step-indicator { gap: 0; padding: 0 4px; }
  .step-line { min-width: 12px; }
  .onboarding-nav {
    flex-wrap: wrap; gap: 8px;
  }
  .onboarding-nav .btn { flex: 1; min-width: 0; text-align: center; }
  .onboarding-nav div[style*="flex:1"] { display: none; }

  /* Card padding reduction */
  .card { padding: 16px; }
  .card h3 { font-size: 15px; margin-bottom: 14px; }

  /* Mypage cards row */
  .mypage-cards-row { grid-template-columns: 1fr; }
  .mypage-card-value { font-size: 24px; }

  /* Stats row */
  .stats-row { grid-template-columns: 1fr 1fr; }

  /* Staff actions wrap */
  .staff-actions { flex-wrap: wrap; }
  .staff-actions .btn { font-size: 12px; padding: 4px 10px; }

  /* Report check legends */
  #page-report-check .card > div { font-size: 12px; }

  .active-workers-summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .active-workers-updated {
    width: 100%;
    margin-left: 0;
  }
  .org-chart-head {
    flex-direction: column;
  }
  .org-chart-view-switch {
    justify-content: flex-start;
  }
  .org-editor-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .org-editor-section-row {
    grid-template-columns: 1fr;
  }
  .org-chart-stats {
    justify-content: flex-start;
  }
  .org-chart-member-grid {
    grid-template-columns: 1fr;
  }
  .org-chart-member-meta {
    white-space: normal;
  }
  .org-chart-tree ul {
    gap: 10px;
  }
  .org-tree-node {
    width: 196px;
  }
  .punch-fix-request-head,
  .punch-fix-admin-item {
    flex-direction: column;
  }
  .punch-fix-admin-actions {
    width: 100%;
  }
  .punch-fix-admin-actions .btn {
    flex: 1;
  }
}

/* --- Touch-friendly targets --- */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .btn-icon { width: 44px; height: 44px; }
  .nav-item { padding: 14px 20px; min-height: 48px; }
  .filter-chip { min-height: 36px; padding: 6px 12px; }
  .checkbox-label { min-height: 44px; padding: 8px 12px; }
  .shift-type-chip { min-height: 44px; padding: 10px 16px; }
  .view-tab { min-height: 44px; }
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="date"], input[type="time"],
  input[type="file"], input[type="tel"], select, textarea {
    min-height: 44px; padding: 10px 14px;
  }

  .week-day-card { padding: 14px; }
  .punch-btn { min-width: 120px; min-height: 120px; }
}

/* --- Medium screens --- */
@media (min-width: 480px) and (max-width: 767px) {
  .staff-list-item .staff-actions { gap: 6px; }
}

/* --- Desktop enhancements --- */
@media (min-width: 768px) {
  .modal-content {
    border-radius: var(--radius);
    max-height: 80vh;
  }
  .modal { align-items: center; }
  .cal-cell { min-height: 100px; }

  .staff-list-item .staff-actions .btn { padding: 6px 12px; }

  .active-workers-table-head {
    display: grid;
    grid-template-columns: minmax(220px, 1.1fr) minmax(260px, 1.4fr) minmax(180px, 0.8fr);
    gap: 16px;
    padding: 0 16px 2px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-400);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .active-worker-item {
    grid-template-columns: minmax(220px, 1.1fr) minmax(260px, 1.4fr) minmax(180px, 0.8fr);
    gap: 16px;
  }

  .fab { bottom: calc(24px + var(--safe-bottom)); }
  .toast-container { bottom: calc(24px + var(--safe-bottom)); }
}

/* --- Large desktop --- */
@media (min-width: 1024px) {
  .page { max-width: 960px; margin: 0 auto; }
  .punch-container { max-width: 600px; margin: 0 auto; }
  .active-workers-list { gap: 12px; }
  .active-worker-item { padding: 18px; }
  .active-worker-item .worker-meta { gap: 8px; }
}

/* ============================================================
   Table responsive wrapper
   ============================================================ */
.table-wrapper {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ============================================================
   Safe area padding
   ============================================================ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .modal-footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .onboarding-nav {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* ============================================================
   Prevent horizontal overflow
   ============================================================ */
#app {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  height: 100%;
}
.main-content {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.page {
  max-width: 100%;
  overflow-x: hidden;
}
.data-table {
  min-width: 480px;
}
/* Cards & elements must not exceed parent */
.card, .stat-card, .staff-list-item, .mypage-card {
  max-width: 100%;
  overflow: hidden;
  word-break: break-word;
}

/* ============================================================
   Daily Report Input
   ============================================================ */
.dr-input-container { max-width: 600px; margin: 0 auto; padding: 16px; }
.dr-today-status { margin-bottom: 16px; }
.dr-status-row { display: flex; gap: 8px; flex-wrap: wrap; }
.dr-status-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
  flex: 1; min-width: 140px; justify-content: center;
}
.dr-status-chip.ok { background: var(--success-bg); color: var(--success); }
.dr-status-chip.ok .material-icons-round { color: var(--success); }
.dr-status-chip.pending { background: var(--gray-100); color: var(--gray-400); }
.dr-status-chip.pending .material-icons-round { color: var(--gray-400); }
.dr-status-chip .material-icons-round { font-size: 18px; }

.dr-type-tabs {
  display: flex; gap: 0; margin-bottom: 16px;
  border-radius: var(--radius); overflow: hidden;
  border: 1.5px solid var(--gray-200);
}
.dr-type-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; border: none; background: var(--gray-50);
  font-size: 14px; font-weight: 600; color: var(--gray-400);
  cursor: pointer; transition: all 0.2s;
}
.dr-type-tab .material-icons-round { font-size: 18px; }
.dr-type-tab.active { background: var(--primary); color: #fff; }

.dr-form textarea {
  width: 100%; padding: 14px; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); font-family: var(--font); font-size: 14px;
  resize: vertical; line-height: 1.6; box-sizing: border-box;
}
.dr-form textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.dr-form textarea[readonly] { background: var(--gray-50); color: var(--gray-400); }
.dr-form .form-group { margin-bottom: 12px; }
.dr-form .form-group label {
  font-size: 13px; font-weight: 700; color: var(--gray-700);
  margin-bottom: 6px; display: block;
}

/* ============================================================
   Onboarding Detail Modal (Admin)
   ============================================================ */
.onb-detail-section { margin-bottom: 20px; }
.onb-detail-section:last-child { margin-bottom: 0; }
.onb-detail-section-title {
  font-size: 13px; font-weight: 700; color: var(--primary);
  padding: 6px 0; margin-bottom: 10px;
  border-bottom: 2px solid var(--primary-bg);
}
.onb-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
}
.onb-detail-item {
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 0;
}
.onb-detail-label {
  font-size: 11px; color: var(--gray-400); font-weight: 600;
}
.onb-detail-value {
  font-size: 14px; color: var(--gray-800); word-break: break-all;
}
@media (max-width: 480px) {
  .onb-detail-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Mobile-friendly Grid helpers
   ============================================================ */
.summary-cards-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.staff-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  font-size: 12px;
  margin-bottom: 12px;
}
.staff-detail-grid > div {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.short-notice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
@media (max-width: 479px) {
  .summary-cards-3 {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .staff-detail-grid {
    grid-template-columns: 1fr;
    gap: 4px 0;
  }
  .short-notice-row {
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 8px 12px;
    font-size: 12px;
  }
  .short-notice-row .sn-time { display: none; }
}
@media (min-width: 480px) and (max-width: 767px) {
  .summary-cards-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .org-chart-member-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ============================================================
   Bottom Navigation
   ============================================================ */
.bottom-nav {
  display: flex; align-items: center; justify-content: space-around;
  height: 60px; background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-bottom: var(--safe-bottom);
  flex-shrink: 0; z-index: 100;
  position: relative;
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; flex: 1; height: 100%;
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); transition: color 0.2s;
  font-family: var(--font); padding: 0;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.bottom-nav-item .material-icons-round { font-size: 24px; transition: all 0.2s; }
.bottom-nav-label { font-size: 10px; font-weight: 600; line-height: 1; }
.bottom-nav-item.active {
  color: var(--primary);
}
.bottom-nav-item.active .material-icons-round {
  font-size: 26px;
}
.bottom-nav-item.active::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 32px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--primary);
}

@media (min-width: 768px) {
  .bottom-nav { display: none; }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(60px + env(safe-area-inset-bottom));
  }
}
