/* Licențe EAM - Modern glass UX foundation */
:root {
  --bg-page: #ffffff;
  --bg-card: #ffffff;
  --bg-card-solid: #ffffff;
  --bg-glass: #ffffff;
  --primary: rgb(4, 92, 140);
  --primary-hover: rgb(3, 78, 118);
  --primary-light: rgba(4, 92, 140, 0.12);
  --accent: rgb(4, 92, 140);
  --text: #102a43;
  --text-muted: #486581;
  --border: #d9e2ec;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px -4px rgb(16 42 67 / 0.22);
  --shadow-lg: 0 10px 28px -14px rgb(16 42 67 / 0.3);
  --focus-ring: 0 0 0 3px rgba(4, 92, 140, 0.22);
  --status-pending-bg: #fef3c7;
  --status-accepted-bg: #d1fae5;
  --status-rejected-bg: #fee2e2;
}

* { box-sizing: border-box; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }

/* Shared top shell */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 0.75rem 0;
}
.app-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.app-header .brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.app-header .nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.app-header .nav-links > a,
.app-header .nav-links > button,
.app-header .nav-links > span,
.app-header .nav-links > .notif-wrap > button {
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  border: none;
  background: transparent;
}
.app-header .nav-links > a:hover,
.app-header .nav-links > button:hover,
.app-header .nav-links > .notif-wrap > button:hover,
.app-header .nav-links > .active {
  background: var(--primary-light);
  color: var(--primary);
}
.app-header .nav-links .user-info {
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid #e4ebf3;
  border-radius: 999px;
  background: #f8fafc;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 0.82rem;
  flex: 0 0 32px;
  border: 1px solid #bfdbfe;
}
.user-meta {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
}
.user-meta-name {
  font-size: 0.78rem;
  color: #102a43;
  font-weight: 600;
}
.user-meta-role {
  font-size: 0.68rem;
  color: #486581;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
  background: #fff;
}
.profile-avatar-large {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  font-size: 1rem;
}
.profile-photo-frame {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #d9e2ec;
  box-shadow: 0 6px 18px -12px rgba(16, 42, 67, 0.55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  flex: 0 0 96px;
}
.profile-photo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  background: #fff;
}
.profile-photo-fallback {
  color: #1d4ed8;
  font-size: 1.55rem;
  font-weight: 700;
}
.profile-identity {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  background: #f8fafc;
  border: 1px solid #e4ebf3;
  border-radius: 14px;
  padding: 0.7rem 0.8rem;
}
.profile-identity-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.profile-identity-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #102a43;
}
.profile-identity-subtitle {
  font-size: 0.9rem;
  color: #486581;
}
.profile-account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.profile-account-item {
  border: 1px solid #e4ebf3;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.68rem 0.75rem;
}
.profile-account-item-wide {
  grid-column: span 3;
}
.profile-account-label {
  font-size: 0.76rem;
  color: #486581;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.profile-account-value {
  margin-top: 0.1rem;
  font-size: 0.98rem;
  color: #102a43;
  font-weight: 600;
}
.profile-account-break {
  word-break: break-word;
}

/* Ultima autentificare — tip dispozitiv (profil web) */
.eam-last-client {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.eam-last-client-art {
  flex: 0 0 auto;
  width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 16px;
  padding: 0.75rem;
  border: 1px solid #e4ebf3;
}
.eam-last-client-art .eam-device-svg {
  width: 72px;
  height: auto;
  max-height: 110px;
  display: block;
}
.eam-last-client-art .eam-device-svg--wide {
  width: 100px;
  max-height: 76px;
}
.eam-last-client-text {
  flex: 1 1 220px;
  min-width: 0;
}
.eam-last-client-title {
  font-size: 0.76rem;
  color: #486581;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}
.eam-last-client-label {
  font-size: 1rem;
  color: #102a43;
  font-weight: 600;
  line-height: 1.35;
}

.app-header .nav-links .logout {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
}

/* Notifications */
.notif-wrap { position: relative; }
.notif-trigger {
  position: relative;
  cursor: pointer;
}
.notif-badge {
  position: absolute;
  top: -3px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #ef4444;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
.notif-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  display: none;
  overflow: hidden;
  z-index: 200;
}
.notif-menu.open { display: block; }
.notif-head {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.notif-item {
  display: block;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #edf2fb;
  color: var(--text);
  text-decoration: none;
  font-size: 0.86rem;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8faff; }
.notif-item small { color: var(--text-muted); display: block; }
.notif-menu .notif-item,
.notif-menu .notif-item:hover {
  color: var(--text);
}

/* Cards */
.app-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  backdrop-filter: none;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.app-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: #cddaf8;
}
.app-card .card-header {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.app-card .card-body { padding: 1.25rem; }

/* Contact page */
.contact-ident-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}
.contact-ident-item {
  border: 1px solid #e4ebf3;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.65rem 0.75rem;
}
.contact-ident-item-full {
  grid-column: 1 / -1;
}
.contact-ident-label {
  font-size: 0.76rem;
  color: #486581;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.contact-ident-value {
  font-size: 0.97rem;
  color: #102a43;
  font-weight: 600;
  line-height: 1.35;
}
.contact-ident-break {
  word-break: break-word;
}
.contact-action-box {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.contact-call-btn {
  width: 100%;
  justify-content: center;
}

/* Profile phone card */
.profile-phone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.profile-phone-item {
  border: 1px solid #e4ebf3;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.7rem 0.75rem;
}
.profile-phone-item-full {
  grid-column: 1 / -1;
}
.profile-phone-label {
  font-size: 0.76rem;
  color: #486581;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.profile-phone-value {
  margin-top: 0.1rem;
  font-size: 0.98rem;
  color: #102a43;
  font-weight: 600;
}
.profile-phone-form {
  border: 1px solid #e4ebf3;
  border-radius: 12px;
  background: #fbfdff;
  padding: 0.8rem;
}
.profile-phone-form-row {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 0.65rem;
  align-items: center;
}
.profile-phone-form-row .btn {
  white-space: nowrap;
}

/* KPI + helper components */
.kpi-tile {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.85rem 1rem;
}
.kpi-tile .label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  font-weight: 600;
}
.kpi-tile .value {
  font-size: 1.45rem;
  line-height: 1.1;
  font-weight: 700;
}
.help-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  border-radius: 999px;
  border: 1px solid #bcccdc;
  color: var(--primary);
  background: #f0f4f8;
  padding: 0.22rem 0.62rem;
}
.inline-hint {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.step-card {
  border: 1px dashed #bcccdc;
  background: #f8fafc;
  border-radius: 12px;
  padding: 0.75rem;
}
.empty-state-action {
  margin-top: 0.75rem;
  display: inline-flex;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-pending { background: var(--status-pending-bg); color: #b45309; }
.status-accepted { background: var(--status-accepted-bg); color: #047857; }
.status-rejected { background: var(--status-rejected-bg); color: #b91c1c; }

/* Request cards */
.request-card {
  background: var(--bg-card-solid);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.1rem;
  margin-bottom: 1rem;
}
.request-card .request-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.request-card .request-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.request-card .request-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid #e8edf8;
}
.request-card .request-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn-app {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.btn-app-primary { background: var(--primary); color: #fff; }
.btn-app-primary:hover { background: var(--primary-hover); color: #fff; transform: translateY(-1px); }
.btn-app-success { background: #059669; color: #fff; }
.btn-app-success:hover { background: #047857; color: #fff; }
.btn-app-outline-danger { background: transparent; color: #dc2626; border: 2px solid #dc2626; }
.btn-app-outline-danger:hover { background: #dc2626; color: #fff; }
.btn-app-outline-primary {
  background: #fff;
  color: var(--primary);
  border: 1px solid #9fb3c8;
}
.btn-app-outline-primary:hover {
  background: #f0f4f8;
  color: var(--primary-hover);
}
.btn-app.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; }

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: #f8fafc;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-glass);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  backdrop-filter: none;
  padding: 2rem;
}
.auth-card h1 {
  font-size: 1.45rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.45rem;
}
.auth-subtitle {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.35rem;
}
.auth-card .auth-footer {
  text-align: center;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid #e5ebf8;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.auth-card .auth-footer a { font-weight: 500; }

/* Auth slide layout (register / google register) */
body.auth-slide-page {
  background:
    linear-gradient(115deg, rgba(2, 57, 89, 0.58) 0%, rgba(4, 92, 140, 0.34) 44%, rgba(7, 126, 153, 0.28) 100%),
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 36%),
    linear-gradient(160deg, #0a4f69 0%, #0b6c7c 48%, #0f8a91 100%);
  min-height: 100vh; /* fallback */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.auth-slide-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(420px, 0.85fr);
}
.auth-slide-side {
  display: flex;
  align-items: flex-end;
  padding: 3rem clamp(1.2rem, 2.5vw, 3rem);
}
.auth-slide-brand {
  color: #fff;
  max-width: 380px;
}
.auth-slide-logo {
  font-size: clamp(1.6rem, 2.1vw, 2.1rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.auth-slide-tagline {
  margin: 0.65rem 0 0;
  font-size: 0.97rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}
.auth-slide-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(1.35rem + env(safe-area-inset-top))
    calc(1.35rem + env(safe-area-inset-right))
    calc(1.35rem + env(safe-area-inset-bottom))
    calc(1.35rem + env(safe-area-inset-left));
}
.auth-page.auth-page-slide {
  width: 100%;
  min-height: auto;
  padding: 0;
  background: transparent;
}
.auth-card.auth-card-slide {
  margin: 0 auto;
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 8.2rem)); /* fallback */
  max-height: min(760px, calc(100dvh - 8.2rem));
  overflow: auto;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 24px 46px -26px rgba(16, 42, 67, 0.65);
}
body.auth-slide-page .app-footer {
  background: transparent;
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}
body.auth-slide-page .app-footer .footer-inner {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(228, 235, 243, 0.9);
}

/* Layout and page intro */
.app-page { padding: 1.5rem 0 3rem; }
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin-bottom: 1rem;
}

/* Wizard */
.wizard-steps {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.wizard-step {
  flex: 1;
  min-width: 140px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 500;
  font-size: 0.9rem;
  background: #d9e2ec;
  color: var(--text-muted);
}
.wizard-step.active { background: var(--primary); color: #fff; }
.wizard-step.done { background: var(--status-accepted-bg); color: #047857; }

/* Alerts */
.alert-app {
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  font-size: 0.92rem;
  border: none;
}
.alert-app.alert-success { background: var(--status-accepted-bg); color: #065f46; }
.alert-app.alert-danger { background: var(--status-rejected-bg); color: #991b1b; }
.alert-app.alert-info { background: #e0f2fe; color: #075985; }

/* OTP digit boxes — grid pe 6 coloane ca să nu dispară o căsuță pe ecrane înguste */
.otp-digit-wrap {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
  max-width: 360px;
  margin: 1rem auto;
  box-sizing: border-box;
}
.otp-digit-box {
  width: 100%;
  min-width: 0;
  max-width: 52px;
  height: 56px;
  margin: 0 auto;
  border: 2px solid #d9e2ec;
  border-radius: 10px;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: #102a43;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.otp-digit-box:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}
.otp-info-box {
  background: #f0f4f8;
  border: 1px solid #e4ebf3;
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  color: #334e68;
  margin-bottom: 0.75rem;
}
.otp-info-box strong {
  color: #102a43;
}
.otp-timer {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}
.otp-timer .otp-timer-value {
  font-weight: 700;
  color: var(--primary);
}
.otp-resend-link {
  display: block;
  text-align: center;
  margin-top: 0.65rem;
  font-size: 0.88rem;
}
@media (max-width: 520px) {
  .otp-digit-wrap {
    max-width: 100%;
    gap: 0.3rem;
  }
  .otp-digit-box {
    max-width: none;
    height: 50px;
    font-size: 1.15rem;
  }
}

/* Tables */
.app-card .table { margin-bottom: 0; }
.app-card .table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.app-card .table td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #e4ebf3;
}
.app-card .table tbody tr:last-child td { border-bottom: none; }
.app-card .table tbody tr:hover { background: #f8fafc; }

/* Forms */
.form-card .form-label { font-weight: 500; color: var(--text); }
.form-card .form-select,
.form-card .form-control {
  border-radius: var(--radius-sm);
  border: 1px solid #bcccdc;
}
.form-card .form-select:focus,
.form-card .form-control:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}
.form-control:focus, .form-select:focus, button:focus-visible, a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Tooltips and tour */
.help-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #9fb3c8;
  background: #f0f4f8;
  color: var(--primary);
  font-size: 0.72rem;
  margin-left: 0.35rem;
  cursor: help;
}
.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  z-index: 300;
  display: none;
}
.tour-overlay.open { display: block; }
.tour-popover {
  position: fixed;
  z-index: 301;
  max-width: min(340px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 0.9rem;
  display: none;
}
.tour-popover .title {
  font-weight: 700;
  font-size: 0.94rem;
  margin-bottom: 0.35rem;
}
.tour-popover .desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2.2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Footer institutional */
.app-footer {
  margin-top: 2rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
  background: #fff;
}
.app-footer .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  border: 1px solid #e6edf5;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 0.55rem 0.9rem;
}
.app-footer .footer-meta {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.app-footer .footer-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1px;
}
.app-footer .footer-meta strong {
  color: var(--primary);
  font-weight: 700;
}
.app-footer .footer-note {
  margin-top: 2px;
  font-size: 0.75rem;
  color: #7b8794;
}
.app-footer .footer-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  padding-left: 0.4rem;
}
.app-footer .footer-logo {
  display: block;
  width: 88px;
  height: auto;
  max-height: 30px;
  max-width: 100%;
  image-rendering: -webkit-optimize-contrast;
}

/* Prevent accidental oversized logos/images in footer */
.app-footer img.footer-logo {
  width: 88px !important;
  height: auto !important;
  max-height: 30px !important;
  object-fit: contain !important;
}
.app-footer img.footer-logo-ase {
  width: 128px !important;
  max-height: 44px !important;
}

/* Teme ocupate */
.topic-taken { text-decoration: line-through; color: var(--text-muted); }
.topic-taken .badge { text-decoration: none; }

/* Responsive and accessibility */
@media (max-width: 768px) {
  .app-header { padding: 0.55rem 0; }
  .app-header .container { align-items: flex-start; gap: 0.5rem; }
  .app-header .brand { font-size: 1.02rem; width: 100%; }
  .app-header .nav-links {
    width: 100%;
    gap: 0.45rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .app-header .nav-links > .user-info {
    grid-column: 1 / -1;
    width: 100%;
    margin-right: 0;
    padding: 0.4rem 0.55rem;
    font-size: 0.82rem;
    border-radius: 12px;
    gap: 0.5rem;
  }
  .user-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }
  .user-meta-name { font-size: 0.8rem; }
  .user-meta-role { font-size: 0.72rem; }
  .app-header .nav-links .user-info small {
    display: block;
    margin-left: 0.25rem;
  }
  .app-header .nav-links > a,
  .app-header .nav-links > button,
  .app-header .nav-links > span,
  .app-header .nav-links > .notif-wrap > button,
  .app-header .nav-links > form > button {
    width: 100%;
    text-align: center;
    font-size: 0.81rem;
    padding: 0.43rem 0.56rem;
    border-radius: 10px;
    border: 1px solid #d9e2ec;
    background: #fff;
  }
  .app-header .nav-links > .logout { border-color: #bfd3ea; }
  .app-header .nav-links > .notif-wrap { width: 100%; }
  .notif-wrap { position: static; }
  .notif-menu {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    top: 84px;
    width: auto;
    max-height: 56vh;
    overflow-y: auto;
    z-index: 600;
    border-radius: 12px;
  }
  .page-title { font-size: 1.25rem; }
  .app-card .card-body { padding: 1rem; }
  .contact-ident-grid { grid-template-columns: 1fr; }
  .contact-ident-item { padding: 0.62rem 0.68rem; }
  .contact-ident-value { font-size: 0.95rem; }
  .profile-account-grid { grid-template-columns: 1fr; }
  .profile-account-item-wide { grid-column: auto; }
  .profile-phone-grid { grid-template-columns: 1fr; }
  .profile-phone-form-row { grid-template-columns: 1fr; }
  .profile-phone-form-row .btn { width: 100%; }
  .request-card { padding: 0.9rem; }
  .app-footer .footer-inner { justify-content: center; text-align: center; }
  .app-footer .footer-logo-link { padding-left: 0; }
  .app-footer .footer-logo { width: 80px; }
  .app-footer img.footer-logo { width: 80px !important; }
  .app-footer img.footer-logo-ase { width: 112px !important; max-height: 40px !important; }
}

@media (max-width: 980px) {
  .auth-slide-shell {
    grid-template-columns: 1fr;
  }
  .auth-slide-side {
    display: none;
  }
  .auth-slide-main {
    padding: calc(0.95rem + env(safe-area-inset-top))
      calc(0.95rem + env(safe-area-inset-right))
      calc(0.95rem + env(safe-area-inset-bottom))
      calc(0.95rem + env(safe-area-inset-left));
  }
  .auth-card.auth-card-slide {
    max-height: calc(100vh - 6.4rem); /* fallback */
    max-height: calc(100dvh - 6.4rem);
    border-radius: 14px;
    padding: 1.35rem;
  }
}

@media (max-width: 520px) {
  .auth-card.auth-card-slide {
    padding: 1.15rem;
    border-radius: 14px;
  }
  .auth-card.auth-card-slide h1 {
    font-size: 1.25rem;
  }
  .auth-card.auth-card-slide .auth-subtitle {
    font-size: 0.85rem;
    margin-bottom: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* —— Staff hub (admin / secretariat) —— */
.staff-app-shell .page-title {
  letter-spacing: -0.02em;
}
.staff-hub-nav {
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(4, 92, 140, 0.06), rgba(4, 92, 140, 0.02));
  border: 1px solid var(--border);
  padding: 0.5rem;
}
.staff-hub-nav-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.staff-hub-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.staff-hub-pill:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--border);
}
.staff-hub-pill.is-active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.staff-kpi-tile .card-body {
  padding: 1rem 1.1rem;
}
.staff-kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.staff-kpi-value {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}
.staff-card-elevated {
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.staff-card-muted {
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border: 1px solid var(--border);
}
.staff-live-pre {
  background: #061521;
  color: #cdeffd;
  padding: 12px;
  border-radius: var(--radius-sm);
  min-height: 220px;
  max-height: 320px;
  overflow: auto;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}
.staff-status-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: 0.08em;
  background: #94a3b8;
}
.staff-status-dot-open { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25); }
.staff-status-dot-extension { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22); }
.staff-status-dot-before { background: #3b82f6; }
.staff-status-dot-closed { background: #ef4444; }
.staff-status-dot-off,
.staff-status-dot-unset { background: #94a3b8; }
.staff-status-dot-bad_date { background: #dc2626; }
.staff-status-dot-unknown { background: #64748b; }

/* —— Harta fluxului live (admin) —— */
.staff-flow-shell {
  max-width: 100%;
}
.staff-flow-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #047857;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.staff-flow-live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
  animation: staff-flow-pulse 2s ease-out infinite;
}
@keyframes staff-flow-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.staff-flow-window-select,
.staff-flow-search {
  min-width: 160px;
}
.staff-flow-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}
.staff-flow-kpi {
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}
.staff-flow-kpi-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.staff-flow-kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}
.staff-flow-kpi-sub {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}
.staff-flow-board-wrap {
  overflow: hidden;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(4, 92, 140, 0.04), rgba(15, 23, 42, 0.02));
  box-shadow: var(--shadow-lg);
}
.staff-flow-board {
  display: flex;
  gap: 0.85rem;
  padding: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 420px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.staff-flow-loading {
  color: var(--text-muted);
  padding: 2rem;
  width: 100%;
  text-align: center;
}
.staff-flow-error {
  width: 100%;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.92rem;
}
.staff-flow-column {
  flex: 0 0 min(280px, 82vw);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.staff-flow-column-head {
  padding: 0.85rem 0.95rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(248,250,252,0.95) 100%);
  border-top: 3px solid var(--flow-accent, #64748b);
  border-radius: var(--radius) var(--radius) 0 0;
}
.staff-flow-column-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.staff-flow-column-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--flow-accent, #64748b);
}
.staff-flow-column-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.staff-flow-column-count {
  margin-top: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--flow-accent, #64748b);
  background: color-mix(in srgb, var(--flow-accent, #64748b) 12%, white);
}
.staff-flow-column-body {
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: min(720px, 68vh);
  overscroll-behavior: contain;
}
.staff-flow-column.is-dense .staff-flow-column-body {
  gap: 0.4rem;
}
.staff-flow-column.is-dense .staff-flow-card {
  padding: 0.5rem;
  gap: 0.5rem;
}
.staff-flow-column.is-dense .staff-flow-card-avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
}
.staff-flow-column.is-dense .staff-flow-card-name {
  font-size: 0.82rem;
}
.staff-flow-column.is-dense .staff-flow-card-device {
  padding: 0.28rem 0.38rem;
}
.staff-flow-column.is-dense .staff-flow-card-device-label {
  font-size: 0.68rem;
  -webkit-line-clamp: 1;
}
.staff-flow-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1.25rem 0.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}
.staff-flow-card {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.staff-flow-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
}
.staff-flow-card-avatar {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.staff-flow-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.staff-flow-card-initial {
  font-weight: 700;
  font-size: 1rem;
  color: #475569;
}
.staff-flow-card-online {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #fff;
}
.staff-flow-card-body {
  min-width: 0;
  flex: 1;
}
.staff-flow-card-name {
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.25;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.staff-flow-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.2rem;
}
.staff-flow-role-badge {
  display: inline-flex;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: rgba(4, 92, 140, 0.08);
}
.staff-flow-app-badge {
  display: inline-flex;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6d28d9;
  background: rgba(109, 40, 217, 0.1);
}
.staff-flow-card-ago {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.staff-flow-card-device {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.staff-flow-card--app {
  border-color: color-mix(in srgb, #7c3aed 22%, var(--border));
  background: linear-gradient(135deg, #faf5ff 0%, #ffffff 58%);
  box-shadow: inset 3px 0 0 #7c3aed;
}
.staff-flow-card--app:hover {
  border-color: color-mix(in srgb, #7c3aed 35%, var(--border));
}
.staff-flow-app-badge--ios {
  color: #0369a1;
  background: rgba(14, 165, 233, 0.12);
}
.staff-flow-app-badge--android {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
}
.staff-flow-card-activity {
  font-size: 0.72rem;
  line-height: 1.35;
  color: #6d28d9;
  font-weight: 600;
  margin-top: 0.3rem;
}
.staff-flow-card-device--ios {
  background: #f0f9ff;
  border-color: #bae6fd;
}
.staff-flow-card-device--android {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.staff-flow-card-device-icon {
  flex: 0 0 auto;
  line-height: 0;
  margin-top: 0.12rem;
  width: 16px;
  height: 16px;
  position: relative;
  background: transparent;
}
.staff-flow-card-device-icon::before {
  content: '';
  display: block;
  width: 10px;
  height: 14px;
  margin: 1px auto 0;
  border: 2px solid #64748b;
  border-radius: 2px;
  box-sizing: border-box;
}
.staff-flow-device-icon--ios_app {
  color: #0284c7;
}
.staff-flow-device-icon--ios_app::before {
  border-color: #0284c7;
  border-radius: 3px;
}
.staff-flow-device-icon--android_app {
  color: #16a34a;
}
.staff-flow-device-icon--android_app::before {
  border-color: #16a34a;
  border-radius: 2px;
}
.staff-flow-device-icon--iphone_web::before,
.staff-flow-device-icon--android_web::before {
  border-color: #64748b;
}
.staff-flow-device-icon--web_desktop::before {
  width: 14px;
  height: 10px;
  margin-top: 3px;
  border-radius: 1px;
}
.staff-flow-device-icon--tablet_apple::before,
.staff-flow-device-icon--tablet_android::before {
  width: 12px;
  height: 15px;
}
.staff-flow-device-svg {
  width: 14px;
  height: 14px;
  display: block;
}
.staff-flow-card-device-label {
  font-size: 0.72rem;
  line-height: 1.35;
  color: #475569;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.staff-flow-card--app .staff-flow-card-device-label {
  font-weight: 600;
  -webkit-line-clamp: 2;
}
.staff-flow-card-detail,
.staff-flow-card-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.staff-flow-card-sub {
  color: #64748b;
}
@media (max-width: 767.98px) {
  .staff-flow-board {
    min-height: 360px;
  }
  .staff-flow-column {
    flex-basis: min(260px, 88vw);
  }
}

/* PWA / iOS standalone */
html {
  -webkit-text-size-adjust: 100%;
}
@supports (-webkit-touch-callout: none) {
  body {
    -webkit-tap-highlight-color: rgba(4, 92, 140, 0.12);
  }
}
@media (display-mode: standalone) {
  body {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overscroll-behavior-y: none;
  }
  .app-header {
    padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
  }
  .app-footer .footer-inner {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  body.auth-slide-page .auth-slide-shell {
    padding-top: env(safe-area-inset-top, 0px);
  }
}
.pwa-tutorial-card .pwa-tutorial-steps .list-group-item {
  border-color: var(--border);
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.pwa-tutorial-card .pwa-tutorial-steps .fw-semibold {
  color: var(--text);
}