/* ============================================================
   Portal Inginerie Creativă — Styles
   Brand: #FFCB09 (amber), #221F1F (nero), white background
   Font: Barlow (Google Fonts)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #FFCB09;
  --brand-dark: #e6b800;
  --brand-light: #fff8d6;
  --nero: #221F1F;
  --sidebar-bg: #1a1a1a;
  --sidebar-hover: #2a2a2a;
  --sidebar-active: #2d2d2d;
  --sidebar-text: rgba(255,255,255,0.75);
  --sidebar-text-muted: rgba(255,255,255,0.4);
  --sidebar-border: rgba(255,255,255,0.08);
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-2: #f9f9f9;
  --border: #e5e5e5;
  --border-strong: #d0d0d0;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --primary: #FFCB09;
  --primary-fg: #221F1F;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 2px 8px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --sidebar-width: 240px;
  --sidebar-collapsed: 56px;
  --topbar-height: 52px;
  --transition: 0.18s ease;
}

html, body {
  height: 100%;
  font-family: 'Barlow', 'Calibri', 'Arial', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* ============================================================
   AUTH PAGE
   ============================================================ */
.auth-bg {
  background: #0f1929;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-page {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px 28px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.auth-title {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--nero);
  margin-bottom: 4px;
}

.auth-subtitle {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.auth-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  transition: var(--transition);
}

.auth-tab.active {
  background: var(--brand);
  color: var(--nero);
  font-weight: 600;
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.form-input {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition);
  outline: none;
}

.form-input:focus { border-color: var(--brand); }

.form-input.error { border-color: var(--danger); }

.auth-error {
  font-size: 12px;
  color: var(--danger);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 8px 10px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--text-light);
  font-size: 12px;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-links {
  text-align: center;
  margin-top: 14px;
}

.auth-link {
  font-size: 12px;
  color: var(--brand-dark);
  font-weight: 500;
}

.auth-link:hover { text-decoration: underline; }

/* ── BUTTONS ── */
.btn-primary {
  padding: 9px 16px;
  background: var(--info);
  color: #fff;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition), transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary:hover { background: #2563eb; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-brand {
  padding: 8px 16px;
  background: var(--brand);
  color: var(--nero);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition), transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-brand:hover { background: var(--brand-dark); }
.btn-brand:active { transform: scale(0.98); }
.btn-brand:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  padding: 8px 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary:hover { background: var(--surface-2); }

.btn-danger {
  padding: 8px 16px;
  background: var(--danger);
  color: #fff;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition);
}

.btn-danger:hover { background: #dc2626; }

.btn-google {
  padding: 9px 16px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--transition);
  width: 100%;
}

.btn-google:hover { background: #f9fafb; }

.btn-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.btn-icon:hover { background: var(--surface-2); color: var(--text); }

.w-full { width: 100%; }

/* ============================================================
   LAYOUT
   ============================================================ */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow: hidden;
  transition: width var(--transition);
  position: relative;
  z-index: 100;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 14px 14px;
  border-bottom: 1px solid var(--sidebar-border);
  min-height: 56px;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.sidebar-brand {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.sidebar.collapsed .sidebar-brand { opacity: 0; width: 0; overflow: hidden; }

.sidebar-toggle {
  color: var(--sidebar-text-muted);
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color var(--transition), transform var(--transition);
}

.sidebar-toggle:hover { color: #fff; }
.sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}

.nav-section {
  margin-bottom: 4px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--sidebar-text-muted);
  padding: 10px 16px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}

.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 14px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 400;
  border-radius: 6px;
  margin: 1px 6px;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover { background: var(--sidebar-hover); color: #fff; }

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--brand);
  font-weight: 500;
}

.nav-item.active .nav-icon { color: var(--brand); }

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
}

.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 8px; margin: 1px 4px; }
.sidebar.collapsed .nav-section-label { display: none; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--nero);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-user-info { flex: 1; min-width: 0; overflow: hidden; }

.sidebar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--sidebar-text-muted);
  white-space: nowrap;
}

.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-logout { display: none; }

.sidebar-logout {
  color: var(--sidebar-text-muted);
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color var(--transition);
}

.sidebar-logout:hover { color: var(--danger); }

/* ── MAIN WRAPPER ── */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.mobile-menu-btn {
  display: none;
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-btn {
  position: relative;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.topbar-btn:hover { background: var(--surface-2); color: var(--text); }

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: var(--brand);
  color: var(--nero);
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--nero);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity var(--transition);
}

.topbar-avatar:hover { opacity: 0.85; }
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Timer widget */
.timer-widget {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 20px;
  padding: 4px 10px 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
}

.timer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.timer-stop {
  color: var(--danger);
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 3px;
  transition: background var(--transition);
}

.timer-stop:hover { background: #fee2e2; }

/* ── PAGE CONTENT ── */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg);
}

/* ============================================================
   COMMON COMPONENTS
   ============================================================ */

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.card-body { padding: 16px; }

/* Metric cards */
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.metric-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.metric-sub {
  font-size: 11px;
  color: var(--text-light);
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f3f4f6; color: #374151; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }
.badge-orange { background: #ffedd5; color: #9a3412; }

/* Progress bar */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--brand);
  transition: width 0.4s ease;
}

.progress-fill.danger { background: var(--danger); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.success { background: var(--success); }

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

/* Form elements */
.input {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}

.input:focus { border-color: var(--brand); }

/* Format dată dd/mm/yyyy pentru toate input-urile de tip date */
input[type="date"] {
  -webkit-text-size-adjust: 100%;
}
input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  direction: ltr;
}
/* Forcăm locale ro-RO prin lang pe html */

.select {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  background: #fff;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.select:focus { border-color: var(--brand); }

.textarea {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  background: #fff;
  outline: none;
  resize: vertical;
  min-height: 80px;
  width: 100%;
  transition: border-color var(--transition);
}

.textarea:focus { border-color: var(--brand); }

.label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}

.form-row {
  display: grid;
  gap: 12px;
}

.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Search bar */
.search-bar {
  position: relative;
}

.search-bar svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-bar input {
  padding-left: 34px;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 0;
  margin-bottom: 16px;
}

.tab-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--brand); font-weight: 600; }

/* Avatar */
.avatar {
  border-radius: 50%;
  background: var(--brand);
  color: var(--nero);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 72px; height: 72px; font-size: 22px; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  color: var(--text-light);
}

.empty-state p { font-size: 13px; }

/* Loading */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--nero);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: slideIn 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--nero); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.15s ease;
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
}

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: background var(--transition);
}

.modal-close:hover { background: var(--surface-2); color: var(--text); }

.modal-body { padding: 20px; }

.modal-footer {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============================================================
   DASHBOARD PAGE
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-main {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 12px;
}

.dashboard-left { display: flex; flex-direction: column; gap: 12px; }
.dashboard-right { display: flex; flex-direction: column; gap: 12px; }

/* ============================================================
   TIME TRACKING
   ============================================================ */
.tt-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 12px;
  height: calc(100vh - var(--topbar-height) - 32px);
}

.tt-calendar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tt-calendar-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.tt-week-grid {
  display: grid;
  grid-template-columns: 52px repeat(7, 1fr);
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.tt-time-col {
  border-right: 1px solid var(--border);
  background: var(--surface-2);
}

.tt-hour-label {
  height: 48px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 2px 6px 0 0;
  font-size: 10px;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
}

.tt-day-col {
  border-right: 1px solid var(--border);
  position: relative;
}

.tt-day-col:last-child { border-right: none; }

.tt-day-header {
  padding: 6px 4px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 1;
}

.tt-day-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.tt-day-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.tt-day-col.today .tt-day-num {
  background: var(--brand);
  color: var(--nero);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tt-hour-cell {
  height: 48px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.tt-hour-cell:hover { background: rgba(255,203,9,0.04); }

.tt-entry {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 600;
  overflow: hidden;
  cursor: pointer;
  z-index: 2;
  transition: opacity var(--transition);
}

.tt-entry:hover { opacity: 0.85; }

.tt-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================================
   PROJECTS
   ============================================================ */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.project-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.project-emoji {
  font-size: 24px;
  margin-bottom: 8px;
}

.project-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.project-client {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ============================================================
   GANTT / PROCESS OVERVIEW
   ============================================================ */
.gantt-container {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.gantt-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 2;
}

.gantt-label-col {
  width: 220px;
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
}

.gantt-dates {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.gantt-date-cell {
  flex: 1;
  min-width: 32px;
  padding: 6px 4px;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
}

.gantt-date-cell.today { background: rgba(255,203,9,0.12); color: var(--nero); font-weight: 700; }

.gantt-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  min-height: 36px;
}

.gantt-row:hover { background: var(--surface-2); }

.gantt-row-label {
  width: 220px;
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.gantt-row-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-bars {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.gantt-bar {
  position: absolute;
  height: 20px;
  border-radius: 4px;
  background: var(--brand);
  opacity: 0.85;
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--nero);
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity var(--transition);
}

.gantt-bar:hover { opacity: 1; }

/* ============================================================
   CALENDAR (mini)
   ============================================================ */
.mini-cal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.mini-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mini-cal-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.mini-cal-nav {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--text-muted);
  transition: background var(--transition);
}

.mini-cal-nav:hover { background: var(--surface-2); color: var(--text); }

.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.mini-cal-day-name {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 0;
}

.mini-cal-day {
  text-align: center;
  font-size: 12px;
  padding: 4px 2px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text);
  transition: background var(--transition);
  position: relative;
}

.mini-cal-day:hover { background: var(--surface-2); }
.mini-cal-day.today { background: var(--brand); color: var(--nero); font-weight: 700; border-radius: 50%; }
.mini-cal-day.selected { background: var(--brand-light); color: var(--nero); font-weight: 600; }
.mini-cal-day.other-month { color: var(--text-light); }
.mini-cal-day.has-event::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand);
}

/* ============================================================
   NEWS
   ============================================================ */
.news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow var(--transition);
}

.news-card:hover { box-shadow: var(--shadow); }

.news-card.pinned {
  border-left: 3px solid var(--brand);
}

.news-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.news-excerpt {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-light);
}

/* ============================================================
   DOCUMENTS
   ============================================================ */
.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.doc-item:hover { background: var(--surface-2); }
.doc-item:last-child { border-bottom: none; }

.doc-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: #fee2e2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
}

.doc-icon.pdf { background: #fee2e2; color: #dc2626; }
.doc-icon.doc { background: #dbeafe; color: #1d4ed8; }
.doc-icon.xls { background: #dcfce7; color: #15803d; }
.doc-icon.other { background: #f3f4f6; color: #6b7280; }

.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* PDF Viewer inline */
.pdf-viewer {
  width: 100%;
  height: 75vh;
  border: none;
  border-radius: var(--radius);
}

/* ============================================================
   PROPOSALS
   ============================================================ */
.proposal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: box-shadow var(--transition);
}

.proposal-card:hover { box-shadow: var(--shadow); }

.proposal-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.proposal-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.vote-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.vote-progress {
  flex: 1;
  height: 6px;
  background: #fee2e2;
  border-radius: 3px;
  overflow: hidden;
}

.vote-fill {
  height: 100%;
  background: var(--success);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ============================================================
   ORGANIGRAMA
   ============================================================ */
.org-tree {
  overflow-x: auto;
  padding: 20px;
}

.org-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.org-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  text-align: center;
  min-width: 140px;
  cursor: pointer;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.org-card:hover { box-shadow: var(--shadow); border-color: var(--brand); }
.org-card.top { border-top: 3px solid var(--brand); }

/* ============================================================
   PROFIL
   ============================================================ */
.profile-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-main { grid-template-columns: 1fr; }
  .tt-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -100%;
    z-index: 200;
    transition: left var(--transition);
  }
  .sidebar.mobile-open { left: 0; }
  .mobile-menu-btn { display: flex; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .page-content { padding: 12px; }
  .auth-card { padding: 24px 20px; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.border { border: 1px solid var(--border); }
.bg-surface { background: var(--surface); }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.hidden { display: none !important; }
.text-brand { color: var(--brand-dark); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-center { text-align: center; }
.w-full { width: 100%; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.cursor-pointer { cursor: pointer; }

/* ============================================================
   PROCESS OVERVIEW — GANTT STYLES (new)
   ============================================================ */
.gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.gantt-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.gantt-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.gantt-container {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - var(--topbar-height) - 200px);
}

.gantt-header-row {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface-2);
  border-bottom: 2px solid var(--border);
}

.gantt-header-label {
  flex-shrink: 0;
  padding: 0 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  padding-bottom: 6px;
}

.gantt-header-timeline {
  overflow: hidden;
  flex-shrink: 0;
}

.gantt-months {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.gantt-month-cell {
  flex-shrink: 0;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
}

.gantt-days {
  display: flex;
}

.gantt-day-cell {
  flex-shrink: 0;
  width: 28px;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  padding: 3px 0;
  border-right: 1px solid var(--border);
}

.gantt-day-cell.today {
  background: rgba(255,203,9,0.2);
  color: var(--nero);
  font-weight: 700;
}

.gantt-day-cell.weekend {
  background: rgba(0,0,0,0.03);
  color: var(--text-light);
}

.gantt-body {}

.gantt-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  min-height: 40px;
}

.gantt-row:hover { background: rgba(255,203,9,0.03); }

.gantt-row.dept-row {
  background: var(--surface-2);
  min-height: 32px;
}

.gantt-label {
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  overflow: hidden;
}

.gantt-label.dept-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.gantt-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--nero);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gantt-user-info { min-width: 0; }

.gantt-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-user-pos {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-cells {
  flex-shrink: 0;
  position: relative;
  height: 40px;
}

.gantt-row.dept-row .gantt-cells { height: 32px; }

.gantt-weekend-shade {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(0,0,0,0.03);
  pointer-events: none;
}

.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255,203,9,0.7);
  pointer-events: none;
  z-index: 3;
}

.gantt-bar {
  position: absolute;
  height: 22px;
  top: 9px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  z-index: 2;
  transition: opacity var(--transition), filter var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.gantt-bar:hover { opacity: 0.9; filter: brightness(1.05); }

/* p-6 utility used in profil.js */
.p-6 { padding: 24px; }
.p-5 { padding: 20px; }

/* ============================================================
   PROIECTE MODULE — clase adăugate
   ============================================================ */

/* Alias variabile pentru compatibilitate cu noul modul Proiecte */
:root {
  --card-bg: var(--surface);
  --bg-secondary: var(--surface-2);
  --border-light: var(--border);
  --primary-light: rgba(59, 130, 246, 0.12);
}

/* Butoane filtru (pills) */
.btn-filter {
  padding: 6px 14px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-filter:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-filter.active {
  background: var(--info);
  color: #fff;
  border-color: var(--info);
}

/* Buton mic */
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* Project card hover */
.project-card:hover {
  box-shadow: var(--shadow);
}

/* ============================================================
   Regulament Intern — Markdown viewer styles
   ============================================================ */
.regulament-content { color: var(--text); line-height: 1.75; font-size: 14px; }
.regulament-content h1 { font-size: 22px; font-weight: 800; margin: 0 0 20px; color: var(--text); border-bottom: 2px solid var(--brand); padding-bottom: 10px; }
.regulament-content h2 { font-size: 17px; font-weight: 700; margin: 28px 0 10px; color: var(--text); padding-left: 10px; border-left: 3px solid var(--brand); }
.regulament-content h3 { font-size: 15px; font-weight: 700; margin: 20px 0 8px; color: var(--text); }
.regulament-content h4, .regulament-content h5, .regulament-content h6 { font-size: 14px; font-weight: 700; margin: 16px 0 6px; color: var(--text); }
.regulament-content p { margin: 0 0 14px; }
.regulament-content ul, .regulament-content ol { margin: 0 0 14px; padding-left: 24px; }
.regulament-content li { margin-bottom: 5px; }
.regulament-content ul li { list-style: disc; }
.regulament-content ol li { list-style: decimal; }
.regulament-content strong { font-weight: 700; color: var(--text); }
.regulament-content em { font-style: italic; }
.regulament-content code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px; font-family: 'Courier New', monospace; font-size: 12px; color: var(--text); }
.regulament-content hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
