/* ==========================================
   OPLEX MANAGEMENT SYSTEM - MAIN STYLESHEET
   Version: 3.0.0 (Enterprise Dashboard - Hero Removed)
   Compatible with: System Obrót v3.0.7
   ========================================== */

/* === RESET & BASE === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colors from System Obrót v3.0.7 */
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --info: #06b6d4;
  --dark: #111827;
  --dark-bg: #0b0e11;
  --dark-card: #1f2937;
  --light: #f3f4f6;
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-tertiary: #6b7280;
   
  /* Oplex Brand */
  --oplex-yellow: #facc15;
  --oplex-red: #ef4444;
   
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 40px rgba(59, 130, 246, 0.25);
   
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: #181818;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* === TYPOGRAPHY === */
h1, h2, h3 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================
   LOGIN OVERLAY
   ========================================== */
#loginOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.login-card {
  background: var(--dark);
  padding: 48px 40px;
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 0 80px rgba(59, 130, 246, 0.3);
  border: 1px solid rgba(59, 130, 246, 0.2);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-logo {
  margin-bottom: 24px;
}

.login-logo img {
  height: 70px;
  width: auto;
  filter: drop-shadow(0 4px 12px rgba(250, 204, 21, 0.4));
  transition: all var(--transition-base);
}

.login-logo img:hover {
  filter: drop-shadow(0 8px 24px rgba(250, 204, 21, 0.6));
  transform: scale(1.05);
}

.login-card h3 {
  font-size: 1.5rem;
  margin-bottom: 32px;
  color: var(--text-primary);
}

.login-card input {
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 20px;
  border-radius: 12px;
  border: 2px solid rgba(59, 130, 246, 0.3);
  background: rgba(31, 41, 55, 0.8);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all var(--transition-fast);
  outline: none;
}

.login-card input:focus {
  border-color: var(--primary);
  background: rgba(31, 41, 55, 1);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.login-card input::placeholder {
  color: var(--text-tertiary);
}

.login-card button {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  transition: all var(--transition-base);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.login-card button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.login-card button:active {
  transform: translateY(0);
}

/* ==========================================
   TOP BAR
   ========================================== */
.topbar {
  min-height: 72px;
  background: #202020;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-family: 'Inter', system-ui, sans-serif;
  position: sticky;
  top: 0;
  z-index: 100;
  box-sizing: border-box;
}

.topbar-left,
.topbar-center,
.topbar-right {
  display: flex;
  align-items: center;
}

.topbar-left {
  flex: 1;
  gap: 16px;
}

.topbar-center {
  flex: 1;
  justify-content: center;
}

.topbar-right {
  flex: 1;
  justify-content: flex-end;
}

/* LEFT - Kontekst systemu */
.topbar-context {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-brand {
  font-size: 15px;
  font-weight: 600;
  color: #E5E7EB;
}

.topbar-separator {
  color: #6B7280;
}

.topbar-module {
  font-size: 15px;
  font-weight: 600;
  color: #E5E7EB;
}

.topbar-period {
  font-size: 13px;
  color: #9CA3AF;
  padding-left: 16px;
  border-left: 1px solid rgba(255,255,255,0.08);
}

/* CENTER - System Clock (bez zmian - renderowany przez JS) */
.topbar-center {
  /* Styl z systemClock.js */
}

/* RIGHT - Akcja globalna */
.topbar-power {
  background: transparent;
  border: none;
  color: #9CA3AF;
  font-size: 20px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 120ms ease, color 120ms ease;
  line-height: 1;
}

.topbar-power:hover {
  background: rgba(255,255,255,0.04);
  color: #E5E7EB;
}

/* ==========================================
   SYSTEM LOGO - mono/flat, 100px przestrzeń, subtelny cień
   ========================================== */
.system-logo {
  height: 100px;
  display: flex;
  padding-top: 60px;

  align-items: center;
  justify-content: center;
}

.system-logo-img {
  height: 100px;
  width: auto;
  filter:
    saturate(0.65)
    brightness(0.92)
    drop-shadow(0 0 15px rgba(0,0,0,0.6))
    drop-shadow(0 13px 11px rgba(0,0,0,0.4));
  /* Kolory zachowane - flat, mono */
  opacity: 0.95;
  transition: opacity var(--transition-fast);
}

.system-logo-img:hover {
  opacity: 1;
}

/* ==========================================
   SYSTEM CLOCK - Topbar Style
   ========================================== */
.system-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.3;
}

.clock-date {
  font-size: 14px;
  color: #9CA3AF;
  font-weight: 500;
  white-space: nowrap;
}

.clock-time-row {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.clock-time {
  font-size: 16px;
  font-weight: 700;
  color: #E5E7EB;
  letter-spacing: 0.5px;
}

.clock-meta {
  font-size: 12px;
  color: #6B7280;
  font-weight: 400;
}

/* Usunięte: topbar-logo, user-info, logout-btn */

/* ==========================================
   ADMIN UI
   ========================================== */
.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.25));
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--primary-light);
  font-size: 0.9rem;
  font-weight: 600;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.5);
  }
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.admin-lock {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 20px;
  background: rgba(17, 24, 39, 0.95);
  border: 2px solid var(--primary);
  border-radius: 12px;
  color: var(--primary-light);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  display: none;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.tile-locked {
  position: relative;
}

.tile-locked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(11, 14, 17, 0.7);
  border-radius: 16px;
  backdrop-filter: blur(2px);
}

.tile-locked .admin-lock {
  display: block;
}

/* ==========================================
   MAIN CONTAINER
   ========================================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 32px;  /* Zmniejszone z 40px po usunięciu hero */
}

/* ==========================================
   SECTION HEADERS
   ========================================== */
.section-header {
  margin: 32px 0 20px;  /* Zmniejszone marginesy */
  position: relative;
}

.section-header h2 {
  display: inline-block;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding-bottom: 8px;
}

/* Subtle enterprise divider */
.section-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    to right,
    rgba(59, 130, 246, 0.4),
    rgba(59, 130, 246, 0.05)
  );
}

/* ==========================================
   TILES - MAIN MODULES (3 columns)
   ========================================== */
.tiles-main {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

/* Operational tiles - taller for emphasis */
.section-operational .tile {
  min-height: 130px;
}

/* ==========================================
   DASHBOARD TILES
   ========================================== */
.dashboard-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.dashboard-tiles.second-row {
  margin-top: 16px;
}

.tile.neutral {
  border: 1px solid rgba(255,255,255,0.15);
  background: linear-gradient(180deg, #1e2a38, #17202b);
}

/* ==========================================
   TILES - ADMIN MODULES (4 columns)
   ========================================== */
.tiles-admin {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

/* ==========================================
   TILE STYLES
   ========================================== */
.tile {
  background: linear-gradient(135deg, rgba(31,41,55,0.95) 0%, rgba(17,24,39,0.98) 100%);
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(59, 130, 246, 0.15);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
}

.tile:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 12px 48px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
}

/* Primary Tiles (Operational) */
.tile-primary,
.tile-secondary {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 20px 24px;
}

.tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.tile-content p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  opacity: 0.75;
  margin: 0;
}

.tile-arrow {
  font-size: 1.25rem;
  color: var(--text-secondary);
  transition: transform var(--transition-base);
}

.tile:hover .tile-arrow {
  transform: translateX(4px);
  color: var(--text-primary);
}

/* Special Admin Tile - neutral, no status colors */
.tile-admin {
  border-color: rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, rgba(31,41,55,0.95) 0%, rgba(17,24,39,0.98) 100%);
}

.tile-admin:hover {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 30px rgba(59, 130, 246, 0.25);
}

/* ==========================================
   BADGES
   ========================================== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success {
  background: rgba(22, 163, 74, 0.15);
  color: var(--success);
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.badge-info {
  background: rgba(6, 182, 212, 0.15);
  color: var(--info);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: rgba(220, 38, 38, 0.15);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

/* ==========================================
   FOOTER
   ========================================== */
.footer-info {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid rgba(59, 130, 246, 0.15);
  text-align: center;
}

.footer-info p {
  font-size: 0.9rem;
  color: var(--text-tertiary);
}

.footer-info strong {
  color: var(--primary);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Tablet (768px - 1200px) */
@media (max-width: 1200px) {
  .container {
    padding: 24px 24px;
  }
   
  .tiles-main {
    grid-template-columns: repeat(2, 1fr);
  }
   
  /* Admin grid: 4 columns → 2x2 */
  .tiles-admin {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
  .topbar {
    padding: 12px 20px;
    flex-wrap: wrap;
    gap: 12px;
  }
   
  .topbar-logo .logo-small {
    height: 32px;
  }
   
  .topbar-right {
    gap: 12px;
  }
   
  .user-info {
    font-size: 0.85rem;
  }
   
  .logout-btn {
    padding: 6px 16px;
    font-size: 0.85rem;
  }
   
  .container {
    padding: 20px 16px;
  }
   
  .section-header h2 {
    font-size: 1.25rem;
  }
   
  /* Main tiles: 3 columns → 1 column */
  .tiles-main {
    grid-template-columns: 1fr;
  }
   
  /* Admin tiles: 4 columns → 1 column */
  .tiles-admin {
    grid-template-columns: 1fr;
  }
   
  .tile-primary {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
   
  .tile-arrow {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
   
  .tile-content {
    grid-column: 1 / -1;
  }
   
  .login-card {
    padding: 36px 28px;
    margin: 0 20px;
  }
}

/* Small Mobile (< 480px) */
@media (max-width: 480px) {
  .system-logo {
    padding: 12px 16px;
  }
   
  .system-logo-img {
    height: 28px;
  }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for keyboard navigation */
.tile:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Profile Button */
.profile-btn {
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--primary-light);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-block;
}

.profile-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
}

/* Kafelek wyłączony (wkrótce) */
.tile-disabled {
  opacity: 0.6;
  cursor: not-allowed !important;
  position: relative;
}

.badge-warning {
  background: #f59e0b;
  color: white;
}

/* ==========================================
      GLOBAL CLOCK SYSTEM
      Full Contract Display
      ========================================== */



.system-clock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-weight: 600;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.system-clock > span {
  display: inline-block;
}

.system-clock > span:not(:last-child)::after {
  content: '||';
  margin-left: 8px;
  opacity: 0.4;
  font-weight: 400;
}

.system-clock .clock-day {
  text-transform: lowercase;
  font-weight: 600;
}

.system-clock .clock-week {
  opacity: 0.9;
}

.system-clock .clock-date {
  opacity: 0.9;
}

.system-clock .clock-time {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.system-clock .clock-timezone {
  opacity: 0.75;
  font-size: 0.85rem;
}

.system-clock .clock-dst {
  opacity: 0.75;
  font-size: 0.85rem;
  text-transform: lowercase;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
  .system-clock {
    font-size: 0.85rem;
    gap: 6px;
  }
   
  .system-clock > span:not(:last-child)::after {
    margin-left: 6px;
  }
   
  .system-clock .clock-time {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .system-clock-tile {
    padding: 10px 16px;
  }
   
  .system-clock {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    font-size: 0.75rem;
  }
   
  .system-clock > span:not(:last-child)::after {
    margin-left: 4px;
  }
   
  .system-clock .clock-time {
    font-size: 0.9rem;
  }
   
  .system-clock .clock-timezone,
  .system-clock .clock-dst {
    font-size: 0.7rem;
  }
}

/* ==========================================
   LOGIN TRYB PRO - Inline errors & fields
   ========================================== */
.login-field {
  margin-bottom: 16px;
  text-align: left;
}

.login-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.login-error {
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #fca5a5;
  font-size: 0.9rem;
  text-align: left;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.login-card input:disabled,
.login-card input:read-only {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(31, 41, 55, 0.5);
}


/* ENTERPRISE STYLING - Aligned with obrot module */
