/* StrikeCRM — Premium Design System v2 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* === Design Tokens === */
:root {
  --bg-base: #000000;
  --bg-surface: #111111;
  --bg-elevated: #1A1A1A;
  --bg-glass: rgba(17,17,17,0.85);
  --bg-overlay: rgba(0,0,0,0.80);
  
  --text-primary: #FFFFFF;
  --text-secondary: #A0A0A0;
  --text-tertiary: #666666;
  --text-muted: #444444;
  
  --accent: #00FF88;
  --accent-hover: #00E07A;
  --accent-muted: rgba(0,255,136,0.10);
  --accent-glow: rgba(0,255,136,0.20);
  
  --status-success: #34c759;
  --status-warning: #ff9f0a;
  --status-error: #ff453a;
  --status-info: #0a84ff;
  --status-neutral: #8e8e93;
  
  --border-hairline: rgba(255,255,255,0.06);
  --border-subtle: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.16);
  
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 32px var(--accent-glow);
  
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  
  --transition-fast: 0.15s ease;
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease-out;
}

[data-theme="light"] {
  --bg-base: #FAFAFA;
  --bg-surface: #FFFFFF;
  --bg-elevated: #F5F5F5;
  --bg-glass: rgba(255,255,255,0.92);
  --bg-overlay: rgba(0,0,0,0.45);
  
  --text-primary: #000000;
  --text-secondary: #555555;
  --text-tertiary: #888888;
  --text-muted: #BBBBBB;
  
  --accent: #00B85F;
  --accent-hover: #009D52;
  --accent-muted: rgba(0,184,95,0.08);
  --accent-glow: rgba(0,184,95,0.15);
  
  --border-hairline: #E8E8E8;
  --border-subtle: #E0E0E0;
  --border-strong: #CCCCCC;
  
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.10);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
}

/* === Typography === */
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 28px; }
h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 16px; }
h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.005em; }
a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.8; }

/* === Sidebar === */
.sidebar {
  width: 260px; min-height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-hairline);
  position: fixed; left: 0; top: 0; z-index: 100;
  display: flex; flex-direction: column;
  transition: transform var(--transition-slow);
}
.sidebar-logo { padding: 22px 24px; border-bottom: 1px solid var(--border-hairline); display: flex; justify-content: space-between; align-items: center; }
.logo-text { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.logo-text span { color: var(--accent); }
.sidebar-logo-actions { display: flex; align-items: center; gap: 8px; }
.sidebar-close {
  display: none; /* shown on mobile only */
  width: 36px; height: 36px; background: var(--bg-elevated);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  color: var(--text-secondary); cursor: pointer;
  align-items: center; justify-content: center;
  transition: all var(--transition); -webkit-tap-highlight-color: transparent;
}
.sidebar-close svg { width: 18px; height: 18px; }
.sidebar-close:active { transform: scale(0.92); background: var(--bg-base); }

.theme-toggle {
  width: 36px; height: 36px; background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); color: var(--text-tertiary); font-size: 16px;
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { background: var(--accent-muted); color: var(--accent); border-color: var(--accent); }

.sidebar-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  transition: all var(--transition);
}
.sidebar-nav a:hover { background: var(--bg-elevated); color: var(--text-primary); }
.sidebar-nav a.active { background: var(--accent-muted); color: var(--accent); font-weight: 600; }
.sidebar-nav a .nav-icon { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-nav a .nav-icon svg { width: 100%; height: 100%; }

.sidebar-user { padding: 16px; border-top: 1px solid var(--border-hairline); display: flex; align-items: center; gap: 12px; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.logout-btn {
  background: none; border: 1px solid var(--border-subtle); color: var(--text-tertiary);
  border-radius: var(--radius-md); padding: 7px 12px; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.logout-btn:hover { border-color: var(--status-error); color: var(--status-error); }

/* === Main Wrapper === */
.main-wrapper {
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.main {
  flex: 1;
  padding: 36px 40px 48px;
}

/* === Bento Cards === */
.bento-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-slow);
  position: relative;
}
.bento-card:hover { transform: translateY(-2px); border-color: var(--border-subtle); box-shadow: var(--shadow-md); }

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.bento-grid .bento-card { padding: 20px 24px; }
.bento-grid .bento-card .value { font-size: 36px; font-weight: 700; color: var(--text-primary); line-height: 1; letter-spacing: -0.02em; }

/* Neutralized stat numbers + semantic stat classes */
.value, .stat-number, .bento-stat .num {
  color: var(--text-primary, #fff);
  font-variant-numeric: tabular-nums;
}
.bento-grid .bento-card .value.stat-positive, .stat-positive { color: var(--status-success, #34c759); }
.bento-grid .bento-card .value.stat-negative, .stat-negative { color: var(--status-error, #ff3b30); }
.bento-grid .bento-card .value.stat-neutral, .stat-neutral { color: var(--text-primary, #fff); }
.bento-grid .bento-card .label { font-size: 11px; color: var(--text-tertiary); margin-top: 8px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.bento-grid .bento-card .card-icon {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.bento-grid .bento-card .card-icon svg { width: 18px; height: 18px; }

/* === Panels === */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}
.panel-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-hairline);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.panel-header h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-body { padding: 20px 24px; }

/* === Tables === */
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-elevated); }
th {
  text-align: left; padding: 12px 16px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-tertiary); border-bottom: 1px solid var(--border-hairline);
  white-space: nowrap;
}
td {
  padding: 14px 16px; font-size: 14px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border-hairline);
}
tbody tr { transition: background var(--transition-fast); cursor: pointer; }
tbody tr:hover { background: var(--bg-elevated); }
tbody tr:last-child td { border-bottom: none; }

/* === Forms === */
input, select, textarea {
  width: 100%; padding: 11px 16px;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-family: inherit; font-size: 14px; transition: all var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
select { cursor: pointer; }
select option { background: var(--bg-surface); color: var(--text-primary); }

/* === Buttons === */
.btn {
  padding: 10px 20px; border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated); color: var(--text-secondary);
  font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all var(--transition); display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
  line-height: 1.4;
}
.btn:hover { background: var(--bg-base); color: var(--text-primary); border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Tap feedback */
button:active, .btn:active, a:active {
  transform: scale(0.97);
  transition: transform 0.1s;
}

.btn-primary {
  background: var(--accent); color: #000000; border-color: var(--accent);
  font-weight: 600; box-shadow: 0 4px 12px rgba(0,255,136,0.15);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-glow); }

.btn-secondary { background: var(--bg-elevated); border: 1px solid var(--border-subtle); color: var(--text-secondary); }
.btn-secondary:hover { background: var(--bg-base); color: var(--text-primary); }

.btn-danger { background: rgba(255,69,58,0.08); color: var(--status-error); border: 1px solid rgba(255,69,58,0.20); }
.btn-danger:hover { background: rgba(255,69,58,0.15); }

.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 15px; min-height: 48px; }

/* === Filter Buttons / Pills === */
.filter-btn, .filter-tab {
  padding: 8px 16px; border-radius: var(--radius-pill);
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  color: var(--text-tertiary); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all var(--transition); -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.filter-btn:hover, .filter-tab:hover { background: var(--bg-base); color: var(--text-secondary); border-color: var(--border-strong); }
.filter-btn.active, .filter-tab.active {
  background: var(--accent-muted); color: var(--accent); border-color: var(--accent); font-weight: 600;
}

/* === Controls Bar === */
.controls { display: flex; gap: 12px; margin-bottom: 20px; align-items: center; flex-wrap: wrap; }
.controls input { max-width: 320px; }

/* === Search Input === */
.search-wrap {
  position: relative; max-width: 480px; flex: 1; min-width: 200px;
}
.search-wrap .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; width: 16px; height: 16px;
}
.search-wrap input {
  width: 100%; padding: 11px 16px 11px 40px;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); font-size: 14px;
}
.search-wrap input:focus { border-color: var(--accent); background: var(--bg-surface); box-shadow: 0 0 0 3px var(--accent-muted); }

/* === Badges === */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: var(--radius-pill); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.4;
}
.badge-green { background: rgba(52,199,89,0.12); color: var(--status-success); }
.badge-yellow { background: rgba(255,159,10,0.12); color: var(--status-warning); }
.badge-blue { background: rgba(10,132,255,0.12); color: var(--status-info); }
.badge-red { background: rgba(255,69,58,0.12); color: var(--status-error); }
.badge-gray { background: var(--bg-elevated); color: var(--text-tertiary); border: 1px solid var(--border-hairline); }

/* === Detail Grid === */
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.detail-field label { display: block; font-size: 11px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; font-weight: 600; margin-bottom: 6px; }
.detail-field .val { font-size: 14px; font-weight: 400; }

/* === Empty State === */
.empty {
  text-align: center; padding: 56px 24px; color: var(--text-muted); font-size: 13px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-icon { opacity: 0.3; }
.empty-icon svg { width: 48px; height: 48px; stroke: currentColor; fill: none; stroke-width: 1.5; }

/* === Skeleton Loader === */
.skeleton {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%);
  animation: shimmer 1.5s infinite;
}
[data-theme="light"] .skeleton::after {
  background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.04) 50%, transparent 100%);
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.skeleton-card {
  background: var(--bg-elevated, rgba(255,255,255,0.04));
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  padding: 18px;
  animation: skeletonPulse 1.4s ease-in-out infinite;
}
.skeleton-line {
  height: 12px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  margin-bottom: 8px;
}
[data-theme="light"] .skeleton-line { background: rgba(0,0,0,0.08); }
.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 85%; }
@keyframes skeletonPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px;
}

/* === Modal === */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn 0.2s ease-out;
  padding: 0;
}
[data-theme="light"] .modal-backdrop { background: rgba(0,0,0,0.4); }
.modal-backdrop[data-closing="true"] { animation: fadeIn 0.2s ease-out reverse forwards; }

.modal-content, .modal-sheet {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 28px 24px 24px;
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  animation: slideUp 0.3s var(--ease-out);
  position: relative;
}
.modal-sheet, .modal-content { }

@keyframes slideUp { from { transform: translateY(100%); opacity: 0.8; } to { transform: translateY(0); opacity: 1; } }
@keyframes modalCenter { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-title {
  font-size: 18px; font-weight: 700; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
  padding-right: 32px;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  width: 32px; height: 32px; border-radius: 50%;
  color: var(--text-tertiary); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); z-index: 1;
}
.modal-close:hover { background: var(--status-error); color: white; border-color: var(--status-error); }

.modal-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--text-quaternary, var(--text-muted));
  margin: 12px auto 8px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 11px 16px;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-family: inherit; font-size: 14px; transition: all var(--transition);
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted);
}
.form-actions {
  display: flex; gap: 12px; margin-top: 24px;
}
.form-actions .btn { flex: 1; justify-content: center; min-height: 44px; }
.form-error {
  color: var(--status-error); font-size: 13px; margin-top: 8px;
  display: none;
}

/* === Toast === */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 12px 20px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastSlide 0.3s var(--ease-out);
  display: flex; align-items: center; gap: 10px;
  pointer-events: auto;
  max-width: 360px;
}
.toast.success { border-left: 3px solid var(--status-success); }
.toast.error { border-left: 3px solid var(--status-error); }
.toast.info { border-left: 3px solid var(--status-info); }

@keyframes toastSlide { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100px); opacity: 0; } }

/* === Page Header === */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.page-header h1 { margin-bottom: 0; }

/* === Task Styles === */
.task-status {
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.03em; white-space: nowrap; cursor: pointer;
  transition: all var(--transition);
}
.task-status.status-open { background: rgba(142,142,147,0.12); color: #acacae; }
.task-status.status-assigned { background: rgba(100,150,255,0.12); color: #6496ff; }
.task-status.status-in_progress { background: rgba(255,214,10,0.12); color: #e6c200; }
.task-status.status-done { background: rgba(0,255,136,0.12); color: var(--accent); }

/* ============================================ */
/* MOBILE CHROME                                */
/* ============================================ */
.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline);
  z-index: 90;
  align-items: center; padding: 0 12px; gap: 8px;
  padding-top: env(safe-area-inset-top, 0px);
}
.hamburger-btn {
  width: 44px; height: 44px; background: none; border: none;
  color: var(--text-primary); cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); transition: background var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.hamburger-btn:active { background: var(--bg-elevated); transform: scale(0.92); }
.hamburger-btn svg { width: 24px; height: 24px; }
.mobile-theme-toggle {
  width: 44px; height: 44px; background: none; border: none;
  color: var(--text-primary); cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); transition: background var(--transition);
  font-size: 20px;
  -webkit-tap-highlight-color: transparent;
}
.mobile-theme-toggle:active { background: var(--bg-elevated); transform: scale(0.92); }
.mobile-header .page-title {
  font-size: 17px; font-weight: 700; letter-spacing: -0.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
  text-align: center;
}

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 150;
  animation: fadeIn 0.25s ease-out;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================ */
/* MOBILE BREAKPOINT                            */
/* ============================================ */
@media (max-width: 768px) {
  .main-wrapper { margin-left: 0; }
  .sidebar {
    transform: translateX(-100%);
    width: 85%; max-width: 300px;
    z-index: 200;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
    padding-top: env(safe-area-inset-top, 0px);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }

  .mobile-header { display: flex; }
  .sidebar-overlay.open { display: block; }

  .main {
    padding: 68px 12px 24px;
  }
  
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
  }
  .bento-card { padding: 16px; border-radius: var(--radius-md); }
  .bento-grid .bento-card .value { font-size: 28px; }
  .bento-grid .bento-card .label { font-size: 10px; }
  
  .btn { padding: 12px 18px; min-height: 44px; font-size: 14px; }
  .btn-sm { padding: 9px 14px; min-height: 38px; }
  .filter-btn, .filter-tab { padding: 9px 14px; min-height: 40px; font-size: 13px; }
  
  input, select, textarea { font-size: 16px; padding: 12px 16px; }
  
  .panel-header { padding: 16px 18px; }
  .panel-body { padding: 18px; }
  
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 13px; }
  th, td { padding: 11px 12px; }
  
  .controls { flex-direction: column; align-items: stretch; gap: 10px; }
  .controls input, .controls .search-wrap { max-width: 100%; }
  
  h1 { font-size: 22px; margin-bottom: 20px; }
  .sidebar-nav a { padding: 12px 16px; font-size: 15px; }
  
  .page-header { flex-direction: column; align-items: flex-start; }
  
  .modal-sheet, .modal-content { max-width: 100%; border-radius: var(--radius-xl) var(--radius-xl) 0 0; max-height: 85vh; }
  .toast-container { top: auto; bottom: 100px; left: 16px; right: 16px; }
  .toast { max-width: 100%; }
  
  .detail-grid { grid-template-columns: 1fr; }

  /* Карточный вид для таблиц */
  table.data-table.responsive-cards thead { display: none; }
  table.data-table.responsive-cards,
  table.data-table.responsive-cards tbody,
  table.data-table.responsive-cards tr,
  table.data-table.responsive-cards td {
    display: block; width: 100%;
  }
  table.data-table.responsive-cards tr {
    background: var(--bg-card, var(--bg-surface)); border-radius: var(--radius-lg);
    padding: 14px; margin-bottom: 10px;
    border: 1px solid var(--border-hairline);
  }
  table.data-table.responsive-cards td {
    text-align: left; padding: 4px 0; font-size: 14px;
    border-bottom: 1px solid var(--border-hairline);
  }
  table.data-table.responsive-cards td:last-child { border-bottom: none; }
  table.data-table.responsive-cards td::before {
    content: attr(data-label);
    font-weight: 600; font-size: 11px;
    color: var(--text-tertiary); text-transform: uppercase;
    display: block; margin-bottom: 2px;
  }

  /* Фильтры-чипы — горизонтальный скролл */
  .filter-tabs, .filter-row {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, black 95%, transparent);
  }
  .filter-tabs::-webkit-scrollbar,
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-btn, .filter-tab {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

@media (max-width: 400px) {
  .bento-grid {
    grid-template-columns: repeat(1, 1fr);
    gap: 12px;
  }
  .bento-grid .bento-card .value { font-size: 40px; }
  .bento-grid .bento-card .label { font-size: 13px; }
  .bento-grid .bento-card { min-height: 110px; padding: 20px; }
}

/* === Sidebar Close === */
.sidebar-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-elevated); border: 1px solid var(--border-hairline);
  color: var(--text-secondary); font-size: 16px;
  cursor: pointer; display: none;
  align-items: center; justify-content: center;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.sidebar-close:active {
  background: var(--bg-hover);
  transform: scale(0.92);
}

/* === Modal Handle (bottom sheet) === */
.modal-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--text-quaternary, rgba(150,150,155,0.3));
  margin: 10px auto 8px;
  flex-shrink: 0;
}

/* === Tap Feedback === */
@media (hover: none) and (pointer: coarse) {
  button:active, .btn:active, .filter-btn:active, .filter-tab:active,
  .task-card:active, .bento-card:active, .employee-card:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
  }
  .sidebar-nav a:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
}

/* === Slide-up animation for modals on mobile === */
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (max-width: 768px) {
  .sidebar-close { display: flex; }
  
  .modal-backdrop {
    align-items: flex-end;
  }
  .modal-sheet, .modal-content {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    top: auto;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    max-width: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: slideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 769px) {
  .sidebar-close { display: none !important; }
  .modal-backdrop { align-items: center; }
  .modal-sheet, .modal-content { border-radius: var(--radius-xl); animation: modalCenter 0.25s ease-out; }
}

@media (max-width: 768px) {
  .sidebar-close { display: flex !important; }
  .sidebar-logo .sidebar-logo-actions .theme-toggle { display: none !important; }
}
