/* ============ ERP 企业级风格 - 设备管理系统 ============ */

:root {
  --sidebar-w: 220px;
  --topbar-h: 52px;
  --primary: #2563eb;
  --primary-light: #eff6ff;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --sidebar-active: #2563eb;
  --topbar-bg: #ffffff;
  --content-bg: #f1f5f9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--content-bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* ============ 登录页 ============ */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1rem;
  background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #1e293b 100%);
}
.login-card {
  background: #fff; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  padding: 2.5rem 2rem; width: 100%; max-width: 380px; text-align: center;
}
.login-icon {
  width: 52px; height: 52px; background: var(--primary); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 0.75rem; color: #fff; font-size: 14px; font-weight: 700; letter-spacing: 0.05em;
}
.login-card h1 { font-size: 1.25rem; font-weight: 700; color: var(--text); margin-bottom: 0.25rem; }
.login-card p { color: var(--text-muted); font-size: 0.8125rem; margin-bottom: 1.5rem; }
.login-card input {
  width: 100%; padding: 0.65rem 0.75rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.9375rem; text-align: center;
  letter-spacing: 0.25em; outline: none; transition: border-color 0.15s;
}
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.login-card input::placeholder { letter-spacing: normal; color: var(--text-muted); }
.login-error { color: var(--danger); font-size: 0.75rem; margin-top: 0.5rem; min-height: 1.1rem; }
.btn-login {
  width: 100%; padding: 0.65rem; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius); font-size: 0.9375rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s; margin-top: 0.25rem;
}
.btn-login:hover { background: var(--primary-dark); }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; }

/* ============ ERP 主布局 ============ */
.erp-layout { display: none; }
.erp-layout.active { display: flex; min-height: 100vh; }

/* 左侧导航 */
.sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--sidebar-bg); color: #fff;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
}
.sidebar-brand {
  padding: 1.25rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 0.625rem;
}
.brand-icon { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.05em; }
.brand-title { font-size: 0.9375rem; font-weight: 700; }
.brand-sub { font-size: 0.6875rem; color: rgba(255,255,255,0.4); }
.sidebar-nav { flex: 1; padding: 0.75rem 0.5rem; display: flex; flex-direction: column; gap: 0.125rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.55rem 0.75rem; border-radius: var(--radius);
  color: rgba(255,255,255,0.7); font-size: 0.8125rem; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: all 0.15s;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-footer { padding: 0.75rem 0.5rem; border-top: 1px solid rgba(255,255,255,0.08); }
.btn-sidebar {
  width: 100%; padding: 0.45rem; background: transparent; border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius); color: rgba(255,255,255,0.6); font-size: 0.75rem;
  cursor: pointer; transition: all 0.15s;
}
.btn-sidebar:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* 右侧主区域 */
.main-area {
  flex: 1; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column; min-height: 100vh;
}

/* 顶部栏 */
.topbar {
  height: var(--topbar-h); background: var(--topbar-bg);
  border-bottom: 1px solid var(--border); box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; position: sticky; top: 0; z-index: 40;
}
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 0.5rem; }

/* 内容区 */
.content { flex: 1; padding: 1.25rem 1.5rem; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.4rem 0.8rem; border: none; border-radius: var(--radius);
  font-size: 0.78125rem; font-weight: 500; cursor: pointer;
  transition: all 0.12s; white-space: nowrap; line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--content-bg); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.75rem; }

/* ============ 统计卡片行 ============ */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat-item {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 0.875rem 1rem; border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
}
.stat-item.stat-green { border-left-color: var(--success); }
.stat-item.stat-red { border-left-color: var(--danger); }
.stat-item.stat-amber { border-left-color: var(--warning); }
.stat-num { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-label { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.125rem; }

/* ============ 工具栏 ============ */
.toolbar {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.75rem; flex-wrap: wrap;
}
.input-search {
  flex: 1; min-width: 200px; padding: 0.4rem 0.625rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.8125rem; outline: none; background: var(--card-bg);
}
.input-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
.input-select {
  padding: 0.4rem 0.5rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.8125rem; outline: none;
  background: var(--card-bg); cursor: pointer;
}

/* ============ 数据表格 ============ */
.data-table-wrapper {
  background: var(--card-bg); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.data-table thead { background: #f8fafc; }
.data-table th {
  text-align: left; padding: 0.55rem 0.75rem;
  font-weight: 600; color: var(--text-secondary); font-size: 0.75rem;
  border-bottom: 1px solid var(--border); white-space: nowrap;
  text-transform: uppercase; letter-spacing: 0.02em;
}
.data-table td {
  padding: 0.5rem 0.75rem; border-bottom: 1px solid #f1f5f9;
  color: var(--text); vertical-align: middle;
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }
.table-empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }
.badge {
  font-size: 0.6875rem; padding: 0.15rem 0.5rem; border-radius: 100px;
  font-weight: 600; display: inline-flex; align-items: center; gap: 0.2rem;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.table-actions { display: flex; gap: 0.25rem; }

/* ============ 面板（管理页） ============ */
.admin-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.panel {
  background: var(--card-bg); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
}
.panel-full { grid-column: 1 / -1; }
.panel-header {
  padding: 0.65rem 1rem; font-size: 0.8125rem; font-weight: 600;
  border-bottom: 1px solid var(--border); background: #f8fafc;
}
.panel-body { padding: 1rem; }

/* ============ 表单 ============ */
.form-group { margin-bottom: 0.75rem; }
.form-group label {
  display: block; font-size: 0.75rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 0.25rem;
}
.form-group input, .form-group select {
  width: 100%; padding: 0.4rem 0.6rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.8125rem; outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.form-group input[readonly] { background: #f8fafc; color: var(--text-secondary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-hint { font-size: 0.6875rem; color: var(--text-muted); margin-left: 0.5rem; }

/* ============ 常用借用人标签 ============ */
.borrower-tags {
  display: flex; flex-wrap: wrap; gap: 0.375rem;
  max-height: 200px; overflow-y: auto;
}
.borrower-tag {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.25rem 0.5rem; background: var(--primary-light);
  border: 1px solid #bfdbfe; border-radius: 100px;
  font-size: 0.75rem; color: var(--primary); cursor: default;
}
.borrower-tag .tag-count { color: var(--text-muted); font-size: 0.6875rem; }
.borrower-tag .tag-del {
  cursor: pointer; color: var(--text-muted); font-size: 0.75rem;
  margin-left: 0.125rem; line-height: 1;
}
.borrower-tag .tag-del:hover { color: var(--danger); }

/* 借出弹窗快捷选择 */
.borrower-quick {
  display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.375rem;
}
.borrower-quick .bq-chip {
  padding: 0.2rem 0.5rem; background: var(--content-bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.6875rem; cursor: pointer; transition: all 0.12s;
  color: var(--text-secondary);
}
.borrower-quick .bq-chip:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

/* ============ 历史记录容器 ============ */
.history-container, .admin-container, .about-container { display: none; }
.history-container.active, .admin-container.active, .about-container.active { display: block; }

/* 分页 */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 0.75rem;
}
.pagination button {
  padding: 0.3rem 0.6rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card-bg);
  font-size: 0.75rem; cursor: pointer;
}
.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-info { font-size: 0.75rem; color: var(--text-secondary); }

/* ============ Guest Badge ============ */
.guest-badge {
  display: none; padding: 0.15rem 0.5rem; background: #fef3c7; color: #92400e;
  border: 1px solid #fde68a; border-radius: 3px; font-size: 0.625rem;
  font-weight: 700; letter-spacing: 0.05em; margin-left: 0.625rem;
}
.panel-sub { font-weight: 400; color: var(--text-muted); font-size: 0.6875rem; margin-left: 0.5rem; }
.text-muted { color: var(--text-muted); font-size: 0.75rem; }
.code-tag { font-size: 0.6875rem; background: #f1f5f9; padding: 0.1rem 0.3rem; border-radius: 3px; font-family: 'SF Mono', 'Cascadia Code', monospace; }

/* ============ 模态框 ============ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,0.6); z-index: 200;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--card-bg); border-radius: 8px;
  box-shadow: var(--shadow-lg); width: 100%; max-width: 440px;
  max-height: 90vh; overflow-y: auto; animation: slideUp 0.15s ease;
}
@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-header {
  padding: 0.875rem 1.25rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 0.9375rem; font-weight: 600; }
.modal-close {
  width: 26px; height: 26px; border: none; background: var(--content-bg);
  border-radius: 4px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 0.875rem; color: var(--text-secondary);
}
.modal-close:hover { background: var(--border); }
.modal-body { padding: 1.25rem; }
.modal-footer {
  padding: 0.75rem 1.25rem; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 0.5rem;
}

/* ============ Toast ============ */
.toast-container {
  position: fixed; top: 1rem; right: 1rem; z-index: 300;
  display: flex; flex-direction: column; gap: 0.375rem;
}
.toast {
  padding: 0.6rem 0.875rem; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); font-size: 0.8125rem; font-weight: 500;
  animation: slideIn 0.2s ease; max-width: 300px; color: #fff;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }

/* ============ 移动端汉堡菜单 ============ */
.mobile-menu-btn {
  display: none; background: none; border: none; font-size: 1.25rem;
  cursor: pointer; color: var(--text); padding: 0.25rem; margin-right: 0.5rem;
}
.topbar-left { display: flex; align-items: center; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-loading { pointer-events: none; opacity: 0.7; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* Mobile elements - hidden by default, shown via media query */
.mobile-nav, .mobile-cards, .mobile-records, .search-bar, .filter-chips { display: none; }

@media (min-width: 641px) {
  .mobile-nav, .mobile-cards, .mobile-records, .search-bar, .filter-chips { display: none !important; }
  #dashboardView { display: block !important; }
  .data-table-wrapper { display: block !important; }
  .data-table { display: table !important; }
  .toolbar { display: flex !important; }
}
.date-preset-active { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
  .data-table th:nth-child(4),
  .data-table td:nth-child(4) { display: none; }
  .mobile-menu-btn { display: block; }
}
@media (max-width: 640px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: block; transform: translateX(-100%); transition: transform 0.25s ease; z-index: 60; width: 240px; min-width: 240px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 55; }
  .sidebar-overlay.show { display: block; }
  .main-area { margin-left: 0; }
  .content { padding: 0.5rem; }
  .topbar { padding: 0 0.5rem; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 0.375rem; }
  .stat-item { padding: 0.45rem 0.5rem; }
  .stat-num { font-size: 1.1rem; }
  .toolbar { flex-direction: column; gap: 0.375rem; }
  .toolbar .input-search, .toolbar .input-select { width: 100%; min-width: 100%; }
  .data-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { font-size: 0.7rem; min-width: 600px; }
  .data-table th, .data-table td { padding: 0.3rem 0.35rem; white-space: nowrap; }
  .data-table td { white-space: normal; word-break: break-all; }
  .form-row { grid-template-columns: 1fr; }
  .borrower-quick { max-height: 120px; overflow-y: auto; }
  .modal { max-width: 95vw; margin: 0.5rem; }
  .panel-full .data-table-wrapper { max-height: 200px !important; }
  .btn, .nav-item, .btn-sidebar, .bq-chip { min-height: 44px; display: inline-flex; align-items: center; }
  .btn-sm { min-height: 44px; padding: 0.5rem 0.75rem; font-size: 0.875rem; }

  /* ===== Mobile Layout ===== */
  .mobile-nav { display: flex !important; }
  .mobile-cards { display: block !important; }
  .mobile-records { display: block !important; }
  .search-bar { display: flex !important; }
  .filter-chips { display: flex !important; }
  .main-area { padding-bottom: 80px; }
  .topbar { position: fixed; top:0; left:0; right:0; z-index:45; height:48px; padding:0 0.75rem; }
  .content { padding: 0; padding-top: 48px; }
  .topbar-title { font-size: 0.9375rem; }

  /* Bottom Tab Bar */
  .mobile-nav {
    display: flex; position: fixed; bottom:0; left:0; right:0; z-index:50;
    background: #fff; border-top: 0.5px solid #e5e7eb;
    height: 64px; padding-bottom: env(safe-area-inset-bottom,0);
    box-shadow: 0 -1px 4px rgba(0,0,0,0.04);
  }
  .mnav-item {
    flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap: 3px; color: #9ca3af; font-size: 0.625rem; cursor:pointer; text-decoration:none;
    transition: color 0.2s; padding: 0; -webkit-tap-highlight-color: transparent;
  }
  .mnav-item.active { color: var(--primary); }
  .mnav-dot {
    width: 22px; height: 22px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; line-height: 1;
  }
  .mnav-item .mnav-dot { background: #f1f5f9; color: #9ca3af; }
  .mnav-item.active .mnav-dot { background: #eff6ff; color: var(--primary); }

  /* Pull-to-refresh hint */
  .ptr-hint {
    text-align: center; padding: 0.5rem; font-size: 0.6875rem;
    color: #9ca3af; display: none;
  }
  .ptr-hint.show { display: block; }

  /* Stats - compact row */
  .stats-row {
    display: grid; grid-template-columns: repeat(4,1fr); gap: 0;
    background: #fff; border-bottom: 0.5px solid #f1f5f9; margin-bottom: 0;
  }
  .stat-item {
    padding: 0.625rem 0.25rem; border: none; border-left: none;
    text-align: center; background: #fff;
    border-right: 0.5px solid #f1f5f9;
  }
  .stat-item:last-child { border-right: none; }
  .stat-num { font-size: 1.25rem; font-weight: 600; color: #111827; }
  .stat-label { font-size: 0.625rem; color: #9ca3af; margin-top: 0; }
  .stat-item.stat-green .stat-num { color: #16a34a; }
  .stat-item.stat-red .stat-num { color: #dc2626; }
  .stat-item.stat-amber .stat-num { color: #d97706; }

  /* Filter chips */
  .filter-chips {
    display: flex; gap: 0.375rem; padding: 0.5rem 0.75rem;
    background: #fff; overflow-x: auto; -webkit-overflow-scrolling:touch;
    border-bottom: 0.5px solid #f1f5f9;
    scrollbar-width: none;
  }
  .filter-chips::-webkit-scrollbar { display: none; }
  .fchip {
    padding: 0.3rem 0.625rem; border-radius: 100px; font-size: 0.6875rem;
    white-space: nowrap; cursor: pointer; flex-shrink: 0;
    background: #f1f5f9; color: #64748b; border: 0.5px solid #e2e8f0;
    transition: all 0.15s;
  }
  .fchip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

  /* Equipment Cards */
  .mobile-cards { display: block; padding: 0.5rem 0.75rem; }
  .eq-card {
    background: #fff; border-radius: 10px; padding: 0.75rem;
    margin-bottom: 0.5rem; border: 0.5px solid #f1f5f9;
    box-shadow: 0 0.5px 2px rgba(0,0,0,0.04);
    display: flex; gap: 0.625rem;
  }
  .eq-card.borrowed { border-left: 3px solid #fca5a5; }
  .eq-card.available { border-left: 3px solid #86efac; }
  .eq-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.25rem; }
  .eq-card-name { font-weight: 600; font-size: 0.875rem; color: #111827; }
  .eq-card-code { font-size: 0.625rem; color: #9ca3af; font-family: 'SF Mono',monospace; margin-top: 1px; }
  .eq-card-meta { display: flex; gap: 0.375rem; font-size: 0.6875rem; color: #6b7280; flex-wrap: wrap; margin-top: 0.25rem; }
  .eq-card-meta span { background: #f9fafb; padding: 0.125rem 0.375rem; border-radius: 4px; font-size: 0.625rem; }
  .eq-card-actions { display: flex; gap: 0.375rem; margin-top: 0.375rem; }
  .eq-card-actions .btn { flex: 1; justify-content: center; min-height: 38px; font-size: 0.8125rem; border-radius: 8px; }

  /* Collapse header mobile */
  .collapse-header td { padding: 0.5rem 0.75rem !important; }

  /* Records mobile */
  .mobile-records { display: block; padding: 0.5rem 0.75rem; }
  .rec-item {
    background: #fff; border-radius: 8px; padding: 0.625rem 0.75rem;
    margin-bottom: 0.375rem; border: 0.5px solid #f1f5f9;
    box-shadow: 0 0.5px 1px rgba(0,0,0,0.03);
  }
  .rec-item-row { display: flex; justify-content: space-between; align-items: center; }
  .rec-item-name { font-weight: 600; font-size: 0.8125rem; color: #111827; }
  .rec-item-action { font-weight: 600; font-size: 0.625rem; padding: 0.1rem 0.4rem; border-radius: 4px; }
  .rec-item-action.borrow { color: #dc2626; background: #fef2f2; }
  .rec-item-action.return { color: #16a34a; background: #f0fdf4; }
  .rec-item-meta { color: #9ca3af; font-size: 0.625rem; margin-top: 0.125rem; }

  /* Floating batch button */
  #btnBatchBorrow {
    position: fixed; bottom: 80px; right: 0.75rem; z-index: 49;
    border-radius: 20px; padding: 0.5rem 1rem;
    box-shadow: 0 2px 12px rgba(37,99,235,0.3);
    font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em;
  }

  /* Search bar */
  .search-bar {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.75rem; background: #fff; border-bottom: 0.5px solid #f1f5f9;
  }
  .search-bar input {
    flex: 1; border: none; background: #f1f5f9; border-radius: 8px;
    padding: 0.45rem 0.625rem; font-size: 0.8125rem; outline: none;
  }

  /* Desktop elements hidden on mobile */
  .data-table-wrapper { display: none !important; }
  .data-table { display: none !important; }
  .toolbar { display: none !important; }
  #dashboardView .toolbar { display: none !important; }
  #btnAddEquip { display: none !important; }
  .sidebar-nav .nav-item { display: none; }
  .sidebar-nav .nav-item[data-tab="admin"] { display: flex; }

  /* Sidebar overlay */
  .sidebar { width: 260px; min-width: 260px; }
  .sidebar-overlay { background: rgba(0,0,0,0.5); }

  /* Admin */
  .admin-grid { grid-template-columns: 1fr; gap: 0.5rem; }
  .admin-container .panel { margin: 0 0.5rem; }

  /* History */
  .history-container { padding: 0.5rem; }
  .history-container .toolbar { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0; }
  .history-container .toolbar .input-select { flex: 1; min-width: auto; }

  /* Modals */
  .modal-overlay { align-items: flex-end; }
  .modal { max-width: 100%; margin: 0; border-radius: 12px 12px 0 0; }
  .modal-body { padding: 1rem; }
  .modal-header { padding: 0.75rem 1rem; }
  .modal-footer { padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom,0)); }

  /* About */
  .about-container .data-table-wrapper { display: block; overflow-x: auto; }
  .about-container .data-table { display: table; font-size: 0.65rem; min-width: 300px; }
}
