﻿body {
  font-family: "Poppins", sans-serif;
  background: radial-gradient(circle at top left, #193757 0, #020818 60%);
  min-height: 100vh;
}

.app {
  display: flex;
  min-height: 100vh; /* sidebar do dna ekrana */
  color: #f7f9fc;
}

/* SIDEBAR */
.sidebar {
  width: 90px;
  background: linear-gradient(
    to bottom,
    rgba(7, 32, 63, 0.95),
    rgba(2, 10, 26, 0.98)
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.icon-btn {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.icon-btn img[src*="home.svg"] {
  filter: brightness(0) invert(1);
}

.icon-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.icon-btn.active {
  background: #1a73ff;
  border-color: #1a73ff;
}

.sidebar-bottom {
  margin-top: auto;
  padding-bottom: 24px;
}

/* MAIN */
.main {
  flex: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.topbar-title {
  font-size: 20px;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  gap: 12px;
}

.user-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.user-btn img {
  width: 24px;
  height: 24px;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

.logout-btn img {
  width: 20px;
  height: 20px;
}

.logout-btn span {
  font-size: 16px;
  color: #fff;
}

/* PANEL */
.panel {
  max-width: 960px;
  margin: 16px auto 0;
  padding: 48px 56px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  background: radial-gradient(
    circle at top,
    rgba(18, 48, 92, 0.95),
    rgba(6, 20, 44, 0.98)
  );
}

.panel-header {
  text-align: center;
  margin-bottom: 32px;
}

.panel-header small {
  opacity: 0.7;
  display: block;
  margin-bottom: 8px;
}

.panel-header h1 {
  font-size: 28px;
  font-weight: 700;
}

.panel-header p {
  opacity: 0.8;
  font-size: 14px;
  max-width: 520px;
  margin: 0 auto;
}

/* FORM SECTION */
.form-section {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 13px;
  margin-bottom: 4px;
}

.form-label span {
  color: #7dafff;
}

.form-helper {
  font-size: 11px;
  opacity: 0.75;
  margin-bottom: 10px;
}

/* Djelatnost dropdown */
.dropdown-row {
  width: 100%;
  margin-bottom: 20px;
}

.activity-select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  background: #fff;
  color: #000;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='10' viewBox='0 0 14 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L7 9L13 1' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.activity-select:hover {
  background: #f4f4f4;
}

/* Naziv proizvoda input */
.search-row {
  width: 100%;
  position: relative;
  margin-bottom: 20px;
}

.search-input {
  width: 100%;
  padding: 14px 48px 14px 16px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
}

.search-icon-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 18px;
}

/* SUBMIT BUTTON */
.submit-btn {
  width: 504px;
  height: 52px;
  background: #1e90ff;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  border: none;
  cursor: pointer;
  align-self: center;
  font-size: 15px;
}

/* RESULTS */
.results {
  max-width: 960px;
  margin: 32px auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.results-box {
  padding: 12px 28px;
  border-radius: 10px;
  border: 1px solid #4373aa;
}

/* Rezultat item */
.result-item {
  margin-top: 8px;
}

.result-meta {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 2px;
}

.result-meta span {
  font-weight: 500;
}

.result-code {
  font-size: 14px;
  color: inherit;
  text-decoration: none;
  cursor: default;
  display: inline-block;
  margin: 6px 0 2px;
}

.result-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* =========================
   MOBILE / RESPONSIVE PATCH
   (dodati na kraj kpd_single.css)
   ========================= */

/* Desktop: malo “zraka” i da sadržaj ne lijepi za rub */
.main {
  padding: 24px 24px 32px;
}

/* Ukloni fiksnu širinu gumba (504px) i učini ga fluidnim */
.submit-btn {
  width: 100%;
  max-width: 504px;
}

/* Topbar neka se ne lomi ružno */
.topbar {
  gap: 12px;
}

/* ----- TABLET i manje ----- */
@media (max-width: 900px) {
  .panel {
    padding: 32px 28px;
  }
}

/* ----- MOBITEL ----- */
@media (max-width: 640px) {
  /* Sidebar pretvori u bottom nav */
  .app {
    flex-direction: column;
    min-height: 100vh;
  }

  .sidebar {
    width: 100%;
    height: 72px;
    padding: 10px 12px;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;

    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .sidebar-nav {
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    gap: 10px;
  }

  .icon-btn {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .sidebar-bottom {
    display: none; /* ako nema bitnog sadržaja dolje */
  }

  /* Main da ne upadne ispod bottom bara */
  .main {
    padding: 16px 14px 96px; /* bottom padding zbog fixed sidebara */
  }

  /* Topbar: prelamanje u 2 reda + manji tip */
  .topbar {
    margin-bottom: 18px;
  }

  .topbar-title {
    font-size: 18px;
  }

  .topbar-right {
    justify-content: flex-end;
    gap: 10px;
  }

  /* Logout gumb bez velikog teksta na jako malim ekranima */
  .logout-btn {
    padding: 8px 10px;
  }
  .logout-btn span {
    font-size: 14px;
  }

  /* Panel: full width, manji padding */
  .panel {
    margin: 0;
    max-width: 100%;
    padding: 22px 16px;
    border-radius: 12px;
  }

  .panel-header h1 {
    font-size: 22px;
  }
  .panel-header p {
    font-size: 13px;
  }

  /* Inputi već imaju width:100%, samo smanji paddings po želji */
  .activity-select,
  .search-input {
    padding: 12px 14px;
  }

  .search-input {
    padding-right: 44px;
  }

  /* Results box manji padding */
  .results {
    margin: 16px auto;
    gap: 12px;
  }
  .results-box {
    padding: 12px 14px;
  }
}

/* ----- EXTRA SMALL ----- */
@media (max-width: 380px) {
  .logout-btn span {
    display: none; /* samo ikona na ultra malom */
  }
}
