/* ServiceTrack - Moderní Mobile-First UI Stylesheet */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #64748b;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Navigace */
.navbar {
  background-color: #1e293b;
  color: #ffffff;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge {
  background-color: var(--primary);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.navbar-menu {
  display: none;
  gap: 1.25rem;
  align-items: center;
}

@media (min-width: 768px) {
  .navbar-menu {
    display: flex;
  }
}

.navbar-link {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.navbar-link:hover, .navbar-link.active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.user-badge {
  font-size: 0.85rem;
  background-color: rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Hlavní obsah */
.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 1rem;
  flex: 1;
  width: 100%;
}

/* Spodní lišta pro mobily (PWA Bottom Bar) */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05);
  z-index: 40;
  height: 60px;
}

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

@media (max-width: 767px) {
  .container {
    padding-bottom: 80px; /* prostor pro spodní lištu */
  }
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.bottom-nav-item.active {
  color: var(--primary);
  font-weight: 600;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  margin-bottom: 2px;
}

.bottom-nav-item.add-btn {
  color: #ffffff;
}

.bottom-nav-item.add-btn .add-circle {
  background-color: var(--primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -16px;
  box-shadow: var(--shadow-md);
  border: 3px solid #ffffff;
}

/* Karty */
.card {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Tlačítka */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  min-height: 42px; /* Touch target minimum */
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: #334155;
  border-color: var(--border);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  min-height: 32px;
}

.btn-block {
  width: 100%;
}

/* Formuláře */
.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: #334155;
}

.form-control, .form-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 44px;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

/* Časové předvolby pro mobil */
.time-presets {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.time-btn {
  padding: 6px 12px;
  background-color: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.time-btn:hover, .time-btn.active {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Upozornění (Flash messages) */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background-color: var(--success-bg);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-danger {
  background-color: var(--danger-bg);
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-warning {
  background-color: var(--warning-bg);
  color: #92400e;
  border: 1px solid #fde68a;
}

/* Statistická karta */
.stat-box {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: #38bdf8;
}

.stat-label {
  font-size: 0.85rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Mobilní karta výkonu */
.work-card {
  background-color: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.work-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.work-company {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
}

.work-time-badge {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.work-desc {
  font-size: 0.95rem;
  color: #334155;
  white-space: pre-line;
}

.work-audit {
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.work-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* Tabulka pro desktop */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  background-color: #f8fafc;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--secondary);
}

/* Rychlý přepínač měsíců */
.month-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.month-selector .current-month {
  font-weight: 700;
  font-size: 1.05rem;
}

/* Jednořádkové zobrazení záznamů */
.work-list {
  background-color: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.work-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background-color: #ffffff;
  font-size: 0.9rem;
  transition: background-color 0.15s;
}

.work-row:last-child {
  border-bottom: none;
}

.work-row:hover {
  background-color: #f8fafc;
}

.work-row-date {
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  font-size: 0.85rem;
  min-width: 42px;
}

.work-row-company {
  font-weight: 700;
  color: #0369a1;
  background-color: #e0f2fe;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 0.8rem;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-row-desc {
  flex: 1;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  font-size: 0.9rem;
}

.work-row-hours {
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  font-size: 0.88rem;
  padding: 0 0.25rem;
}

.work-row-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  white-space: nowrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #64748b;
  padding: 0;
  text-decoration: none;
  transition: all 0.15s;
}

.icon-btn:hover {
  text-decoration: none;
}

.icon-btn-edit:hover {
  color: var(--primary);
  background-color: var(--primary-light);
}

.icon-btn-delete:hover {
  color: var(--danger);
  background-color: var(--danger-bg);
}
