/* ZeroServis v2.2 - Main Styles */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --secondary: #64748b;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-secondary: #64748b;
  --sidebar-bg: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-active: #2563eb;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }

/* Login */
.login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-box { background: white; padding: 2.5rem; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; }
.login-box h1 { font-size: 1.75rem; margin-bottom: 0.5rem; color: var(--text); }
.login-box p { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 0.875rem; }

/* Layout */
.app-container { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--sidebar-bg); color: white; display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 100; overflow-y: auto; overflow-x: hidden; }
.sidebar-header { padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.25rem; }
.sidebar-header p { font-size: 0.875rem; color: var(--sidebar-text); }
.nav-menu { flex: 1; padding: 1rem 0; overflow-y: auto; }
.nav-item { padding: 0.75rem 1.5rem; cursor: pointer; display: flex; align-items: center; gap: 0.75rem; color: var(--sidebar-text); font-size: 0.9375rem; transition: all 0.2s; border-left: 3px solid transparent; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: white; }
.nav-item.active { background: rgba(255,255,255,0.08); color: white; border-left-color: var(--primary); }
.sidebar-footer { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.875rem; }

.main-content { flex: 1; margin-left: 260px; padding: 1.5rem; min-height: 100vh; }



/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* Mobile nav */
.mobile-nav-toggle { display: none; position: fixed; top: 1rem; left: 1rem; z-index: 200; background: var(--primary); color: white; border: none; width: 40px; height: 40px; border-radius: 8px; font-size: 1.25rem; cursor: pointer; }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .mobile-nav-toggle { display: block; }
}

/* Pages */
.page { display: block; }
.page.hidden { display: none; }

/* Page header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; }

/* Grid */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Cards */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.card-title { font-size: 1rem; font-weight: 600; }

/* Stat cards */
.stat-card { display: flex; flex-direction: column; }
.stat-label { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--text); }
.stat-change { font-size: 0.875rem; color: var(--success); margin-top: 0.25rem; }
.stat-change.positive { color: var(--success); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.375rem; color: var(--text-secondary); }
.form-control { width: 100%; padding: 0.625rem 0.875rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9375rem; background: white; transition: border-color 0.2s, box-shadow 0.2s; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.625rem 1.25rem; border: none; border-radius: var(--radius); font-size: 0.9375rem; font-weight: 500; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.875rem; }
.btn-block { width: 100%; }

/* Tables */
.table-container { overflow-x: auto; }
.table-container table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table-container th { text-align: left; padding: 0.75rem 1rem; font-weight: 600; color: var(--text-secondary); border-bottom: 2px solid var(--border); white-space: nowrap; }
.table-container td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table-container tbody tr:hover { background: #f8fafc; }
.table-container tbody tr { cursor: pointer; }

/* Status badges */
.status-badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status-přijato { background: #dbeafe; color: #1e40af; }
.status-diagnostika { background: #fef3c7; color: #92400e; }
.status-čekánadíly { background: #fce7f3; color: #9d174d; }
.status-oprava { background: #fce7f3; color: #be185d; }
.status-opravaprobíhá { background: #fce7f3; color: #be185d; }
.status-hotovo { background: #d1fae5; color: #065f46; }
.status-připravenokvyzvednutí { background: #d1fae5; color: #065f46; }
.status-vydáno { background: #ede9fe; color: #5b21b6; }

.badge { display: inline-block; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* Modals */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: white; border-radius: 12px; max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.25rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1.125rem; font-weight: 600; }
.modal-body { padding: 1.25rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.75rem; padding: 1.25rem; border-top: 1px solid var(--border); }

/* Signature pad */
.signature-pad { width: 100%; height: 150px; border: 2px dashed var(--border); border-radius: var(--radius); background: #fafafa; cursor: crosshair; touch-action: none; }

/* Photo grid */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.75rem; }
.photo-item { position: relative; }
.photo-item img { width: 100%; height: 120px; object-fit: cover; border-radius: 4px; cursor: pointer; }

/* Timeline */
.timeline { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.timeline-item { padding: 0.375rem 0.75rem; background: var(--bg); border-radius: 4px; font-size: 0.875rem; }
.timeline-item.active { background: var(--primary); color: white; }

/* History */
.history-item { padding: 0.75rem; border-left: 3px solid var(--primary); background: var(--bg); margin-bottom: 0.5rem; border-radius: 0 4px 4px 0; font-size: 0.875rem; }

/* Utilities */
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: 0.875rem; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.bg-success-light { background: #d1fae5; }
.rounded { border-radius: var(--radius); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.p-1 { padding: 0.5rem; }

/* Print */
@media print {
  .sidebar, .mobile-nav-toggle, .no-print, .modal-overlay { display: none !important; }
  .main-content { margin-left: 0 !important; }
}

/* Code/link */
code { background: var(--bg); padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.875rem; font-family: monospace; word-break: break-all; }

hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* Responsive table */
@media (max-width: 768px) {
  .table-container th, .table-container td { padding: 0.5rem; font-size: 0.8125rem; }
  .btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
}
