/* ==========================================================================
   HENSTAV s.r.o. - Administrační rozhraní
   Design System & Modern Admin CSS
   ========================================================================== */

:root {
  --primary: #1a2238;
  --primary-light: #2a3656;
  --primary-dark: #0f1422;
  --accent: #e63946;
  --accent-hover: #c92a37;
  --accent-light: #fff0f1;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #e63946;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at 10% 20%, #1e293b 0%, #0f172a 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.login-logo {
  max-height: 48px;
  margin-bottom: 24px;
}

.login-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* ==========================================================================
   ADMIN LAYOUT
   ========================================================================== */
.admin-header {
  background: var(--primary);
  color: #ffffff;
  padding: 0 24px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-logo {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

.admin-badge {
  background: var(--accent);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 20px 60px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(230, 57, 70, 0.25);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

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

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}
.btn-danger:hover {
  background: #dc2626;
  color: #ffffff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
  border-radius: 4px;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
}

/* ==========================================================================
   ALERTS / FLASH MESSAGES
   ========================================================================== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}

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

.alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* ==========================================================================
   PAGE HEADER & CARDS
   ========================================================================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}

.page-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}

/* ==========================================================================
   PROJECT ITEMS / TABLE
   ========================================================================== */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-item {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: all 0.2s ease;
}

.project-item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.project-item.inactive {
  opacity: 0.6;
  background: #fbfcfe;
}

.project-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.project-order-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-reorder {
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  width: 28px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.btn-reorder:hover:not(:disabled) {
  background: var(--primary);
  color: #ffffff;
}
.btn-reorder:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.project-info {
  flex: 1;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

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

.status-inactive {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid var(--border);
}

.project-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.project-subtitle {
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 600;
}

.project-logos {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  min-width: 140px;
  justify-content: center;
}

.project-logos img {
  max-height: 36px;
  max-width: 90px;
  object-fit: contain;
}

.project-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15);
}

textarea.form-control {
  min-height: 180px;
  resize: vertical;
  line-height: 1.6;
}

.form-help {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.editor-btn {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.15s ease;
}
.editor-btn:hover {
  background: var(--primary);
  color: #ffffff;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.checkbox-label {
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.logos-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.logo-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logo-option:hover {
  border-color: var(--accent);
  background: #fffafa;
}

.logo-option input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.logo-option img {
  max-height: 40px;
  max-width: 110px;
  object-fit: contain;
}

.logo-option-text {
  font-size: 0.85rem;
  font-weight: 600;
}

/* ==========================================================================
   MODAL / POPUP
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 10;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}
.modal-close:hover {
  color: var(--danger);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
  position: sticky;
  bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-header {
    height: auto;
    padding: 14px 16px;
    flex-direction: column;
    gap: 12px;
  }
  .project-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .project-left {
    width: 100%;
  }
  .project-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
