:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --accent: #22c55e;
    --danger: #ef4444;
    --bg: #f9fafb;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    --radius: 12px;
}

body {
    background-color: var(--bg);
    font-family: "Inter", "Segoe UI", sans-serif;
    color: var(--text-dark);
}

button {
    margin-top: 10px;
}

.consultare-item {
    border: 1px solid #ccc;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.consultare-item h3 {
    margin-top: 0;
}

.chart-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 10px;
}

.functionar-dashboard {
    display: flex;
    gap: 24px;
    padding: 30px;
    align-items: flex-start;
}

/* SIDEBAR DESKTOP */
.sidebar-desktop {
    width: 280px;
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.sidebar-desktop h2 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    font-weight: 600;
}

#consultare-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

#consultare-list li {
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #f1f5f9;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: 1px solid #e2e8f0;
}

#consultare-list li:hover {
    background: #e2e8f0;
}

#consultare-list li.active {
    background: var(--gradient);
    color: white;
    font-weight: 600;
}

#consultare-list li strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
}

#consultare-list li small {
    font-size: 0.85rem;
    color: inherit;
}

.btn-add {
    margin-top: 20px;
    padding: 12px;
    text-align: center;
    background: var(--gradient);
    color: white;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
}

.btn-add:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
}

.consultare-content {
    flex: 1;
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.consultare-panel {
    display: none;
}

.consultare-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.consultare-panel h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.consultare-panel em {
    display: block;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-style: normal;
}

.consultare-panel > div {
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.6;
}

canvas {
    margin-top: 30px;
    max-width: 100%;
}

.consultare-actions {
    margin-top: 30px;
    display: flex;
    gap: 12px;
}

.consultare-actions .edit,
.consultare-actions .delete {
    text-decoration: none;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.consultare-actions .edit {
    background: #ecf3ff;
    color: var(--primary);
    border: 1px solid var(--primary-light);
}

.consultare-actions .edit:hover {
    background: #dbeafe;
}

.consultare-actions .delete {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.consultare-actions .delete:hover {
    background: #fee2e2;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-menu{
  position: absolute;
  top: 3px;
  right: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  z-index: 1000; /* peste layout */
}

/* imaginea avatar în cerc */
.user-menu .user-avatar img{
  border-radius: 50% !important;
  width: 40px;
  height: 40px;
  display: block;
}

/* dropdown-ul ascuns implicit */
.user-dropdown{
  position: absolute;
  top: 32px;   /* sub avatar */
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
  border-radius: 12px;
  padding: 8px;
  display: none;
}

/* link-urile din dropdown */
.user-dropdown a{
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #111;
  font-weight: 500;
}
.user-dropdown a:hover{ background: #f4f6f8; }

/* arată dropdown-ul la hover sau focus (tastatură/tap) */
.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown{
  display: block;
}

/* ----- RESPONSIVE: Mobil ----- */
.sidebar-mobile {
    display: none;
}

@media (max-width: 768px) {
    .functionar-dashboard {
        flex-direction: column;
        padding: 20px;
        gap: 24px;
    }

    .sidebar-desktop {
        display: none;
    }

    .sidebar-mobile {
        display: block;
        margin-top: 30px;
        background: white;
        border-radius: var(--radius);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        padding: 20px;
    }

    .sidebar-mobile ul {
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .sidebar-mobile li {
        background: #f1f5f9;
        margin-bottom: 12px;
        padding: 14px 16px;
        border-radius: var(--radius);
        cursor: pointer;
        border: 1px solid #e2e8f0;
        transition: background 0.2s ease;
    }

    .sidebar-mobile li:hover {
        background: #e2e8f0;
    }

    .sidebar-mobile li.active {
        background: var(--gradient);
        color: white;
        font-weight: 600;
    }

    .sidebar-mobile li strong {
        display: block;
        font-size: 1rem;
        margin-bottom: 4px;
    }

    .sidebar-mobile li small {
        font-size: 0.85rem;
        color: inherit;
    }

    .sidebar-mobile .btn-add {
        display: block;
        margin-top: 10px;
        text-align: center;
        background: var(--gradient);
        color: white;
        padding: 12px;
        border-radius: var(--radius);
        text-decoration: none;
        font-weight: 600;
    }

    .sidebar-mobile .btn-add:hover {
        background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    }
}
