/* =========================================================
   ÜLDPÕHISTIIL
   ========================================================= */
body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  background: #f9fafb;
  color: #111827;
}

/* =========================================================
   PÄIS
   ========================================================= */
header {
  background: #1e293b;
  color: white;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-sizing: border-box;
}

header h1 {
  font-size: 22px;
  margin: 0;
  font-weight: 600;
}

/* =========================================================
   SIDEBAR — JÄÄB ALATI NÄHTAVAKS
   ========================================================= */
.sidebar,
.admin-sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  width: 240px;
  background: #1e293b;
  color: white;
  padding: 25px 20px;
  overflow-y: auto;
  box-sizing: border-box;
}

.sidebar a,
.admin-sidebar a {
  display: block;
  padding: 10px 12px;
  margin-bottom: 6px;
  color: #e2e8f0;
  text-decoration: none;
  border-radius: 6px;
}

.sidebar a:hover {
  background: #334155;
  color: #fff;
}

/* =========================================================
   RIGHTBAR — PEIDAME MOBIILIS 100% KINDLASTI
   ========================================================= */
.rightbar {
  position: fixed;
  top: 64px;
  right: 0;
  bottom: 0;
  width: 260px;
  padding: 20px;
  overflow-y: auto;
  background: #ffffff;
  border-left: 1px solid #e5e7eb;
}

/* alla 1024px kaob täielikult */
@media (max-width: 1024px) {
  .rightbar {
    display: none !important;
    width: 0 !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
}

/* =========================================================
   MAIN
   ========================================================= */
.main {
  position: fixed;
  top: 64px;
  left: 240px;
  right: 260px;
  bottom: 0;
  padding: 30px;
  overflow-y: auto;
}

/* MOBIILIS läheb paremale kuni ääreni */
@media (max-width: 1024px) {
  .main {
    right: 0 !important;
  }
}

/* =========================================================
   CARD
   ========================================================= */
.card {
  background: white;
  padding: 24px;
  margin-bottom: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* =========================================================
   HANGE KAARDID
   ========================================================= */
.hanke-item {
  display: grid;
  grid-template-columns: 110px 1fr 160px;
  gap: 20px;
  padding: 16px;
  background: white;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

@media (max-width: 600px) {
  .hanke-item {
    grid-template-columns: 90px 1fr;
    grid-template-areas:
      "photo middle"
      "right right";
  }

  .hanke-photo { grid-area: photo; }
  .hanke-middle { grid-area: middle; }
  .hanke-right { grid-area: right; text-align: left; margin-top: 10px; }
}
