/* ============================================================
   ZOMO – System Czasu Pracy | Straż Marszałkowska
   assets/css/style.css
   ============================================================ */

/* ── Reset & zmienne ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --clr-bg:        #0b0e17;
  --clr-bg2:       #111522;
  --clr-bg3:       #192033;
  --clr-card:      #141927;
  --clr-border:    #1e2840;
  --clr-gold:      #c9a227;
  --clr-gold-dim:  #8a6f1c;
  --clr-gold-glow: rgba(201,162,39,0.18);
  --clr-red:       #c0392b;
  --clr-green:     #27ae60;
  --clr-blue:      #2980b9;
  --clr-text:      #e8ecf4;
  --clr-muted:     #7a8aaa;
  --clr-discord:   #5865F2;
  --clr-discord-h: #4752c4;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow:        0 4px 24px rgba(0,0,0,0.5);
  --font:          'Segoe UI', system-ui, sans-serif;
  --transition:    .2s ease;
}

body {
  background: var(--clr-bg);
  color: var(--clr-text);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--clr-gold); text-decoration: none; }
a:hover { color: #e8bb3a; }

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  background: var(--clr-bg2);
  border-bottom: 2px solid var(--clr-gold-dim);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--clr-gold);
}

.topbar-brand .brand-icon {
  width: 36px; height: 36px;
  background: var(--clr-gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #000;
  font-weight: 900;
  font-size: .85rem;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.topbar-user img {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--clr-gold-dim);
}

.topbar-user .u-name {
  font-size: .9rem;
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user .u-role {
  font-size: .75rem;
  color: var(--clr-muted);
}

/* ── Layout główny ───────────────────────────────────────── */
.main-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
}

.sidebar {
  background: var(--clr-bg2);
  border-right: 1px solid var(--clr-border);
  padding: 1.5rem 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.5rem;
  color: var(--clr-muted);
  font-size: .9rem;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--clr-gold);
  background: var(--clr-gold-glow);
  border-left-color: var(--clr-gold);
}

.sidebar-nav .nav-icon { font-size: 1.1rem; }

.sidebar-section {
  padding: .5rem 1.5rem .25rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--clr-gold-dim);
  margin-top: 1rem;
}

.content {
  padding: 2rem;
  max-width: 1200px;
}

/* ── Strona logowania ─────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 40%, rgba(201,162,39,0.07) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 60%, rgba(88,101,242,0.07) 0%, transparent 60%),
    var(--clr-bg);
}

.login-box {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: var(--shadow), 0 0 60px rgba(201,162,39,0.08);
}

.login-emblem {
  width: 90px; height: 90px;
  margin: 0 auto 1.5rem;
}

.login-emblem img { width: 100%; }

.login-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--clr-gold);
  letter-spacing: .03em;
  margin-bottom: .5rem;
}

.login-subtitle {
  color: var(--clr-muted);
  font-size: .9rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.login-divider {
  border: none;
  border-top: 1px solid var(--clr-border);
  margin: 1.5rem 0;
}

/* ── Przyciski ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-discord {
  background: var(--clr-discord);
  color: #fff;
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: .8rem 1.5rem;
}
.btn-discord:hover { background: var(--clr-discord-h); color: #fff; }

.btn-gold {
  background: var(--clr-gold);
  color: #000;
}
.btn-gold:hover { background: #e8bb3a; color: #000; }

.btn-danger {
  background: var(--clr-red);
  color: #fff;
}
.btn-danger:hover { background: #a93226; color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--clr-muted);
  border: 1px solid var(--clr-border);
}
.btn-ghost:hover { background: var(--clr-bg3); color: var(--clr-text); }

.btn-green {
  background: var(--clr-green);
  color: #fff;
}
.btn-green:hover { background: #1e8449; color: #fff; }

.btn-sm { padding: .4rem .9rem; font-size: .8rem; }
.btn-lg { padding: .9rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Karty ───────────────────────────────────────────────── */
.card {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--clr-gold);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.card-body { color: var(--clr-text); }

/* ── Timer ────────────────────────────────────────────────── */
.timer-display {
  font-size: 4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  color: var(--clr-gold);
  text-align: center;
  padding: 1.5rem 0;
  text-shadow: 0 0 30px rgba(201,162,39,0.4);
}

.timer-display.running {
  animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {
  0%, 100% { text-shadow: 0 0 20px rgba(201,162,39,0.4); }
  50%       { text-shadow: 0 0 50px rgba(201,162,39,0.8); }
}

.timer-status {
  text-align: center;
  font-size: .85rem;
  color: var(--clr-muted);
  margin-bottom: 1rem;
}

.timer-status.active { color: var(--clr-green); font-weight: 600; }

.timer-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Formularz karty czasu pracy ─────────────────────────── */
.work-form textarea {
  width: 100%;
  background: var(--clr-bg3);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  color: var(--clr-text);
  padding: .75rem 1rem;
  font-family: var(--font);
  font-size: .95rem;
  resize: vertical;
  min-height: 120px;
  transition: var(--transition);
}

.work-form textarea:focus {
  outline: none;
  border-color: var(--clr-gold-dim);
  box-shadow: 0 0 0 3px var(--clr-gold-glow);
}

.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--clr-muted);
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.form-group { margin-bottom: 1.2rem; }

.form-input {
  width: 100%;
  background: var(--clr-bg3);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  color: var(--clr-text);
  padding: .65rem 1rem;
  font-family: var(--font);
  font-size: .95rem;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--clr-gold-dim);
  box-shadow: 0 0 0 3px var(--clr-gold-glow);
}

.form-input::placeholder { color: var(--clr-muted); }

/* ── Tabela ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

thead th {
  background: var(--clr-bg3);
  color: var(--clr-muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .65rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--clr-border);
}

tbody tr {
  border-bottom: 1px solid var(--clr-border);
  transition: var(--transition);
}

tbody tr:hover { background: rgba(255,255,255,0.03); }

tbody td {
  padding: .75rem 1rem;
  color: var(--clr-text);
  vertical-align: middle;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.badge-commandant { background: rgba(201,162,39,0.2); color: var(--clr-gold); }
.badge-support    { background: rgba(41,128,185,0.2); color: #5dade2; }
.badge-guard      { background: rgba(39,174,96,0.2);  color: #52be80; }
.badge-pending    { background: rgba(127,127,127,0.2); color: var(--clr-muted); }
.badge-active     { background: rgba(39,174,96,0.2);  color: #52be80; }
.badge-completed  { background: rgba(41,128,185,0.2); color: #5dade2; }
.badge-reviewed   { background: rgba(39,174,96,0.18); color: #58d68d; }
.badge-unreview   { background: rgba(230,126,34,0.2); color: #f0a05a; }

/* ── Statystyki ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--clr-gold);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: .8rem;
  color: var(--clr-muted);
  margin-top: .25rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── Alert / Toast ───────────────────────────────────────── */
.alert {
  padding: .85rem 1.2rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.alert-error   { background: rgba(192,57,43,0.15); border: 1px solid rgba(192,57,43,0.4); color: #e74c3c; }
.alert-success { background: rgba(39,174,96,0.15); border: 1px solid rgba(39,174,96,0.4); color: #2ecc71; }
.alert-info    { background: rgba(41,128,185,0.15); border: 1px solid rgba(41,128,185,0.4); color: #3498db; }
.alert-warning { background: rgba(243,156,18,0.15); border: 1px solid rgba(243,156,18,0.4); color: #f39c12; }

/* ── Toast powiadomień ───────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.toast {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: .85rem 1.2rem;
  min-width: 260px;
  max-width: 360px;
  box-shadow: var(--shadow);
  font-size: .9rem;
  animation: slide-in .3s ease;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.toast.success { border-left: 4px solid var(--clr-green); }
.toast.error   { border-left: 4px solid var(--clr-red); }
.toast.info    { border-left: 4px solid var(--clr-blue); }

@keyframes slide-in {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Avatar z inicjałami ─────────────────────────────────── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--clr-border);
}

.avatar-sm { width: 28px; height: 28px; }

.user-info {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.user-info .u-name  { font-weight: 600; font-size: .9rem; }
.user-info .u-disc  { font-size: .78rem; color: var(--clr-muted); }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 500;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow);
  animation: modal-in .2s ease;
}

@keyframes modal-in {
  from { transform: scale(.95); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--clr-gold);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.modal-footer {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ── Raporty ─────────────────────────────────────────────── */
.report-card {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}

.report-header {
  padding: 1rem 1.25rem;
  background: var(--clr-bg3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.report-body {
  padding: 1rem 1.25rem;
  color: var(--clr-text);
  font-size: .92rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.report-meta {
  font-size: .8rem;
  color: var(--clr-muted);
}

.report-review-note {
  padding: .75rem 1.25rem;
  background: rgba(212,175,55,0.06);
  border-top: 1px solid var(--clr-border);
  font-size: .85rem;
  color: var(--clr-muted);
}

.report-filter-btn.active {
  background: var(--clr-gold);
  color: #000;
  border-color: var(--clr-gold);
}

/* ── Profil strażnika ───────────────────────────────────────── */
.profile-header-card {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--clr-gold-dim);
  display: block;
}

.profile-online-dot {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 14px;
  height: 14px;
  background: var(--clr-green);
  border-radius: 50%;
  border: 2px solid var(--clr-card);
  animation: pulse 1.5s infinite;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--clr-text);
}

.profile-sub {
  font-size: .9rem;
  color: var(--clr-muted);
  margin-top: .15rem;
}

.activity-bar-wrap {
  background: var(--clr-bg3);
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
}

.activity-bar {
  height: 100%;
  background: var(--clr-gold);
  border-radius: 4px;
  min-width: 2px;
  transition: width .3s ease;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .6; transform: scale(1.15); }
}

/* ── Pending page ─────────────────────────────────────────── */
.centered-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
  padding: 2rem;
}

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--clr-gold);
  display: flex;
  align-items: center;
  gap: .6rem;
}

.page-subtitle {
  color: var(--clr-muted);
  font-size: .9rem;
  margin-top: .3rem;
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--clr-border);
  padding-bottom: 0;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--clr-muted);
  padding: .75rem 1.25rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: -1px;
}

.tab-btn:hover  { color: var(--clr-text); }
.tab-btn.active { color: var(--clr-gold); border-bottom-color: var(--clr-gold); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Select ──────────────────────────────────────────────── */
.form-select {
  width: 100%;
  background: var(--clr-bg3);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  color: var(--clr-text);
  padding: .65rem 1rem;
  font-family: var(--font);
  font-size: .95rem;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: var(--clr-gold-dim);
}

/* ── Divider tekstowy ─────────────────────────────────────── */
.text-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--clr-muted);
  font-size: .8rem;
  margin: 1rem 0;
}

.text-divider::before,
.text-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--clr-border);
}

/* ── Responsywność ───────────────────────────────────────── */
@media (max-width: 768px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 1rem; }
  .timer-display { font-size: 3rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
