/* ═══════════════════════════════════════════════════════════════════
 * DentiFlow Pro — Stylesheet principal
 * Importa tokens.css pentru culori/spacing si defineste componentele.
 * ═══════════════════════════════════════════════════════════════════ */
@import url('tokens.css');

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; color: var(--text-header); }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--brand-dark); }
img, svg { max-width: 100%; display: block; }

/* ─── Header (topbar) ─── */
.main-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-height);
  z-index: var(--z-sticky);
  display: flex;
  background: var(--bg-header);
  box-shadow: var(--shadow);
}
.logo {
  width: var(--sidebar-width);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: white;
  display: flex; align-items: center;
  padding: 0 18px;
  font-size: var(--text-xl);
  font-weight: 600;
  gap: 10px;
  letter-spacing: -0.01em;
}
.logo::before {
  content: ''; width: 10px; height: 10px; border-radius: 50%;
  background: white; box-shadow: 0 0 12px rgba(255,255,255,0.6);
}
.logo-badge {
  font-size: 10px; opacity: 0.9;
  padding: 2px 7px;
  background: rgba(255,255,255,0.18);
  border-radius: 4px;
  letter-spacing: 1px;
  font-weight: 700;
}
.navbar { flex: 1; display: flex; align-items: center; padding: 0 15px; gap: 10px; }
.sidebar-toggle {
  color: white; padding: 10px 14px; cursor: pointer;
  font-size: 16px; border-radius: var(--radius);
  transition: background var(--transition-fast);
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.1); }
.navbar-form { flex: 1; max-width: 480px; position: relative; }
.navbar-form input {
  width: 100%; padding: 9px 14px 9px 40px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.08);
  color: white;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  transition: all var(--transition-fast);
}
.navbar-form input:focus {
  outline: none;
  background: rgba(255,255,255,0.15);
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
}
.navbar-form input::placeholder { color: rgba(255,255,255,0.55); }
.navbar-form::before {
  content: '\f002'; font-family: 'Font Awesome 5 Free'; font-weight: 900;
  position: absolute; left: 14px; top: 10px;
  color: rgba(255,255,255,0.5); font-size: 13px;
}
.navbar-form .kbd {
  position: absolute; right: 12px; top: 8px;
  padding: 2px 6px; font-size: 10px; font-weight: 700;
  background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.7);
  border-radius: 4px; border: 1px solid rgba(255,255,255,0.1);
  font-family: var(--font-mono);
}
.navbar-nav {
  margin-left: auto;
  display: flex; align-items: center; gap: 4px;
  list-style: none; padding: 0; margin-top: 0; margin-bottom: 0;
}
.navbar-nav li { list-style: none; }
.navbar-nav a {
  padding: 8px 12px;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  position: relative;
  transition: all var(--transition-fast);
}
.navbar-nav a:hover { background: rgba(255,255,255,0.1); color: white; }
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger);
  position: absolute; top: 6px; right: 6px;
  box-shadow: 0 0 8px var(--danger);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.3); opacity: 0.8; } }
.user-avatar {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full);
}
.user-avatar .img {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}

/* ─── Sidebar ─── */
.main-sidebar {
  position: fixed; top: var(--header-height); left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}
.user-panel {
  padding: 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-subtle);
}
.user-panel .image {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  box-shadow: var(--shadow-brand);
}
.user-panel .info p { margin: 0; font-weight: 600; font-size: 14px; color: var(--text-header); }
.user-panel .info small {
  color: var(--text-muted); font-size: 11px;
  display: flex; align-items: center; gap: 5px; margin-top: 2px;
}
.user-panel .info small i { color: var(--success); font-size: 7px; }

.sidebar-menu { list-style: none; margin: 0; padding: 10px 10px 20px; }
.sidebar-menu > li { margin-bottom: 2px; border-radius: var(--radius-md); }
.sidebar-menu > li > a {
  padding: 10px 14px;
  display: flex; align-items: center; gap: 12px;
  color: var(--text-header);
  font-size: 14px;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-weight: 500;
  text-decoration: none;
}
.sidebar-menu > li > a:hover { background: var(--bg-hover); color: var(--brand); }
.sidebar-menu > li > a > i {
  width: 20px; text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  transition: color var(--transition-fast);
}
.sidebar-menu > li:hover > a > i { color: var(--brand); }
.sidebar-menu > li.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: var(--shadow-brand);
}
.sidebar-menu > li.active > a, .sidebar-menu > li.active > a > i { color: white; }

.sidebar-menu .treeview-menu {
  list-style: none;
  padding: 4px 0 6px 38px;
  background: var(--bg-subtle);
  margin: 4px 0 0;
  border-radius: var(--radius-md);
  display: none;
}
.sidebar-menu .treeview-menu.expanded { display: block; }
.sidebar-menu .treeview-menu > li > a {
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-muted);
  display: block;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
}
.sidebar-menu .treeview-menu > li > a:hover { color: var(--brand); background: var(--brand-subtle); }
.sidebar-menu .treeview-menu > li.active > a {
  color: var(--brand); font-weight: 700;
  background: var(--brand-subtle);
}
.sidebar-menu .pull-right {
  margin-left: auto;
  padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 700;
  background: var(--brand);
  color: white;
}
.sidebar-menu > li.active .pull-right { background: white; color: var(--brand); }
.sidebar-header {
  padding: 20px 14px 8px;
  color: var(--text-muted);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ─── Content wrapper ─── */
.content-wrapper {
  margin-top: var(--header-height);
  margin-left: var(--sidebar-width);
  padding: 24px;
  min-height: calc(100vh - var(--header-height));
  background: var(--bg-body);
}
.content-header { padding: 0 0 20px; }
.content-header h1 { font-size: 26px; font-weight: 600; margin: 0 0 6px; color: var(--text-header); letter-spacing: -0.02em; }
.content-header h1 small { font-size: 14px; color: var(--text-muted); margin-left: 12px; font-weight: 400; }
.breadcrumb { padding: 0; margin: 5px 0 0; background: transparent; font-size: 12px; color: var(--text-muted); display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { margin: 0 6px; opacity: 0.6; }
.breadcrumb .current { color: var(--text-header); font-weight: 600; }

/* ─── Info box (KPI) ─── */
.info-box {
  display: flex;
  background: var(--bg-content);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  min-height: 88px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.info-box:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.info-box-icon {
  width: 90px;
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}
.info-box-icon.info { background: linear-gradient(135deg, var(--info), #0369a1); }
.info-box-icon.warning { background: linear-gradient(135deg, var(--warning), #b45309); }
.info-box-icon.danger { background: linear-gradient(135deg, var(--danger), #b91c1c); }
.info-box-icon.purple { background: linear-gradient(135deg, var(--purple), #6d28d9); }
.info-box-icon.aqua { background: linear-gradient(135deg, var(--aqua), #0891b2); }
.info-box-content { padding: 14px 18px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.info-box-text {
  text-transform: uppercase;
  font-weight: 700; font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.info-box-number { font-size: 26px; font-weight: 700; color: var(--text-header); margin: 4px 0 6px; letter-spacing: -0.02em; }
.info-box-number small { font-size: 13px; color: var(--text-muted); font-weight: 400; }
.progress-description { font-size: 12px; color: var(--text-muted); margin: 0; font-weight: 500; }

/* ─── Box (card) ─── */
.box {
  background: var(--bg-content);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.box:hover { box-shadow: var(--shadow); }
.box.accent-green { border-top: 3px solid var(--brand); }
.box.accent-info { border-top: 3px solid var(--info); }
.box.accent-warning { border-top: 3px solid var(--warning); }
.box.accent-danger { border-top: 3px solid var(--danger); }
.box.accent-purple { border-top: 3px solid var(--purple); }
.box.accent-primary { border-top: 3px solid var(--brand); }
.box.box-solid-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: white;
  border: 0;
}
.box.box-solid-primary .box-title, .box.box-solid-primary .box-title i { color: white; }
.box-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.box-header .box-title {
  font-size: 15px; font-weight: 700; margin: 0;
  color: var(--text-header);
  display: flex; align-items: center; gap: 8px;
}
.box-header .box-title i { color: var(--brand); font-size: 14px; }
.box-tools { display: flex; gap: 6px; }
.box-body { padding: 18px; }
.box-footer { padding: 14px 20px; background: var(--bg-subtle); border-top: 1px solid var(--border); }

/* ─── Tables ─── */
.istoma-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.istoma-table thead { background: var(--bg-subtle); }
.istoma-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700; color: var(--text-muted);
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.istoma-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.istoma-table tbody tr { transition: background var(--transition-fast); }
.istoma-table tbody tr:hover td { background: var(--bg-subtle); }
.istoma-table tbody tr:last-child td { border-bottom: 0; }
.istoma-table tr.selected td { background: var(--brand-subtle); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  font-size: 13px; font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  background: white;
  color: var(--text);
  transition: all var(--transition-fast);
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: white;
  box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(16,185,129,0.35); color: white; }
.btn-default { background: var(--bg-content); color: var(--text); border-color: var(--border); }
.btn-default:hover { background: var(--bg-subtle); color: var(--brand); }
.btn-info { background: var(--info); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-ghost { background: transparent; color: var(--text); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 4px; gap: 3px; }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: 10px; }

/* ─── Labels / Badges ─── */
.label {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 10px; font-size: 11px; font-weight: 700;
  color: white; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.label-primary, .label-success { background: var(--brand); }
.label-info { background: var(--info); }
.label-warning { background: var(--warning); }
.label-danger { background: var(--danger); }
.label-purple { background: var(--purple); }
.label-default { background: #94a3b8; }

/* ─── Nav tabs ─── */
.nav-tabs-custom {
  background: var(--bg-content);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.nav-tabs-custom > .nav-tabs {
  margin: 0; display: flex;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  padding: 0 6px;
  overflow-x: auto;
  list-style: none;
}
.nav-tabs-custom > .nav-tabs > li { list-style: none; }
.nav-tabs-custom > .nav-tabs > li > a {
  padding: 12px 18px;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  display: flex; align-items: center; gap: 6px;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--transition-fast);
}
.nav-tabs-custom > .nav-tabs > li > a:hover { color: var(--text-header); background: var(--brand-subtle); }
.nav-tabs-custom > .nav-tabs > li.active > a {
  color: var(--brand); background: var(--bg-content);
  border-bottom-color: var(--brand);
}
.nav-tabs-custom > .tab-content { padding: 20px; }

/* ─── Progress ─── */
.progress { height: 12px; background: var(--border-light); border-radius: 10px; overflow: hidden; }
.progress-bar {
  background: linear-gradient(90deg, var(--brand), var(--brand-light));
  color: white;
  font-size: 10px;
  line-height: 12px;
  text-align: center;
  font-weight: 700;
  transition: width var(--transition-slow);
}
.progress-bar.info { background: linear-gradient(90deg, var(--info), #38bdf8); }
.progress-bar.warning { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.progress-bar.danger { background: linear-gradient(90deg, var(--danger), #f87171); }
.progress-bar.purple { background: linear-gradient(90deg, var(--purple), #a78bfa); }

/* ─── Pill Da/Nu (toggle boolean) ─── */
.pill-yn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  background: var(--border-light);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  user-select: none;
}
.pill-yn:hover { border-color: var(--text-muted); }
.pill-yn.yes.active { background: var(--brand); color: white; border-color: var(--brand); box-shadow: 0 3px 10px rgba(16,185,129,0.35); }
.pill-yn.no.active { background: var(--danger); color: white; border-color: var(--danger); box-shadow: 0 3px 10px rgba(220,38,38,0.35); }

/* ─── Period selector (filter bar) ─── */
.period-selector {
  background: var(--bg-content);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.period-selector .active-date { font-weight: 700; color: var(--brand); font-size: 14px; }

/* ─── Grid (12 cols) ─── */
.row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12 { padding: 0 8px; }
.col-2 { flex: 0 0 16.66%; max-width: 16.66%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.33%; max-width: 33.33%; }
.col-5 { flex: 0 0 41.66%; max-width: 41.66%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.33%; max-width: 58.33%; }
.col-8 { flex: 0 0 66.66%; max-width: 66.66%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* ─── Forms ─── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-content);
  color: var(--text);
  transition: all var(--transition-fast);
}
.form-control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-subtle);
}
.form-control:disabled { background: var(--bg-subtle); color: var(--text-muted); cursor: not-allowed; }
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px var(--danger-subtle); }
.form-help { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--danger); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2364748b' d='M5 6L0 0h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 32px; }
textarea.form-control { min-height: 90px; resize: vertical; font-family: inherit; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); cursor: pointer; }

/* Switch toggle */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--border-strong); border-radius: 24px; transition: background var(--transition-fast); }
.switch .slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: transform var(--transition-fast); box-shadow: var(--shadow-xs); }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ─── Modal ─── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.55);
  z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  padding: 24px;
}
.modal {
  background: var(--bg-content);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 560px; width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  border: 1px solid var(--border);
}
.modal-lg { max-width: 820px; }
.modal-xl { max-width: 1100px; }
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; background: var(--bg-content); z-index: 2;
}
.modal-header h3 { font-size: 17px; font-weight: 700; color: var(--text-header); }
.modal-header .close { background: transparent; border: 0; font-size: 22px; color: var(--text-muted); cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); line-height: 1; }
.modal-header .close:hover { background: var(--bg-hover); color: var(--text-header); }
.modal-body { padding: 22px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 8px; background: var(--bg-subtle); }

/* ─── Drawer (side panel) ─── */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.45); z-index: var(--z-modal); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 92vw;
  background: var(--bg-content);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-modal);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
}
.drawer.open { transform: translateX(0); }
.drawer-header { padding: 18px 22px; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; }
.drawer-body { padding: 20px 22px; flex: 1; overflow-y: auto; }
.drawer-footer { padding: 14px 22px; border-top: 1px solid var(--border-light); background: var(--bg-subtle); display: flex; gap: 8px; justify-content: flex-end; }

/* ─── Toast ─── */
.toast-container {
  position: fixed; top: 72px; right: 20px;
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 8px;
  max-width: 380px;
  pointer-events: none;
}
.toast {
  background: var(--bg-content);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-md);
  display: flex; align-items: flex-start; gap: 10px;
  pointer-events: auto;
  animation: toastSlide 300ms ease;
  font-size: 13px;
}
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-info { border-left-color: var(--info); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-error { border-left-color: var(--danger); }
.toast-icon { font-size: 18px; line-height: 1.2; flex-shrink: 0; }
.toast.toast-success .toast-icon { color: var(--success); }
.toast.toast-info .toast-icon { color: var(--info); }
.toast.toast-warning .toast-icon { color: var(--warning); }
.toast.toast-error .toast-icon { color: var(--danger); }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 700; color: var(--text-header); margin-bottom: 2px; }
.toast-message { color: var(--text-muted); line-height: 1.4; }
.toast-close { background: transparent; border: 0; color: var(--text-muted); cursor: pointer; padding: 0 4px; font-size: 18px; line-height: 1; }
@keyframes toastSlide {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ─── Dropdown ─── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: 100%; right: 0;
  min-width: 200px;
  background: var(--bg-content);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: var(--z-dropdown);
  padding: 6px;
  margin-top: 6px;
}
.dropdown-menu .dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast);
}
.dropdown-menu .dropdown-item:hover { background: var(--bg-hover); color: var(--brand); }
.dropdown-menu .dropdown-item.danger { color: var(--danger); }
.dropdown-menu .dropdown-item.danger:hover { background: var(--danger-subtle); }
.dropdown-divider { border-top: 1px solid var(--border-light); margin: 6px 0; }

/* ─── Empty state ─── */
.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; color: var(--text-muted); }
.empty-state h3 { font-size: 16px; color: var(--text-header); margin: 0 0 6px; }
.empty-state p { font-size: 13px; max-width: 360px; margin: 0 auto 16px; }

/* ─── Skeleton loaders ─── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 0%, var(--border-light) 50%, var(--bg-hover) 100%);
  background-size: 200% 100%;
  animation: skeleton 1.2s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.sm { height: 10px; }
.skeleton-text.lg { height: 18px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }

/* ─── Chip / Tag ─── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--brand-subtle);
  color: var(--brand-dark);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}
.chip.gray { background: var(--bg-hover); color: var(--text-muted); }
.chip .chip-close { cursor: pointer; font-size: 14px; line-height: 1; opacity: 0.6; }
.chip .chip-close:hover { opacity: 1; }

/* ─── Avatar ─── */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: white; font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 80px; height: 80px; font-size: 26px; border-radius: var(--radius-lg); }

/* ─── Token (cod SMS) ─── */
.token {
  background: var(--brand-subtle);
  color: var(--brand-dark);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

/* ─── Utility ─── */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-brand { color: var(--brand); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-bold { font-weight: 700; }
.hidden { display: none !important; }
code { background: var(--bg-subtle); padding: 2px 6px; border-radius: 4px; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
kbd { background: var(--bg-subtle); padding: 2px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; font-size: 11px; font-family: var(--font-mono); color: var(--text); }

/* ─── Accessibility helpers ─── */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute; top: -50px; left: 12px;
  background: var(--brand); color: white;
  padding: 10px 18px; border-radius: var(--radius);
  z-index: 10000;
  text-decoration: none;
  font-weight: 600;
  transition: top var(--transition);
}
.skip-link:focus { top: 12px; color: white; }

/* Fullwidth wrapper (pentru login, 404, etc. fara sidebar) */
.content-wrapper-fullwidth { margin: 0 !important; padding: 0 !important; min-height: 100vh; }

/* Touch targets (min 40×40 pe dispozitive touch) */
@media (pointer: coarse) {
  .btn { min-height: 40px; }
  .btn-xs { min-height: 32px; padding: 6px 10px; }
  .btn-sm { min-height: 36px; }
  .dropdown-item { min-height: 40px; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
}

/* Reduce motion (prefers-reduced-motion) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .notif-dot { animation: none !important; }
}

/* ─── Responsive ─── */
@media (max-width: 991px) {
  .main-sidebar { transform: translateX(-100%); transition: transform var(--transition-slow); }
  .main-sidebar.open { transform: translateX(0); }
  .content-wrapper { margin-left: 0; padding: 16px; }
  .logo { width: 180px; }
  .row { margin: 0 -4px; }
  .col-3, .col-4, .col-6, .col-8 { flex: 0 0 100%; max-width: 100%; padding: 0 4px; }
}
@media (max-width: 640px) {
  .content-header h1 { font-size: 20px; }
  .navbar-form { max-width: 220px; }
  .navbar-nav .user-avatar span:not(.img) { display: none; }
}

/* ─── Print ─── */
@media print {
  .main-header,
  .main-sidebar,
  .period-selector,
  .box-tools,
  .btn,
  .toast-container,
  .modal-backdrop,
  .skip-link,
  .sidebar-toggle,
  .no-print { display: none !important; }

  .content-wrapper { margin: 0 !important; padding: 0 !important; }
  .content-header h1 { font-size: 18pt; color: #000 !important; }
  body { background: white !important; color: #000 !important; font-size: 11pt; }
  .box { box-shadow: none !important; border: 1px solid #ccc !important; page-break-inside: avoid; margin-bottom: 10pt; }
  .istoma-table { font-size: 10pt; }
  .istoma-table th, .istoma-table td { padding: 6pt 8pt; }
  a { color: #000 !important; text-decoration: none !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #666; }
  .page-break-before { page-break-before: always; }
  .page-break-after { page-break-after: always; }
  .print-only { display: block !important; }
  .info-box:hover { transform: none !important; }
}
.print-only { display: none; }
