@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;600;700&display=swap');

/* ==================== DESIGN TOKENS ==================== */
:root {
  --primary: #4DB6A8;
  --primary-dark: #3D9B8F;
  --primary-light: #80CBC4;
  --primary-bg: #E0F2F1;
  --secondary: #43A047;
  --secondary-light: #66BB6A;
  --secondary-bg: #E8F5E9;
  --accent: #C0504D;
  --accent-bg: #FDECEA;
  --error: #C0504D;
  --error-bg: #FDECEA;
  --purple: #C0504D;
  --purple-bg: #FDECEA;
  --bg: #F5F5F5;
  --surface: #FFFFFF;
  --text: #333333;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --border: #E0E0E0;
  --border-light: #F0F0F0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.06);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Noto Sans JP', -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ==================== UTILITIES ==================== */
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mt-6 { margin-top: var(--sp-6); }
.text-sm { font-size: 13px; }
.text-secondary { color: var(--text-secondary); }
.font-medium { font-weight: 500; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-3 { gap: var(--sp-3); }

/* ==================== LOGIN PAGE ==================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2C3E50 0%, #1A1A2E 50%, #2C3E50 100%);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(77,182,168,0.15) 0%, transparent 70%);
  top: -200px; right: -100px;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(192,80,77,0.1) 0%, transparent 70%);
  bottom: -200px; left: -100px;
}
.login-container {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 440px;
  z-index: 1;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.4);
}
.login-logo { text-align: center; margin-bottom: 36px; }
.login-logo .logo-icon { font-size: 48px; margin-bottom: 12px; }
.login-logo h1 { font-size: 26px; font-weight: 700; color: #FFFFFF; letter-spacing: -0.5px; }
.login-logo p { font-size: 14px; color: rgba(255,255,255,0.5); margin-top: 4px; }

/* Role selection */
.role-selector { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.role-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  background: rgba(255,255,255,0.02);
}
.role-card:hover { border-color: rgba(77,182,168,0.5); background: rgba(77,182,168,0.08); }
.role-card.selected { border-color: var(--primary); background: rgba(77,182,168,0.12); box-shadow: 0 0 0 1px var(--primary); }
.role-card .role-icon { font-size: 28px; width: 44px; text-align: center; }
.role-card .role-name { font-size: 15px; font-weight: 600; color: #FFFFFF; }
.role-card .role-desc { font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 2px; }
.role-card .role-platform {
  margin-left: auto;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
}
.role-platform.ios { background: rgba(77,182,168,0.15); color: #80CBC4; }
.role-platform.web { background: rgba(192,80,77,0.15); color: #E08080; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.6); margin-bottom: 6px; }
.login-container input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  background: rgba(77,182,168,0.05);
  color: #FFFFFF;
  font-size: 14px;
  transition: var(--transition);
}
.login-container input:focus { outline: none; border-color: var(--primary); background: rgba(77,182,168,0.08); }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #FFFFFF; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-full { width: 100%; }

/* ==================== WEB APP LAYOUT ==================== */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #1A1A2E 0%, #2C3E50 100%);
  color: #FFFFFF;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar-header {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-header .logo-sm { font-size: 24px; }
.sidebar-header h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }
.sidebar-header span { font-size: 11px; color: rgba(255,255,255,0.4); }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-section { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.3); padding: 16px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 400;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9); }
.nav-item.active { background: rgba(77,182,168,0.2); color: #FFFFFF; font-weight: 500; }
.nav-item .nav-icon { font-size: 16px; width: 22px; text-align: center; }
.nav-item .badge {
  position: absolute; right: 12px;
  background: var(--error); color: #FFFFFF;
  font-size: 10px; font-weight: 600;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-footer {
  padding: 16px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #3D9B8F);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #FFFFFF;
  flex-shrink: 0;
}
.user-info .name { font-size: 13px; font-weight: 600; }
.user-info .role { font-size: 11px; color: rgba(255,255,255,0.4); }
.sidebar-footer .logout-btn {
  margin-left: auto; font-size: 11px; color: rgba(255,255,255,0.4);
  background: none; padding: 4px 8px; border-radius: 4px;
}
.sidebar-footer .logout-btn:hover { color: #FFFFFF; background: rgba(255,255,255,0.08); }

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex; flex-direction: column;
}
.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 50;
}
.topbar h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.search-bar {
  display: flex; align-items: center;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
}
.search-bar input { border: none; background: none; outline: none; font-size: 13px; width: 200px; color: var(--text); }
.search-icon { margin-right: 8px; font-size: 14px; }
.notification-bell {
  background: none; font-size: 20px; position: relative; padding: 4px;
}
.notification-bell .dot {
  position: absolute; top: 2px; right: 2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--error);
}

.page-content { padding: 28px; flex: 1; }
.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ==================== CARDS & STATS ==================== */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 18px 22px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stat-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.stat-icon { font-size: 20px; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -1px; }
.stat-change { font-size: 12px; margin-top: 4px; }
.stat-change.up { color: var(--secondary); }
.stat-change.down { color: var(--error); }

.stat-card.blue .stat-value { color: var(--primary); }
.stat-card.green .stat-value { color: var(--secondary); }
.stat-card.amber .stat-value { color: var(--accent); }
.stat-card.red .stat-value { color: var(--error); }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ==================== TABLES ==================== */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px; font-size: 13px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
tbody tr:hover { background: var(--primary-bg); }
tbody tr:last-child td { border-bottom: none; }

/* ==================== BADGES ==================== */
.badge-status {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.badge-status.active { background: var(--secondary-bg); color: var(--secondary); }
.badge-status.error { background: var(--error-bg); color: var(--error); }
.badge-status.warning { background: var(--accent-bg); color: var(--accent); }
.badge-status.info { background: var(--primary-bg); color: var(--primary); }
.badge-status.pending { background: #F1F5F9; color: #64748B; }
.badge-status.inactive { background: #F1F5F9; color: #94A3B8; }

/* ==================== CHARTS ==================== */
.bar-chart { display: flex; align-items: flex-end; justify-content: space-around; height: 200px; padding: 10px 0; }
.bar-item { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.bar { width: 32px; border-radius: 4px 4px 0 0; min-height: 4px; transition: height 0.6s ease; }
.bar-value { font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.bar-label { font-size: 11px; color: var(--text-tertiary); }

/* ==================== LIST ITEMS ==================== */
.list-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.list-item:last-child { border-bottom: none; }
.list-icon { width: 38px; height: 38px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.list-text { flex: 1; }
.list-text .title { font-size: 13px; font-weight: 500; }
.list-text .desc { font-size: 12px; color: var(--text-secondary); }
.list-time { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; }

/* ==================== FORMS ==================== */
.page-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.filter-bar { display: flex; gap: 10px; }
.filter-select {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; background: var(--surface); color: var(--text); cursor: pointer;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card .form-group label { color: var(--text-secondary); }
.card input, .card select, .card textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  transition: var(--transition);
}
.card input:focus, .card select:focus, .card textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.card textarea { min-height: 80px; resize: vertical; }

/* ==================== DETAIL PAGE ==================== */
.breadcrumb { font-size: 13px; color: var(--text-secondary); }
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { text-decoration: underline; }
.detail-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.detail-icon { font-size: 40px; width: 64px; height: 64px; background: var(--primary-bg); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; }
.detail-info h2 { font-size: 20px; font-weight: 700; }
.detail-meta { display: flex; gap: 16px; margin-top: 6px; font-size: 13px; color: var(--text-secondary); }
.detail-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 2px solid var(--border); }
.detail-tab {
  padding: 10px 20px; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: var(--transition);
}
.detail-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.detail-tab:hover { color: var(--text); }
.tab-content { display: none; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.info-item { display: flex; flex-direction: column; gap: 2px; }
.info-item .label { font-size: 12px; color: var(--text-secondary); }
.info-item .value { font-size: 14px; font-weight: 500; }

/* ==================== SETTINGS ==================== */
.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
.settings-nav { list-style: none; }
.settings-nav li {
  padding: 10px 14px; font-size: 14px; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text-secondary); transition: var(--transition);
}
.settings-nav li:hover { background: var(--bg); color: var(--text); }
.settings-nav li.active { background: var(--primary-bg); color: var(--primary); font-weight: 500; }

/* ==================== MODALS ==================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: none; align-items: center; justify-content: center; z-index: 1000;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-xl);
  width: 540px; max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; font-size: 18px; color: var(--text-secondary); padding: 4px; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ==================== TOAST ==================== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  animation: slideIn 0.3s ease;
  font-size: 13px;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { border-left: 4px solid var(--secondary); }
.toast.error { border-left: 4px solid var(--error); }
.toast.info { border-left: 4px solid var(--primary); }
.toast .toast-icon { font-size: 18px; }
.toast .toast-title { font-weight: 600; }
.toast .toast-msg { color: var(--text-secondary); font-size: 12px; }

/* ==================== CHECKLIST ==================== */
.checklist { list-style: none; }
.checklist-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border-light);
  cursor: pointer; transition: var(--transition);
}
.checklist-item:hover { background: var(--primary-bg); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: var(--radius-sm); }
.check-box {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.checklist-item.checked .check-box { background: var(--secondary); border-color: var(--secondary); color: #FFFFFF; }
.checklist-item.checked .check-box::after { content: '✓'; font-size: 13px; font-weight: 700; }
.check-text { font-size: 14px; }

/* ==================== iOS APP FRAME ==================== */
.ios-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1A1A2E 0%, #2C3E50 50%, #1A1A2E 100%);
  padding: 40px 20px;
}
.iphone-frame {
  width: 375px;
  height: 812px;
  background: #000;
  border-radius: 50px;
  padding: 12px;
  box-shadow: 0 0 0 2px #333, 0 0 0 5px #1a1a1a, 0 30px 60px rgba(0,0,0,0.5);
  position: relative;
}
.iphone-screen {
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 40px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.iphone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 34px;
  background: #000;
  border-radius: 0 0 20px 20px;
  z-index: 10;
}
.ios-status-bar {
  height: 50px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 24px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.ios-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ios-tab-bar {
  height: 84px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  padding-top: 8px;
  flex-shrink: 0;
}
.ios-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  cursor: pointer;
  transition: var(--transition);
  background: none;
}
.ios-tab .tab-icon { font-size: 22px; }
.ios-tab .tab-label { font-size: 10px; color: var(--text-secondary); font-weight: 500; }
.ios-tab.active .tab-label { color: var(--primary); font-weight: 600; }
.ios-tab .tab-badge {
  position: absolute; top: -2px; right: calc(50% - 18px);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--error); color: #FFF;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* iOS Pages */
.ios-page { display: none; padding: 0 20px 20px; }
.ios-page.active { display: block; animation: fadeIn 0.3s ease; }
.ios-page-title { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 20px; padding-top: 8px; }

.ios-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.ios-card h4 { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }

.ios-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.ios-list-item:last-child { border-bottom: none; }
.ios-list-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.ios-list-text { flex: 1; }
.ios-list-text .ios-title { font-size: 14px; font-weight: 500; }
.ios-list-text .ios-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.ios-list-arrow { color: var(--text-tertiary); font-size: 14px; }

/* QR Scanner */
.qr-scanner-area {
  width: 100%;
  height: 240px;
  background: #000;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}
.qr-scanner-area::before {
  content: '';
  width: 200px; height: 200px;
  border: 2px solid rgba(77,182,168,0.8);
  border-radius: 12px;
  animation: pulse 2s ease-in-out infinite;
}
.qr-scanner-area::after {
  content: '';
  position: absolute;
  width: 200px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: scan 2s ease-in-out infinite;
}
@keyframes scan { 0%,100% { top: 30%; } 50% { top: 70%; } }
@keyframes pulse { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }

/* iOS inspection checklist */
.ios-checklist-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.ios-checklist-item:active { transform: scale(0.98); }
.ios-checklist-item.checked { border-color: var(--secondary); background: var(--secondary-bg); }
.ios-check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: var(--transition);
}
.ios-checklist-item.checked .ios-check { background: var(--secondary); border-color: var(--secondary); color: #FFF; }
.ios-checklist-item.checked .ios-check::after { content: '✓'; font-size: 13px; font-weight: 700; }

/* iOS form elements */
.ios-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 15px;
  margin-bottom: 12px;
}
.ios-input:focus { outline: none; border-color: var(--primary); }
.ios-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 15px;
  min-height: 100px;
  resize: none;
  margin-bottom: 12px;
  font-family: inherit;
}
.ios-btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.ios-btn-primary { background: var(--primary); color: #FFF; }
.ios-btn-primary:active { background: var(--primary-dark); transform: scale(0.98); }
.ios-btn-secondary { background: var(--bg); color: var(--primary); border: 1px solid var(--border); }
.ios-btn-danger { background: var(--error); color: #FFF; }

.ios-media-btns { display: flex; gap: 10px; margin-bottom: 16px; }
.ios-media-btn {
  flex: 1; padding: 14px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; transition: var(--transition);
  font-size: 13px; color: var(--text-secondary); font-weight: 500;
}
.ios-media-btn:active { border-color: var(--primary); background: var(--primary-bg); }
.ios-media-btn .media-icon { font-size: 24px; }

/* Navigation bar for iOS sub-pages */
.ios-navbar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px 8px;
  background: var(--bg);
}
.ios-back-btn {
  background: none; border: none; font-size: 14px;
  color: var(--primary); display: flex; align-items: center; gap: 4px;
  cursor: pointer; font-weight: 500;
}
.ios-navbar-title { font-size: 16px; font-weight: 600; flex: 1; text-align: center; margin-right: 60px; }

/* iOS notification items */
.ios-notif-item {
  display: flex; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.ios-notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.ios-notif-text .notif-title { font-size: 14px; font-weight: 500; }
.ios-notif-text .notif-body { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.ios-notif-text .notif-time { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

/* Role switch button */
.role-switch-btn {
  position: fixed; bottom: 20px; right: 20px;
  background: linear-gradient(135deg, #4DB6A8, #C0504D);
  color: #FFF; border: none;
  padding: 12px 20px; border-radius: 50px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  cursor: pointer; z-index: 9000;
  transition: var(--transition);
}
.role-switch-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-xl); }

/* Audit log styles */
.audit-log-item {
  display: flex; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.audit-log-item:last-child { border-bottom: none; }
.audit-time { color: var(--text-tertiary); white-space: nowrap; min-width: 130px; }
.audit-user { font-weight: 500; min-width: 100px; }
.audit-action { color: var(--text-secondary); }
