/* CSS Variables */
:root {
  --primary: #2563eb;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --muted: #6b7280;
  --light: #f3f4f6;
  --dark: #111827;
  --bg: #ffffff;
  --text: #1f2937;
  --line: #d1d5db;
  --shade: #ffffff;
  --radius: 8px;
}

/* Reset & Base */
* { box-sizing: border-box; }

body{
  margin:0; background:var(--bg); color:var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 1rem 0;
}

/* Layout */
.page {
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.site-header{
  position:sticky; 
  top:0; 
  z-index:100;
  background:#fff; 
  border-bottom:1px solid #d0d7de;
  display:flex; 
  justify-content:space-between; 
  align-items:center; 
  gap:12px; 
  padding:10px 16px;
  max-width: 1000px !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
}

.site-brand {
  flex: 0 0 auto;
  order: 2 !important;
  text-align: center !important;
  flex: 1 !important;
}

.site-brand a{
  font-weight:800;
  color:#111827;
  text-decoration:none;
  white-space:nowrap;
}

.site-menu{ 
  display: none !important;
}

.account{ 
  display:flex; 
  align-items:center; 
  gap:10px; 
  white-space:nowrap; 
  flex: 0 0 auto;
  order: 3 !important;
}

/* === UNIVERZÁLNÍ HAMBURGER MENU === */

/* Skrytý checkbox pro CSS toggle */
.nav-toggle {
    display: none;
}

/* Hamburger ikona */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 30px;
    height: 30px;
    cursor: pointer;
    position: relative;
    z-index: 1001;
    order: 1;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 1px;
}

/* Animace hamburger › X */
.nav-toggle:checked + .hamburger span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle:checked + .hamburger span:nth-child(2) {
    opacity: 0;
}

.nav-toggle:checked + .hamburger span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Sidebar menu */
.sidebar-menu {
    position: fixed !important;
    top: 120px !important;
    left: -300px;
    width: 300px;
    height: auto;
    max-height: calc(100vh - 140px);
    background: white;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 1000;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-radius: 0 0 8px 8px;
}

/* Vysunout sidebar při aktivaci */
.nav-toggle:checked ~ .sidebar-menu {
    left: 0;
}

/* Tlačítka v sidebar */
.sidebar-menu a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 14px;
    width: 100%;
}

.sidebar-menu a:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Backdrop pro zavření menu */
.backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.3);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-toggle:checked ~ .backdrop {
    opacity: 1;
    visibility: visible;
}

/* === UNIVERZÁLNÍ CONTAINER === */
.container-fluid {
    max-width: 1000px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}

/* === UNIVERZÁLNÍ BUTTONS === */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn:hover {
  background: var(--light);
}

.btn.success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn.small {
  padding: 4px 8px;
  font-size: 12px;
}

.btn-primary {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.btn-primary:hover {
    background: #0056b3;
    border-color: #004085;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
}

.btn-sm {
    padding: 3px 6px;
    font-size: 11px;
}

/* === UNIVERZÁLNÍ MOBILE LABELS === */
.mobile-label {
    display: none;
    font-weight: 600;
    color: #6c757d;
    margin-right: 8px;
    min-width: 80px;
}

@media (max-width: 500px) {
    .mobile-label {
        display: inline-block;
    }
}

/* === UNIVERZÁLNÍ TABLE HEADER === */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px 0;
}

.table-header h1 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Forms */
.filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 12px;
  background: var(--light);
  border-radius: var(--radius);
}

.filters > div:first-child {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

input[type="text"], 
input[type="date"], 
input[type="email"], 
input[type="password"], 
input[type="number"],
select, 
textarea,
button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.4;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  vertical-align: middle;
  cursor: pointer;
  accent-color: var(--primary);
}

/* Flash Messages */
.flash {
  padding: 12px;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  transition: opacity 0.5s;
}

.flash-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* Panel */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  overflow: auto;
}

/* Basic Table */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, 
.table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  text-align: left;
}

.table th {
  font-weight: 600;
  background: #f9fafb;
  color: #374151;
}

/* Auth Pages */
.auth-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 2rem;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Form Pages */
main.page section.panel {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin: 2rem 0;
  padding: 0;
}

main.page > h1 {
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
  color: white;
  padding: 2rem;
  margin: 0;
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  border-radius: 12px;
}

main.page section.panel form {
  padding: 2rem;
}

main.page label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--dark);
  font-size: 0.875rem;
}

main.page .form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #fafafa;
  margin-top: 0.5rem;
  font-family: inherit;
}

main.page .form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

main.page .btn.success {
  background: linear-gradient(135deg, var(--success) 0%, #15803d 100%);
  color: white;
  box-shadow: 0 4px 6px rgba(22, 163, 74, 0.3);
  padding: 12px 24px;
  font-weight: 600;
  border-radius: 8px;
  margin-top: 1rem;
  margin-right: 1rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.inline { display: inline-block; }

/* === CENTROVANÁ PATIČKA === */
.footer {
    text-align: center !important;
    max-width: 1000px !important;
    margin: 0 auto !important;
}

/* === DASHBOARD STYLY === */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.dashboard-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.dashboard-card h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.dashboard-card p {
    color: #666;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.dashboard-card .btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
}

.dashboard-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.dashboard-info h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.dashboard-info ul {
    margin: 0 0 15px 0;
    padding-left: 20px;
}

.dashboard-info li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.stats p {
    margin: 5px 0;
    font-size: 14px;
}

/* === LOGIN STYLY === */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    padding: 20px;
}

.login-form {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    border: 1px solid #e9ecef;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
    font-weight: 700;
}

.login-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #fafafa;
    font-family: inherit;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-login:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.login-footer p {
    margin: 0;
    color: #666;
    font-size: 12px;
}

.alert-danger {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* === RESPONZIVNÍ ÚPRAVY === */
@media (max-width: 768px) {
    .site-header {
        padding: 0 15px !important;
    }
    
    .container-fluid {
        padding: 0 15px !important;
    }
    
    .sidebar-menu {
        width: 280px;
        left: -280px;
        padding: 15px;
        gap: 8px;
    }
    
    .sidebar-menu a {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dashboard-card {
        padding: 15px;
    }
    
    .dashboard-info {
        padding: 15px;
    }
    
    .login-container {
        padding: 15px;
        min-height: calc(100vh - 100px);
    }
    
    .login-form {
        padding: 30px 20px;
    }
}