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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  height: 100vh;
  overflow: hidden;
}

/* ============ LOGIN SCREEN ============ */
#login-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#login-screen.hidden {
  display: none;
}

#dashboard-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

#dashboard-screen.hidden {
  display: none;
}

.login-container {
  background: white;
  padding: 48px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 420px;
  width: 100%;
  margin: 20px;
}

.login-container h1 {
  text-align: center;
  color: #1e293b;
  margin-bottom: 8px;
  font-size: 32px;
  font-weight: 700;
}

.login-container h2 {
  text-align: center;
  color: #64748b;
  margin-bottom: 32px;
  font-size: 16px;
  font-weight: 400;
}

.login-container .form-group {
  margin-bottom: 24px;
}

.login-container label {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-weight: 600;
  font-size: 14px;
}

.login-container input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.2s;
}

.login-container input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

#login-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  border-left: 4px solid #dc2626;
}

/* ============ NAVBAR ============ */
.navbar {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  flex-shrink: 0;
  gap: 24px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
}

.logo {
  font-size: 28px;
}

.navbar-stats {
  display: flex;
  gap: 24px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 14px;
  color: #475569;
}

.stat-badge strong {
  font-weight: 700;
  color: #1e293b;
}

.btn-logout {
  background: #ef4444;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* ============ MAIN CONTAINER ============ */
.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 73px);
}

/* ============ SIDEBAR ============ */
.sidebar {
  width: 280px;
  background: white;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-nav {
  padding: 20px 0;
}

.nav-item {
  width: 100%;
  padding: 14px 24px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #64748b;
  font-size: 15px;
  transition: all 0.2s;
  border-left: 4px solid transparent;
}

.nav-item:hover {
  background: #f8fafc;
  color: #667eea;
}

.nav-item.active {
  background: #eff6ff;
  color: #667eea;
  border-left-color: #667eea;
  font-weight: 600;
}

.nav-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.nav-text {
  flex: 1;
}

.nav-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 12px 0;
}

/* ============ CONTENT AREA ============ */
.content-area {
  flex: 1;
  overflow-y: auto;
  background: #f8fafc;
  padding: 32px;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.section-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
}

.section-toolbar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  max-width: 400px;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  background: white;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.filter-select {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  min-width: 200px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* ============ CARDS GRID (MÍSTO TABULEK) ============ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
  transition: all 0.3s;
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: #cbd5e1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f1f5f9;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.card-id {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 6px;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-value {
  font-size: 15px;
  color: #1e293b;
  font-weight: 500;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

/* ============ BUTTONS ============ */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: #f0f4ff;
  transform: translateY(-1px);
}

.btn-edit {
  background: #667eea;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  flex: 1;
}

.btn-edit:hover {
  background: #5568d3;
  transform: translateY(-1px);
}

.btn-danger {
  background: #ef4444;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  flex: 1;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* ============ STATS GRID ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 28px;
  color: white;
  text-align: center;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-4px);
}

.stat-card h3 {
  font-size: 48px;
  margin: 0 0 8px 0;
  font-weight: 700;
  color: white;
}

.stat-card p {
  font-size: 15px;
  margin: 0;
  opacity: 0.95;
  font-weight: 500;
}

/* ============ ACTIVITY LIST ============ */
.activity-list {
  background: white;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
}

.activity-item {
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  gap: 20px;
  align-items: center;
  transition: background 0.2s;
}

.activity-item:hover {
  background: #f8fafc;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-time {
  font-size: 13px;
  color: #94a3b8;
  min-width: 160px;
  font-family: 'Courier New', monospace;
  font-weight: 500;
}

.activity-actor {
  font-weight: 700;
  color: #1e293b;
  min-width: 200px;
  font-size: 15px;
}

.activity-action {
  color: #64748b;
  flex: 1;
  font-size: 15px;
}

.activity-entity {
  font-size: 12px;
  color: #667eea;
  font-weight: 600;
  background: #eff6ff;
  padding: 6px 12px;
  border-radius: 8px;
}

/* ============ AUDIT LOG ============ */
.audit-log-list {
  background: white;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
}

.audit-log-item {
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s;
}

.audit-log-item:hover {
  background: #f8fafc;
}

.audit-log-item:last-child {
  border-bottom: none;
}

.audit-log-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  align-items: center;
}

.audit-log-time {
  font-size: 13px;
  color: #94a3b8;
  font-family: 'Courier New', monospace;
  font-weight: 500;
}

.audit-log-project {
  font-size: 11px;
  color: #667eea;
  background: #eff6ff;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
}

.audit-log-content {
  color: #1e293b;
  line-height: 1.6;
  font-size: 15px;
}

.audit-log-content strong {
  font-weight: 700;
  color: #667eea;
}

.audit-log-details {
  margin-top: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
  color: #64748b;
  border-left: 3px solid #cbd5e1;
}

/* ============ MODALS ============ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 2px solid #f1f5f9;
}

.modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
}

.modal-close {
  background: #f1f5f9;
  border: none;
  font-size: 24px;
  color: #64748b;
  cursor: pointer;
  padding: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.modal form {
  padding: 28px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-weight: 600;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s;
  background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 28px;
  border-top: 2px solid #f1f5f9;
  background: #f8fafc;
  border-radius: 0 0 20px 20px;
}

/* ============ SYSTEM TOOLS ============ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.tool-card {
  background: white;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
  transition: all 0.3s;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.tool-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
}

.tool-card p {
  color: #64748b;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.6;
}

.tool-result {
  margin-top: 20px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 14px;
  color: #1e293b;
  min-height: 50px;
  border-left: 4px solid #cbd5e1;
}

.tool-result ul {
  margin-top: 8px;
  padding-left: 20px;
}

.tool-result li {
  margin: 4px 0;
}

/* ============ SETTINGS ============ */
.settings-content {
  max-width: 1200px;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 12px;
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s;
}

.settings-tab:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.settings-tab.active {
  background: #6366f1;
  color: white;
  border-color: #6366f1;
}

.settings-tab .tab-icon {
  font-size: 16px;
}

.settings-categories {
  min-height: 400px;
}

.settings-category {
  display: none;
}

.settings-category.active {
  display: block;
}

.settings-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.settings-group {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
}

.settings-group h4 {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.setting-item {
  margin-bottom: 20px;
}

.setting-item:last-child {
  margin-bottom: 0;
}

.setting-item label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 6px;
}

.setting-item .setting-description {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
  line-height: 1.4;
}

.setting-item input[type="text"],
.setting-item input[type="number"],
.setting-item input[type="email"],
.setting-item input[type="password"],
.setting-item textarea,
.setting-item select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: white;
  transition: border-color 0.2s;
}

.setting-item input:focus,
.setting-item textarea:focus,
.setting-item select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.setting-item textarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

.setting-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #6366f1;
}

.setting-item .checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setting-item .checkbox-wrapper label {
  margin: 0;
  cursor: pointer;
  flex: 1;
}

.settings-footer {
  display: flex;
  gap: 12px;
  padding-top: 24px;
  border-top: 2px solid #e2e8f0;
  margin-top: 24px;
}

.settings-card {
  background: white;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
  margin-bottom: 24px;
}

.settings-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 20px;
}

.settings-card p {
  color: #64748b;
  font-size: 15px;
  margin: 12px 0;
  line-height: 1.6;
}

.settings-card strong {
  color: #1e293b;
  font-weight: 600;
}

/* ============ GLOBAL ERROR ============ */
.global-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 15px;
  border-left: 4px solid #dc2626;
  font-weight: 500;
  transition: all 0.3s;
}

.global-error.hidden {
  display: none;
}

.global-error.success {
  background: #d4edda;
  color: #155724;
  border-left-color: #28a745;
}

/* ============ COMMON ============ */
.loading {
  text-align: center;
  padding: 80px 20px;
  color: #94a3b8;
  font-size: 16px;
  font-weight: 500;
}

.error {
  background: #fee2e2;
  color: #991b1b;
  padding: 16px;
  border-radius: 10px;
  margin: 16px 0;
  font-size: 15px;
  border-left: 4px solid #dc2626;
  font-weight: 500;
}

.empty {
  text-align: center;
  padding: 80px 20px;
  color: #94a3b8;
  font-style: italic;
  font-size: 16px;
}

.hidden {
  display: none !important;
}

/* ============ ROLE BADGES ============ */
.role-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-developer_admin {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.role-service {
  background: #dcfce7;
  color: #166534;
}

.role-user {
  background: #dbeafe;
  color: #1e40af;
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: white;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.empty-state-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
}

.empty-state-text {
  color: #64748b;
  font-size: 15px;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 240px;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .navbar-stats {
    display: none;
  }
}
