/* ==========================================================
   ROOT THEME
========================================================== */
:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --line: #e6e9f0;
  --text: #253044;
  --muted: #5b6b84;

  --accent: #1f8fff;
  --accent-2: #2cc197;

  --brand: #0b6ef0;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --card-bg: #ffffff; /* default */
}

/* ==========================================================
   GLOBAL
========================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  max-width: 100%;
  overflow-x: hidden; /* prevenim orice overflow orizontal */
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
}

a {
  color: inherit;
}
.brandword {
  color: var(--brand);
}

/* ==========================================================
   HEADER — DESKTOP
========================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 24px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}

/* left */
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  height: 100px;
  width: auto;
}

/* mobile button */
.mobile-menu-btn {
  display: none;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
}

/* center nav */
.top-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
}

.top-nav > a,
.drop-btn {
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.top-nav > a:hover,
.drop-btn:hover {
  color: var(--brand);
}

/* dropdown */
.dropdown {
  position: relative;
}

.dropdown-content {
  position: absolute;
  top: 120%;
  left: 0;
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px 0;
  display: none;
  z-index: 1200;
}

.dropdown-content a {
  display: block;
  padding: 8px 12px;
  font-size: 0.9rem;
  text-decoration: none;
}

.dropdown-content a:hover {
  background: #eef4ff;
  color: var(--brand);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* right */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* search */
.header-search {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-input {
  width: 180px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}

.search-input:focus {
  border-color: var(--brand);
}

.search-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* clock */
.header-clock {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

/* user pill */
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #eef4ff;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.user-pill i {
  color: var(--brand);
}

/* ==========================================================
   LAYOUT
========================================================== */
.site {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 16px 40px;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 16px;
}

/* ==========================================================
   SIDEBAR — DESKTOP (default)
========================================================== */
.sidebar {
  width: 230px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  z-index: 10;
}

.side-menu {
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 4px;
}

.side-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}

.side-menu a i {
  width: 18px;
  text-align: center;
  color: #64748b;
}

.side-menu a:hover {
  background: #eef4ff;
}

.side-menu a.active {
  background: linear-gradient(90deg, #e6f0ff, #e6fff7);
  border: 1px solid #cbdfff;
}

/* overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 900;
}

/* ==========================================================
   MAIN CONTENT
========================================================== */
.main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* ==========================================================
   FOOTER
========================================================== */
.footer {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 18px 10px 24px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ==========================================================
   RESPONSIVE — HEADER + LAYOUT (max-width: 900px)
========================================================== */
@media (max-width: 900px) {
  /* header devine fix */
  .header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
  }

  .header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 8px 10px;
  }

  .logo-img {
    height: 40px;
    width: auto;
    max-width: 100%;
  }

  .top-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  /* pe mobil/tablet păstrăm header foarte simplu */
  .header-search,
  .header-clock,
  .user-pill {
    display: none;
  }

  /* layout împins sub header + 1 coloană */
  .site {
    padding-top: 80px;
    grid-template-columns: 1fr;
    padding-inline: 10px;
  }
}

/* ==========================================================
   RESPONSIVE — SIDEBAR & MOBILE NAV (max-width: 768px)
========================================================== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 80px;
    left: -260px;
    width: 240px;
    height: calc(100vh - 80px);
    max-height: none;
    border-radius: 0 16px 16px 0;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    overflow-y: auto;
    transition: left 0.25s ease;
    z-index: 9999;
  }

  body.sidebar-open .sidebar {
    left: 0;
  }

  .sidebar-overlay {
    opacity: 0;
    pointer-events: none;
  }

  body.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ===========================
   MOBILE MENU INSIDE SIDEBAR
=========================== */
@media (max-width: 768px) {
  .mobile-nav-section {
    padding: 10px 10px 14px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
  }

  .mobile-nav-section a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    color: var(--text);
  }

  .mobile-nav-section a:hover {
    background: #eef4ff;
  }
}

@media (min-width: 769px) {
  .mobile-nav-section {
    display: none;
  }
}

/* =============================================
   HEADER SIMPLIFICAT PE ECRANE MICI
   - rămân doar logo + ceas
============================================= */
@media (max-width: 900px) {
  .header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
  }

  .header-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
  }

  .logo-img {
    height: 40px;
    width: auto;
    max-width: 100%;
  }

  .top-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  /* 🔒 user pill ascuns pe mobil/tablet */
  .user-pill {
    display: none !important;
  }

  /* layout 1 coloană sub header */
  .site {
    padding-top: 80px;
    grid-template-columns: 1fr;
    padding-inline: 10px;
  }
}

.user-pill-mobile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: #eef4ff;
  font-size: 0.9rem;
}
/* User pill doar pe desktop (în header) */
.user-pill-desktop {
  display: flex;
}

/* Sub 900px îl ascundem complet din header */
@media (max-width: 900px) {
  .user-pill-desktop {
    display: none !important;
  }
}