@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Sora:wght@500;600;700&display=swap");

:root {
  --pk-ink: #121a17;
  --pk-muted: #5a6b63;
  --pk-bg: #f1f4f2;
  --pk-surface: #ffffff;
  --pk-sidebar: #0b1411;
  --pk-sidebar-2: #101c18;
  --pk-accent: #0f6b4c;
  --pk-accent-bright: #1aa06d;
  --pk-accent-soft: #e6f4ee;
  --pk-gold: #9a7b2f;
  --pk-danger: #b42318;
  --pk-warn: #b54708;
  --pk-info: #175cd3;
  --pk-border: #dde5e0;
  --pk-radius: 12px;
  --pk-shadow: 0 1px 2px rgba(12, 24, 20, 0.04), 0 8px 24px rgba(12, 24, 20, 0.04);
  --font-display: "Sora", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --sidebar-w: 268px;
  --nav-text: rgba(236, 244, 240, 0.78);
  --nav-text-strong: #f4faf7;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body.app-body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--pk-ink);
  background: var(--pk-bg);
  -webkit-font-smoothing: antialiased;
}

.app-shell { display: flex; min-height: 100vh; width: 100%; }
.app-shell.guest-shell { display: block; }
.guest-body .app-main { width: 100%; max-width: 100%; }
.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--pk-sidebar);
  color: var(--nav-text);
  padding: 1.1rem .85rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
  transition: width .2s ease, min-width .2s ease, padding .2s ease, opacity .15s ease, border-color .2s ease;
}
body.sidebar-collapsed .app-sidebar {
  width: 0;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  border-right-color: transparent;
  pointer-events: none;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -.01em;
  padding: .45rem .7rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  margin-bottom: .45rem;
  color: var(--nav-text-strong);
}
.brand span { color: rgba(244,250,247,.55); font-weight: 600; }
.brand-name { display: inline; }
.brand-logo {
  display: block;
  max-height: 36px;
  max-width: 148px;
  width: auto;
  object-fit: contain;
  margin-bottom: .4rem;
  border-radius: 4px;
}
.brand-logo-sm {
  max-height: 32px;
  max-width: 72px;
  object-fit: contain;
  border-radius: 4px;
}
.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-size: .68rem;
  font-weight: 500;
  color: rgba(236,244,240,.42);
  margin-top: .3rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.nav-group { margin-bottom: .7rem; }
.nav-group-title {
  font-size: .65rem;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(236,244,240,.38);
  padding: .45rem .75rem .25rem;
  margin-bottom: .1rem;
}
.side-nav a {
  color: var(--nav-text);
  text-decoration: none;
  padding: .52rem .7rem;
  border-radius: 8px;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: -.01em;
  border-left: 2px solid transparent;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.side-nav a:hover, .side-nav a:focus {
  background: rgba(255,255,255,.05);
  color: var(--nav-text-strong);
  outline: none;
}
.side-nav a.active {
  background: rgba(26, 160, 109, .14);
  color: var(--nav-text-strong);
  border-left-color: var(--pk-accent-bright);
  box-shadow: none;
  font-weight: 600;
}
.nav-ico {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  opacity: .72;
  line-height: 0;
}
.nav-ico svg {
  width: 1.05rem;
  height: 1.05rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side-nav a:hover .nav-ico,
.side-nav a.active .nav-ico { opacity: 1; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--pk-bg); }
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1.5rem;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pk-border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.top-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -.015em;
  color: var(--pk-ink);
}
.top-meta { font-size: .75rem; color: var(--pk-muted); margin-top: .1rem; }
.top-user {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: var(--pk-accent-soft);
  color: var(--pk-accent);
  border-radius: 8px;
  padding: .4rem .7rem;
  font-size: .8rem;
  font-weight: 600;
}

.app-content {
  padding: 1.25rem 1.5rem 2.5rem;
  width: 100%;
  max-width: none;
  flex: 1;
}
.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--pk-border);
  background: #fff;
  color: var(--pk-ink);
  flex-shrink: 0;
}
.sidebar-toggle:hover {
  background: var(--pk-bg);
  border-color: #c5d2cb;
  color: var(--pk-accent);
}
.sidebar-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.page-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
  padding-bottom: .15rem;
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.8vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 .3rem;
  color: var(--pk-ink);
}
.page-hero p {
  margin: 0;
  color: var(--pk-muted);
  max-width: 54ch;
  line-height: 1.5;
  font-size: .92rem;
}

.panel {
  background: var(--pk-surface);
  border: 1px solid var(--pk-border);
  border-radius: var(--pk-radius);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--pk-shadow);
}
.panel-title {
  font-family: var(--font-display);
  font-size: .98rem;
  font-weight: 650;
  letter-spacing: -.01em;
  margin: 0 0 .85rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .85rem;
  margin-bottom: 1.1rem;
}
.stat {
  background: var(--pk-surface);
  border: 1px solid var(--pk-border);
  border-radius: var(--pk-radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--pk-shadow);
  position: relative;
  overflow: hidden;
  border-top: 2px solid transparent;
}
.stat::after { display: none; }
.stat.accent-info { border-top-color: var(--pk-info); }
.stat.accent-warn { border-top-color: var(--pk-warn); }
.stat.accent-gold { border-top-color: var(--pk-gold); }
.stat .label {
  font-size: .72rem;
  color: var(--pk-muted);
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}
.stat .value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--pk-ink);
  position: relative;
  z-index: 1;
  line-height: 1.15;
  margin-top: .35rem;
  letter-spacing: -.02em;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 992px) {
  .chart-grid { grid-template-columns: 1fr; }
}
.chart-box {
  background: var(--pk-surface);
  border: 1px solid var(--pk-border);
  border-radius: var(--pk-radius);
  padding: 1rem 1.1rem 1.2rem;
  box-shadow: var(--pk-shadow);
  min-height: 320px;
}
.chart-box h2 {
  font-family: var(--font-display);
  font-size: .95rem;
  margin: 0 0 1rem;
}

.btn-primary {
  background: var(--pk-accent);
  border-color: var(--pk-accent);
  font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus {
  background: #146349;
  border-color: #146349;
}
.btn-outline-primary {
  color: var(--pk-accent);
  border-color: var(--pk-accent);
  font-weight: 600;
}
.btn-outline-primary:hover {
  background: var(--pk-accent);
  border-color: var(--pk-accent);
}
.form-label { font-weight: 600; font-size: .86rem; color: var(--pk-muted); }
.form-control, .form-select {
  border-radius: 10px;
  border-color: var(--pk-border);
  min-height: 42px;
}
.form-control:focus, .form-select:focus {
  border-color: var(--pk-accent);
  box-shadow: 0 0 0 .2rem rgba(26,122,88,.15);
}

.table { --bs-table-bg: transparent; }
.table thead th {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--pk-muted);
  border-bottom-width: 1px;
  font-weight: 700;
}
.table-responsive-cards table { width: 100%; }

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .85rem;
}
.quick-link {
  --ql-accent: var(--pk-accent);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .85rem;
  padding: .95rem 1rem;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faf8 100%);
  border: 1px solid var(--pk-border);
  text-decoration: none;
  color: var(--pk-ink);
  min-height: 88px;
  box-shadow: 0 1px 2px rgba(12, 24, 20, .04);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
  position: relative;
  overflow: hidden;
}
.quick-link::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ql-accent);
  opacity: .55;
  transition: opacity .15s ease;
}
.quick-link:hover {
  border-color: #b4c9be;
  box-shadow: 0 8px 22px rgba(12, 24, 20, .08);
  transform: translateY(-2px);
  color: var(--pk-ink);
  background: #fff;
}
.quick-link:hover::before { opacity: 1; }
.quick-link:active { transform: translateY(0); }
.quick-link:focus-visible {
  outline: 2px solid var(--pk-accent-bright);
  outline-offset: 2px;
}
.ql-ico {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--pk-accent-soft);
  color: var(--ql-accent);
  flex-shrink: 0;
}
.ql-ico svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ql-body {
  display: flex;
  flex-direction: column;
  gap: .18rem;
  min-width: 0;
}
.ql-body strong {
  font-family: var(--font-display);
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.25;
}
.ql-body span {
  font-size: .78rem;
  color: var(--pk-muted);
  line-height: 1.35;
}
.ql-go {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eef3f0;
  color: var(--pk-muted);
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.ql-go svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.quick-link:hover .ql-go {
  background: var(--pk-accent);
  color: #fff;
  transform: translateX(2px);
}
.quick-link.tone-blue { --ql-accent: #175cd3; }
.quick-link.tone-blue .ql-ico { background: #e8f0fe; }
.quick-link.tone-amber { --ql-accent: #b54708; }
.quick-link.tone-amber .ql-ico { background: #fff4e8; }
.quick-link.tone-slate { --ql-accent: #3d4f47; }
.quick-link.tone-slate .ql-ico { background: #eef1ef; }

.badge-soft {
  display: inline-flex;
  align-items: center;
  padding: .22rem .55rem;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .02em;
  background: var(--pk-accent-soft);
  color: var(--pk-accent);
}
.app-topbar .btn-outline-secondary {
  border-color: var(--pk-border);
  color: var(--pk-muted);
  font-weight: 600;
}
.app-topbar .btn-outline-secondary:hover {
  background: var(--pk-bg);
  border-color: #c5d2cb;
  color: var(--pk-ink);
}
.badge-soft.status-ok { background: #e8f6ee; color: #0b6b3a; }
.badge-soft.status-bad { background: #fdecea; color: #a12622; }
.badge-soft.status-wait { background: #fff6e5; color: #8a5a00; }
.request-card.ozluk-missing {
  border-color: #f0c2bc;
  background: linear-gradient(180deg, #fff8f7, #fff);
}
.nav-tabs .nav-link { color: var(--pk-muted); font-weight: 600; }
.nav-tabs .nav-link.active { color: var(--pk-sidebar); border-bottom-color: var(--pk-accent, #c4a35a); }

.kiosk-screen {
  min-height: 100vh;
  background: radial-gradient(circle at 30% 20%, #0f4636, #061f18 70%);
  color: #f4fff9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.kiosk-screen .qr-box {
  background: #fff;
  padding: 1rem;
  border-radius: 12px;
  min-width: min(90vw, 360px);
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  font-size: .85rem;
  word-break: break-all;
}

.mobile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.mobile-actions a, .mobile-actions button {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 12px;
  text-decoration: none;
  background: linear-gradient(180deg, #fff, #f7faf8);
  border: 1px solid var(--pk-border);
  box-shadow: 0 1px 2px rgba(12, 24, 20, .04);
  color: var(--pk-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .88rem;
  letter-spacing: -.01em;
  padding: .85rem .75rem;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.mobile-actions a:hover, .mobile-actions button:hover {
  border-color: #b4c9be;
  box-shadow: 0 8px 20px rgba(12, 24, 20, .08);
  transform: translateY(-1px);
  color: var(--pk-accent);
}

.disclaimer { font-size: .85rem; color: var(--pk-muted); }
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--pk-muted);
}

@media (max-width: 991px) {
  .app-content { padding: .9rem; }
  .table-responsive-cards thead { display: none; }
  .table-responsive-cards tr {
    display: block;
    background: #fff;
    border: 1px solid var(--pk-border);
    border-radius: 12px;
    margin-bottom: .75rem;
    padding: .85rem;
    box-shadow: var(--pk-shadow);
  }
  .table-responsive-cards td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border: 0 !important;
    padding: .35rem 0 !important;
  }
  .table-responsive-cards td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--pk-muted);
  }
}
