/* ============================================================
   PCC Silicium S.A. - Executive Industrial Theme
   Stonowana, elegancka paleta barw (grafit, ciemny łupek, stonowany miedziany pomarańcz PCC)
   Zoptymalizowana dla komfortu wzroku (bez jaskrawych neonów)
   Pełna responsywność: mobile, tablet i desktop
   ============================================================ */

:root {
  /* Tła i powierzchnie - stonowane i przyjazne dla oczu */
  --bg-deep: #0b0f19;
  --bg-card: #111827;
  --bg-card-hover: #162032;
  --bg-surface: #0e1524;
  --bg-input: #080c14;
  --border-color: #1e293b;
  --border-light: #2b3b53;

  /* Stonowany akcent korporacyjny PCC (elegancki miedziany pomarańcz, bez efektu oślepiania) */
  --pcc-orange: #e05615;
  --pcc-orange-hover: #c4460a;
  --pcc-orange-light: #f97316;
  --pcc-orange-soft: rgba(224, 86, 21, 0.10);
  --border-pcc-orange: rgba(224, 86, 21, 0.30);

  /* Kompatybilność */
  --orange-primary: #e05615;
  --orange-hover: #c4460a;
  --orange-light: #f97316;
  --border-orange: rgba(224, 86, 21, 0.30);
  --bg-orange-soft: rgba(224, 86, 21, 0.10);
  --cyan-primary: #e05615;
  --cyan-hover: #c4460a;
  --border-cyan: rgba(224, 86, 21, 0.30);

  /* Kolory statusów - stonowane i czytelne */
  --emerald-primary: #10b981;
  --purple-primary: #8b5cf6;
  --amber-primary: #f59e0b;
  --rose-primary: #f43f5e;
  --blue-primary: #3b82f6;

  /* Typografia i stonowany kontrast */
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Subtelne cienie bez poświaty */
  --shadow-card: 0 4px 16px -2px rgba(0, 0, 0, 0.35);
  --shadow-modal: 0 20px 40px -8px rgba(0, 0, 0, 0.7);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body.dark-theme {
  font-family: var(--font-family);
  background-color: var(--bg-deep);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.25rem;
}

.nav-container {
  max-width: 1320px;
  margin: 0 auto;
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  flex-wrap: wrap;
}

/* BRAND HEADER WITH OFFICIAL PCC LOGO */
.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-pcc-logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.3rem 0.5rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
}

.brand-pcc-logo {
  height: 2.1rem;
  width: auto;
  object-fit: contain;
  display: block;
}

}

.brand-divider {
  width: 1px;
  height: 1.75rem;
  background: var(--border-color);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #fff;
  line-height: 1.2;
}

.brand-title .accent {
  color: var(--pcc-orange);
}

.badge-corp {
  font-size: 0.65rem;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  vertical-align: middle;
  font-weight: 700;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* User Chip */
.user-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: 0.65rem;
}

.user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  background: #1e293b;
  color: #f8fafc;
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

.user-avatar.ceo {
  background: linear-gradient(135deg, #b45309, #d97706);
  color: #fff;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.user-role-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  width: fit-content;
  margin-top: 2px;
}

/* Role Badges - Stonowane i profesjonalne */
.role-prezes    { background: rgba(217, 119, 6, 0.12); color: #fde68a; border: 1px solid rgba(217, 119, 6, 0.35); font-weight: 800; }
.role-kierownik { background: rgba(139, 92, 246, 0.12); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.30); }
.role-dostawca  { background: rgba(234, 88, 12, 0.12); color: #fdba74; border: 1px solid rgba(234, 88, 12, 0.30); }
.role-pracownik { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.30); }
.role-admin     { background: rgba(100, 116, 139, 0.15); color: #cbd5e1; border: 1px solid rgba(100, 116, 139, 0.30); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  min-height: 38px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 0.55rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
  user-select: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: #e05615;
  color: #fff;
  border-color: #c4460a;
}
.btn-primary:hover {
  background: #c4460a;
}

.btn-ceo {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
  color: #fff;
  border-color: #d97706;
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.3);
}
.btn-ceo:hover {
  background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  color: #fff;
}

.btn-danger {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.25);
  color: #fda4af;
}
.btn-danger:hover {
  background: rgba(244, 63, 94, 0.22);
}

.btn-success {
  background: #059669;
  color: #fff;
  border-color: #047857;
}
.btn-success:hover {
  background: #047857;
}

/* SUB NAVIGATION TABS */
.sub-nav {
  background-color: #090d16;
  border-bottom: 1px solid var(--border-color);
  padding: 0.35rem 1.25rem;
  position: sticky;
  top: 4.25rem;
  z-index: 90;
}

.sub-nav-container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.sub-nav-container::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 0.5rem 0.9rem;
  min-height: 38px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.tab-btn.active {
  background: var(--bg-card);
  color: #fff;
  border-color: var(--border-light);
  border-bottom: 2px solid var(--pcc-orange);
}

.tab-badge {
  background: #1e293b;
  color: #e2e8f0;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border-light);
}

/* MAIN CONTENT */
.main-content {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  flex: 1;
}

/* HERO BANNER - Czysty i stonowany */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-card);
}

.hero-subtitle {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--pcc-orange);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.hero-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.hero-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 680px;
  margin-top: 0.25rem;
  line-height: 1.45;
}

/* FILTER CHIPS */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  color: #fff;
  border-color: var(--border-light);
}

.filter-chip.active {
  background: #1e293b;
  color: #fff;
  border-color: var(--border-light);
  font-weight: 700;
}

/* KPI TILES */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.85rem;
  padding: 1.15rem;
  box-shadow: var(--shadow-card);
}

.kpi-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  margin-top: 0.35rem;
}

.kpi-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

/* GRID LAYOUTS */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 1.25rem;
}

@media (max-width: 960px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.35rem;
  box-shadow: var(--shadow-card);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* FORMS */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  min-height: 40px;
  font-size: 0.82rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 0.55rem;
  color: #fff;
  font-family: inherit;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: #475569;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.9rem;
  padding-right: 2.25rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .form-row-2 {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .form-input, .form-select, .form-textarea {
    font-size: 16px;
    min-height: 44px;
  }
  .btn {
    min-height: 44px;
    font-size: 0.8rem;
  }
}

/* TABLES */
.table-wrapper {
  overflow-x: auto;
  border-radius: 0.65rem;
  border: 1px solid var(--border-color);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.78rem;
}

.data-table th {
  background-color: #080c16;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.015);
}

.font-mono {
  font-family: var(--font-mono);
}

/* STATUS BADGES */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* Priority Badges */
.prio-pill {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}
.prio-alarm { background: rgba(244, 63, 94, 0.15); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.3); }
.prio-normal { background: rgba(51, 65, 85, 0.4); color: #cbd5e1; border: 1px solid rgba(71, 85, 105, 0.3); }
.prio-low { background: rgba(30, 41, 59, 0.6); color: #94a3b8; }

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: var(--shadow-modal);
}

/* TOAST */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 90vw;
}

.toast {
  background: #111827;
  border: 1px solid var(--border-light);
  color: #fff;
  padding: 0.8rem 1.15rem;
  border-radius: 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

/* FOOTER */
.app-footer {
  border-top: 1px solid var(--border-color);
  background: #070a12;
  padding: 1.25rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: auto;
}

.footer-container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* REQUISITION CARD (CLEAN & READABLE) */
.req-item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s ease;
}

.req-item-card:hover {
  border-color: var(--border-light);
}

.req-item-card.urgent {
  border-left: 3px solid #f43f5e;
}

.req-item-card.approved-po {
  border-left: 3px solid #10b981;
}

/* RESPONSIVE MOBILE STYLES (< 768px) */
@media (max-width: 768px) {
  .navbar {
    padding: 0 0.75rem;
  }

  .nav-container {
    min-height: auto;
    padding: 0.5rem 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .brand {
    justify-content: flex-start;
    width: 100%;
    gap: 0.6rem;
  }

  .brand-pcc-logo {
    height: 1.8rem;
  }

  .brand-title {
    font-size: 0.95rem;
  }

  .brand-sub {
    display: none;
  }

  .nav-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.45rem;
  }

  .user-chip {
    padding: 0.25rem 0.5rem;
    flex: 1;
    min-width: 0;
  }

  .user-name {
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sub-nav {
    top: auto;
    padding: 0.3rem 0.75rem;
  }

  .main-content {
    padding: 1rem 0.75rem;
  }

  .hero-card {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .hero-title {
    font-size: 1.15rem;
  }

  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-card {
    border-radius: 1rem 1rem 0 0;
    max-height: 85vh;
    padding: 1.15rem;
    width: 100%;
    max-width: 100%;
  }

  .table-desktop {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .cards-mobile-only {
    display: none !important;
  }
}

/* LOGIN SCREEN */
.login-wrapper {
  max-width: 480px;
  width: 100%;
  margin: 2.5rem auto;
  padding: 0 1rem;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-modal);
}

.login-alert-error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
  padding: 0.75rem 1rem;
  border-radius: 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

}
