/* ─── Brand font ─────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'TT Firs Neue';
  src: url('/fonts/TT_Firs_Neue_Trial_Var_Roman.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TT Firs Neue';
  src: url('/fonts/TT_Firs_Neue_Trial_Var_Italic.ttf') format('truetype');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* ─── Design tokens ─────────────────────────────────────────────────────── */
:root {
  /* Dubai Express brand palette */
  --primary:       #E08640;
  --primary-dark:  #AC662F;
  --accent:        #404154;
  --accent-dark:   #32324a;
  --accent-light:  #6AA9B9;

  /* --blue aliases → brand primary (propagates to all existing usages) */
  --blue:          var(--primary);
  --blue-dark:     var(--primary-dark);
  --blue-light:    #fdf3e8;
  --blue-mid:      #fae6cc;

  --teams:       #5b5ea6;
  --teams-dark:  #444791;
  --green:       #107c10;
  --green-light: #e8f5e9;
  --danger:      #c0392b;
  --danger-light:#fdecea;
  --warn-bg:     #fffbeb;
  --warn-text:   #92400e;

  --bg:          #f4f5f7;
  --surface:     #ffffff;
  --border:      #e4e7ec;
  --border-soft: #f0f2f5;

  --text:        #111827;
  --text-2:      #4b5563;
  --text-3:      #9ca3af;

  --r:    8px;
  --r-lg: 14px;
  --r-xl: 20px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.06);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.08), 0 0 0 1px rgba(0,0,0,.03);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10), 0 0 0 1px rgba(0,0,0,.03);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.15);

  --nav-w: 240px;
  --transition: 0.15s ease;
}

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

body {
  font-family: 'TT Firs Neue', 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--nav-w);
  background: #F0F0F3;
  border-right: 1px solid #D4D5DC;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow: hidden;
}

.main-wrap {
  flex: 1;
  margin-left: var(--nav-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: calc(var(--nav-w) + 960px);
}

.main {
  flex: 1;
  padding: 32px 36px;
}

/* ─── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  height: 52px;
  background: #ffffff;
  border-bottom: 1px solid #F0F0F3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  flex-shrink: 0;
}

[data-theme="dark"] .topbar {
  background: #1c1f27;
  border-bottom-color: #2e3340;
}

.topbar-right {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}

.lang-btn {
  padding: 3px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  line-height: 1;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(224,134,64,.18);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow var(--transition);
  flex-shrink: 0;
  user-select: none;
}

.topbar-avatar:hover {
  box-shadow: 0 0 0 2px var(--primary);
}

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

/* ─── Profile indicator ──────────────────────────────────────────────────── */
.profile-ind-alert {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #E08640;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: box-shadow var(--transition), transform var(--transition);
  line-height: 1;
}
.profile-ind-alert:hover { box-shadow: 0 0 0 3px rgba(224,134,64,.3); transform: scale(1.08); }

.profile-ind-green {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #2E7D32;
  border: 2px solid #fff;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
  transition: box-shadow var(--transition), transform var(--transition);
}
.profile-ind-green:hover { box-shadow: 0 0 0 3px rgba(46,125,50,.25); transform: scale(1.2); }
[data-theme="dark"] .profile-ind-green { border-color: #1c1f27; }
[data-theme="dark"] .profile-ind-green:hover { box-shadow: 0 0 0 3px rgba(46,125,50,.35); }

/* ─── Profile popover ─────────────────────────────────────────────────────── */
.profile-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 44px;
  width: 260px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);
  border: 1px solid #EBEBF0;
  z-index: 300;
  overflow: hidden;
}
[data-theme="dark"] .profile-popover {
  background: #252836;
  border-color: #2e3340;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.profile-pop-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #F0F0F3;
}
[data-theme="dark"] .profile-pop-header { border-bottom-color: #2e3340; }
.profile-pop-title { font-size: 14px; font-weight: 700; color: var(--text); }
.profile-pop-sub   { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.profile-pop-list { padding: 8px; }
.profile-pop-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px;
  background: none; border: none; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--text);
  cursor: pointer; font-family: inherit; text-align: left;
  transition: background var(--transition);
}
.profile-pop-item:hover { background: #FEF9F4; }
[data-theme="dark"] .profile-pop-item:hover { background: #2D1F0F; }
.profile-pop-icon { font-size: 16px; flex-shrink: 0; }

.profile-pop-item--row {
  justify-content: flex-start;
  gap: 8px;
}
.profile-pop-row-label {
  font-size: 13px;
  color: var(--text-2);
  min-width: 92px;
  flex-shrink: 0;
}
.profile-pop-val {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}
.profile-pop-empty {
  font-size: 13px;
  color: var(--text-3);
}
.profile-pop-thumb {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-pop-cta {
  display: block; width: calc(100% - 16px);
  margin: 0 8px 10px;
  padding: 10px; border: none; border-radius: 8px;
  background: #E08640; color: #fff;
  font-size: 13.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background var(--transition);
}
.profile-pop-cta:hover { background: #c9732f; }

/* ─── Profile edit drawer ────────────────────────────────────────────────── */
.profile-drawer {
  position: fixed; inset: 0;
  display: flex; justify-content: flex-end;
  z-index: 500;
}
.profile-drawer-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
}
.profile-drawer-panel {
  position: relative;
  width: 420px; max-width: 100vw;
  background: var(--surface);
  box-shadow: -8px 0 48px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
  z-index: 1;
  animation: drawerIn .22s ease;
}
@keyframes drawerIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.profile-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.profile-drawer-title { font-size: 18px; font-weight: 700; color: var(--text); }
.profile-drawer-close {
  width: 32px; height: 32px; border-radius: 8px;
  border: none; background: none; cursor: pointer;
  color: var(--text-3); display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.profile-drawer-close:hover { background: var(--bg); color: var(--text); }

.profile-drawer-body {
  flex: 1; overflow-y: auto;
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 20px;
}
.profile-drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  flex-shrink: 0;
}

.drawer-field { display: flex; flex-direction: column; gap: 7px; }
.drawer-field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.drawer-field--focus .drawer-field-label { color: var(--primary); }

.drawer-photo-row { display: flex; align-items: center; gap: 16px; }
.drawer-photo-preview {
  width: 72px; height: 72px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border);
}
.drawer-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.drawer-photo-placeholder { width: 44%; height: 44%; color: var(--text-3); }
.drawer-bio { min-height: 90px; resize: vertical; }

/* ─── User dropdown menu ─────────────────────────────────────────────────── */
.user-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  border: 1px solid #EBEBF0;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);
  min-width: 220px;
  z-index: 200;
  overflow: hidden;
}

.user-menu.open {
  display: block;
}

[data-theme="dark"] .user-menu {
  background: #252836;
  border-color: #2e3340;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}

.user-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
}

.user-menu-av {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(224,134,64,.18);
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.user-menu-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.user-menu-name {
  font-size: 14px;
  font-weight: 600;
  color: #404154;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-theme="dark"] .user-menu-name { color: #eaedf2; }

.user-menu-title {
  font-size: 12px;
  color: #86879B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.user-menu-divider {
  height: 1px;
  background: #F0F0F3;
  margin: 0;
}

[data-theme="dark"] .user-menu-divider { background: #2e3340; }

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  font-size: 13.5px;
  color: #404154;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition);
  font-family: inherit;
  font-weight: 400;
}

.user-menu-item:hover {
  background: #F8F8FA;
  text-decoration: none;
}

[data-theme="dark"] .user-menu-item { color: #c8cdd8; }
[data-theme="dark"] .user-menu-item:hover { background: rgba(255,255,255,.06); }

.user-menu-item--danger { color: #C25B4C !important; }
[data-theme="dark"] .user-menu-item--danger { color: #e07060 !important; }

.user-menu-toggle {
  margin-left: auto;
  width: 34px;
  height: 20px;
  border-radius: 10px;
  background: #D0D0D8;
  position: relative;
  flex-shrink: 0;
  transition: background .2s;
}

.user-menu-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}

[data-theme="dark"] .user-menu-toggle {
  background: var(--primary);
}

[data-theme="dark"] .user-menu-toggle::after {
  transform: translateX(14px);
}

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar-logo {
  height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid #D4D5DC;
  flex-shrink: 0;
}

.sidebar-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 13.5px;
  font-weight: 700;
  color: #404154;
  letter-spacing: -0.2px;
  line-height: 1.25;
}
.sidebar-logo-text span { color: var(--primary); }

.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(64,65,84,.18); border-radius: 3px; }

.nav-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #86879B;
  padding: 14px 12px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r);
  cursor: pointer;
  color: #404154;
  font-size: 13.5px;
  font-weight: 450;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background var(--transition), color var(--transition);
  position: relative;
}

.nav-item svg { flex-shrink: 0; color: #86879B; transition: color var(--transition); }
.nav-item:hover { background: rgba(64,65,84,.07); color: #404154; }
.nav-item:hover svg { color: #404154; }

.nav-item.active {
  background: #E08640;
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
  margin: 1px 8px;
  width: calc(100% - 16px);
}
.nav-item.active svg { color: #fff; }


/* ─── Page structure ─────────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

.page-header { margin-bottom: 28px; }
.page-title { font-size: 22px; font-weight: 500; letter-spacing: -0.4px; color: var(--text); }
h1, h2 { font-weight: 500; }
.page-subtitle { font-size: 13.5px; color: var(--text-3); margin-top: 3px; }

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

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover { background: var(--blue-dark); text-decoration: none; color: #fff; }

.btn-secondary {
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--bg); text-decoration: none; color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; color: #fff; text-decoration: none; }

.btn-sm { padding: 5px 11px; font-size: 12px; }

/* ─── Toolbar / Search ───────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}

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

.search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 13.5px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,120,212,.12);
}

select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 13.5px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition);
}

select:focus { outline: none; border-color: var(--blue); }

/* ─── Staff grid & cards ─────────────────────────────────────────────────── */
/* ─── Staff grid ──────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.staff-card {
  padding: 0;
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid #F0F0F3;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.staff-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(64, 65, 84, 0.1);
}

.sc-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
}

.sc-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sc-presence-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  z-index: 1;
}

.sc-body {
  padding: 12px;
}

.sc-name {
  font-size: 14px;
  font-weight: 600;
  color: #404154;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.sc-title {
  font-size: 12px;
  color: #86879B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.sc-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 5px;
  min-height: 15px;
}

.sc-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Avatar fallback (profile page, org tree etc.) */
.staff-av {
  width: 68px; height: 68px;
  border-radius: 50%;
  margin: 0 auto 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.staff-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.av-no-photo {
  background: var(--bg);
  border: 1.5px solid var(--border);
  color: var(--text-3);
  flex-direction: column;
  gap: 0;
}
.av-no-photo svg { flex-shrink: 0; }

.av-no-photo-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
  text-align: center;
  line-height: 1.35;
  padding: 0 8px;
  margin-top: 6px;
}

.pp-photo.av-no-photo { gap: 4px; }

[data-theme="dark"] .staff-card { border-color: var(--border); }
[data-theme="dark"] .sc-name { color: var(--text); }

[data-theme="dark"] .av-no-photo {
  background: var(--bg);
  border-color: var(--border);
}

.dept-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: var(--blue-light);
  color: var(--blue);
}

/* ─── Stats ──────────────────────────────────────────────────────────────── */
/* ─── Home profile page ──────────────────────────────────────────────────── */
.hp-greeting {
  font-size: 20px;
  font-weight: 300;
  color: var(--text-2);
  margin-bottom: 20px;
}

.hp-greeting strong {
  font-weight: 600;
  color: var(--text);
}

/* ─── Announcements ──────────────────────────────────────────────────────── */
.announcement {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.announcement:last-child { border-bottom: none; }

.announcement.pinned {
  background: linear-gradient(to right, #fffbeb, var(--surface));
  border-left: 3px solid #f59e0b;
  padding-left: 15px;
}

.ann-pin {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #d97706;
  margin-bottom: 4px;
}

.ann-title { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.ann-body  { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.ann-meta  { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }

/* ─── Announcement ticker (home page) ────────────────────────────────────── */
.ann-ticker {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  height: 48px;
  padding: 0 14px 0 16px;
  margin-bottom: 22px;
  overflow: hidden;
}

.ann-ticker__label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  padding-right: 14px;
  border-right: 1px solid var(--border);
  margin-right: 16px;
  white-space: nowrap;
}

.ann-ticker__track {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  height: 48px;
  display: flex;
  align-items: center;
}

.ann-ticker__slide {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  transition: opacity .28s ease, transform .28s ease;
}

.ann-ticker__slide.is-exit  { opacity: 0; transform: translateY(-9px); }
.ann-ticker__slide.is-enter { opacity: 0; transform: translateY(9px);  }

.ann-tick-pin   { font-size: 13px; flex-shrink: 0; line-height: 1; }
.ann-tick-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.ann-tick-sep   { color: var(--border); flex-shrink: 0; }
.ann-tick-body  {
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ann-ticker__nav {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

.ann-ticker__counter {
  font-size: 11px;
  color: var(--text-3);
  min-width: 26px;
  text-align: center;
  margin-right: 3px;
}

.ann-ticker__btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 11px;
  padding: 4px 5px;
  line-height: 1;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.ann-ticker__btn:hover { color: var(--text); background: var(--bg); }

/* ─── Birthday cards ─────────────────────────────────────────────────────── */
/* ─── Birthday page ──────────────────────────────────────────────────────── */
.bd-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px;
}

.bd-empty {
  padding: 24px 0;
  font-size: 13px;
  color: var(--text-3);
}

/* Upcoming — horizontal scroll row */
.bd-upcoming-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.bd-upcoming-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 120px;
  min-width: 120px;
  padding: 16px 10px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border, #F0F0F0);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  text-align: center;
  flex-shrink: 0;
}

.bd-upcoming-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(224,134,64,.15);
}

.bd-upcoming-card.bd-card-today {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(224,134,64,.18);
}

.bd-card-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.bd-card-badge-today {
  background: var(--primary);
  color: #fff;
}

.bd-card-badge-soon {
  background: #FFF3CD;
  color: #856404;
}

.bd-upcoming-av {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}

.bd-upcoming-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.bd-upcoming-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}

.bd-upcoming-date {
  font-size: 12px;
  color: var(--text-3);
}

/* All birthdays — month accordion */
.bd-month-acc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
  overflow: hidden;
}

.bd-month-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}

.bd-month-header:hover { background: var(--bg); }

.bd-month-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.bd-month-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--bg);
  border-radius: 20px;
  padding: 1px 8px;
}

.bd-month-chevron {
  color: var(--text-3);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.bd-month-chevron.open { transform: rotate(180deg); }

.bd-month-body { border-top: 1px solid var(--border-soft); }

.bd-month-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background var(--transition);
}

.bd-month-row:last-child { border-bottom: none; }
.bd-month-row:hover { background: var(--bg); }

.bd-month-row.bd-month-today {
  background: rgba(224, 134, 64, 0.08);
}

.bd-month-av {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}

.bd-month-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.bd-month-info { flex: 1; min-width: 0; }

.bd-month-row-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bd-month-row-title {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bd-month-row-date {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Files ──────────────────────────────────────────────────────────────── */
.file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition);
}

.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--bg); }

.file-icon-wrap {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--bg);
}

.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13.5px; font-weight: 500; color: var(--text); }
.file-desc { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.file-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* ─── Org chart ──────────────────────────────────────────────────────────── */
/* ─── Org chart ──────────────────────────────────────────────────────────── */
.org-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.org-zoom-btn {
  width: 30px; height: 30px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  font-family: inherit;
}
.org-zoom-btn:hover { background: var(--bg); border-color: var(--blue); color: var(--blue); }

.org-zoom-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  min-width: 36px;
  text-align: center;
}

.org-zoom-reset {
  font-size: 12px;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: inherit;
  transition: background var(--transition), color var(--transition);
}
.org-zoom-reset:hover { background: var(--bg); color: var(--text); }

.org-scroll {
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  min-height: 520px;
  height: calc(100vh - 260px); /* fill available vertical space */
}

.org-canvas {
  padding: 48px 72px 64px;
  min-width: max-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative; /* anchor for connector line */
}

#org-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Node (wrapper for card + connector + children) */
.org-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Children row — SVG lines drawn by _drawOrgLines(), no CSS pseudo-elements */
.org-children {
  display: flex;
  gap: 20px;
  position: relative;
  align-items: flex-start;
}

/* Spacing between parent card and children row */
.org-ch-wrap {
  margin-top: 48px;
}

/* SVG connector overlay */
#org-svg-lines path,
#org-svg-lines line {
  fill: none;
  stroke: var(--border);
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* ── Card ── */
.org-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 148px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--transition), box-shadow var(--transition), transform 0.18s ease;
}
.org-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(224,134,64,.18);
  transform: translateY(-2px);
}

.org-card-av {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
  overflow: hidden;
}
.org-card-av img { width: 100%; height: 100%; object-fit: cover; }

.org-card-inner {
  padding: 8px 10px 10px;
  text-align: center;
}

.org-card-name  { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.35; }
.org-card-title { font-size: 10.5px; color: var(--text-3); line-height: 1.3; margin-top: 2px; }

.org-card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-top: 1px solid var(--border-soft);
  border-radius: 0;
  background: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  font-family: inherit;
  transition: background var(--transition), color var(--transition);
}
.org-card-footer:hover { background: var(--bg); color: var(--text-2); }
.org-card-footer.collapsed { color: var(--blue); }

.org-chevron {
  transition: transform 0.18s;
  flex-shrink: 0;
}
.org-card-footer.collapsed .org-chevron { transform: rotate(-90deg); }

/* ── Accordion button on L2+ cards ─────────────────────────────────────── */
.org-acc-btn {
  color: var(--primary) !important;
  font-weight: 500;
}

.org-acc-btn:hover { background: rgba(224,134,64,.08) !important; color: var(--primary) !important; }

.org-acc-arrow {
  font-size: 13px;
  font-weight: 400;
  color: var(--primary);
  margin-left: 2px;
  line-height: 1;
}

/* ── Org accordion panel ────────────────────────────────────────────────── */
#org-accordion-panel {
  position: relative; /* anchor for caret + connector */
  box-sizing: border-box;
  min-width: 400px;
  max-width: 700px;
  margin-top: 24px; /* gap between card row and panel */
}

/* Active card: orange top border only */
.org-card--active {
  border-top: 3px solid var(--primary) !important;
}

/* Vertical orange connector line from card bottom to panel top */
.org-acc-connector {
  display: none;
}

/* Bordered caret triangle above panel pointing up */
.org-acc-caret {
  display: none;
}

.org-accordion-inner {
  background: #F8F6F3;
  border-radius: 16px;
  border: 1px solid #E8E4DE;
  padding: 20px 24px;
}

[data-theme="dark"] .org-accordion-inner {
  background: #1e2029;
  border-color: var(--border);
}

.org-accordion-title {
  font-size: 14px;
  font-weight: 600;
  color: #404154;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .org-accordion-title { color: #eaedf2; }

.org-accordion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

/* ── Card inside accordion ─────────────────────────────────────────────── */
.org-acc-card {
  background: #ffffff;
  border: 1px solid #F0F0F0;
  border-radius: 10px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.org-acc-card:hover {
  border-color: #E08640;
  box-shadow: 0 2px 8px rgba(224, 134, 64, 0.15);
}

[data-theme="dark"] .org-acc-card { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .org-acc-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(224,134,64,.2); }

.org-acc-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  flex: 1;
  min-height: 130px;
  text-align: center;
}

.org-acc-av {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  overflow: hidden;
}

.org-acc-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.org-acc-card-info { width: 100%; min-width: 0; }

.org-acc-card-name {
  font-size: 13px;
  font-weight: 500;
  color: #404154;
  line-height: 1.35;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

[data-theme="dark"] .org-acc-card-name { color: #dde0ea; }

.org-acc-card-title {
  font-size: 12px;
  color: #86879B;
  margin-top: 3px;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-acc-card-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 6px 12px;
  border: none;
  border-top: 1px solid #F0F0F3;
  background: none;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--primary);
  font-family: inherit;
  transition: background var(--transition);
}

.org-acc-card-btn:hover { background: rgba(224,134,64,.08); }
[data-theme="dark"] .org-acc-card-btn { border-top-color: var(--border-soft); }

/* ── Nested sub-section ─────────────────────────────────────────────────── */
.org-acc-subsection {
  overflow: hidden;
  margin-bottom: 12px;
}

.org-accordion-body { }

.org-accordion-body--nested {
  background: rgba(0,0,0,.03);
  border-radius: 8px;
  padding: 14px 14px 4px;
}

[data-theme="dark"] .org-accordion-body--nested {
  background: rgba(255,255,255,.04);
}

.org-accordion-body--nested .org-accordion-title {
  font-size: 13px;
  color: var(--text-2);
}

/* Footer bar "Всего N сотрудников" */
.org-footer-wrap {
  position: fixed;
  bottom: 28px;
  left: var(--nav-w);
  right: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 50;
}

.org-footer {
  background: rgba(17, 19, 24, 0.86);
  color: #fff;
  padding: 9px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 7px;
}

[data-theme="dark"] .org-footer {
  background: rgba(255,255,255,.1);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ─── Org toolbar extras ─────────────────────────────────────────────────── */
.org-tree-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.org-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 6px;
}
.org-search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-3);
  pointer-events: none;
}
.org-search {
  height: 30px;
  padding: 0 10px 0 30px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  width: 220px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.org-search:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,120,212,.12); }
.org-search::placeholder { color: var(--text-3); }

.org-view-switch {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}
.org-view-btn {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: background var(--transition), color var(--transition);
}
.org-view-btn:hover { color: var(--text); }
.org-view-btn.active { background: var(--surface); color: var(--blue); box-shadow: var(--shadow-xs); }

/* ─── Org list view ──────────────────────────────────────────────────────── */
/* ─── Org list (Ozon-style dept view) ───────────────────────────────────── */
#org-list-wrap { margin-top: 0; }

/* Header: "Dubai Express · 29 сотрудников" */
.org-list-header {
  background: #F0F0F3;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.org-list-header-company {
  font-size: 16px;
  font-weight: 600;
  color: #404154;
}
.org-list-header-sep { font-size: 16px; color: #ACADBB; }
.org-list-header-count { font-size: 16px; font-weight: 600; color: #404154; }

/* Sections wrapper — outer card */
.org-sections-wrap {
  background: #FFFFFF;
  border: 1px solid #F0F0F3;
  border-radius: 12px;
  overflow: hidden;
}

/* Individual dept section */
.org-dept-section {
  background: #FFFFFF;
  border-bottom: 1px solid #F0F0F3;
}
.org-dept-section:last-child { border-bottom: none; }

.org-dept-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
}
.org-dept-header:hover { background: #FAF5F0; }

.org-dept-chev {
  flex-shrink: 0;
  color: #86879B;
  transition: transform .22s ease;
  display: flex; align-items: center;
}
.org-dept-section.open .org-dept-chev { transform: rotate(90deg); }

.org-dept-name {
  font-size: 15px;
  font-weight: 600;
  color: #404154;
  flex: 1;
}
.org-dept-count {
  font-size: 14px;
  color: #ACADBB;
  font-weight: 400;
}

/* Member rows */
.org-dept-body-wrap { overflow: hidden; }
.org-dept-body { border-top: 1px solid #F0F0F3; }

.org-member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 32px;
  cursor: pointer;
  background: #F8F6F3;
  transition: background var(--transition);
  border-bottom: 1px solid #F0F0F0;
}
.org-member:last-child { border-bottom: none; }
.org-member:hover { background: #FAF0E6; }

.org-member--head {
  border-left: 3px solid #E08640;
  background: #FEF9F4;
  padding-left: 13px;
}
.org-member--head:hover { background: #FAF0E6; }
[data-theme="dark"] .org-member--head { background: rgba(224,134,64,.08); border-left-color: #e8954a; }
[data-theme="dark"] .org-member--head:hover { background: rgba(224,134,64,.13); }
[data-theme="dark"] .org-member { background: var(--surface); border-bottom-color: var(--border-soft); }
[data-theme="dark"] .org-member:hover { background: var(--bg); }

.org-member-av {
  width: 36px; height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  overflow: hidden;
}
.org-member-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.org-member-info { flex: 1; min-width: 0; }
.org-member-name {
  font-size: 13.5px;
  font-weight: 500;
  color: #404154;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.org-member-title {
  font-size: 13px;
  font-weight: 300;
  color: #86879B;
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.org-member-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(224,134,64,.12);
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* No results */
.org-no-results {
  padding: 48px;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}

/* ─── Forms (admin) ──────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 5px;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,120,212,.12);
}

textarea.form-input { min-height: 90px; resize: vertical; }

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; }

.tab {
  padding: 7px 15px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-2);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.tab:hover:not(.active) { background: var(--bg); color: var(--text); }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .18s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.97) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
}

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

.modal-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 16px 20px 24px; }

.ann-modal-nav__btn {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  width: 36px; height: 36px; cursor: pointer; color: var(--text-2);
  font-size: 22px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.ann-modal-nav__btn:hover { background: var(--bg); color: var(--text); border-color: var(--text-3); }

.ann-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.ann-nav button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px; height: 36px;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.ann-nav button:hover { background: var(--bg); color: var(--text); }
.ann-nav span {
  font-size: 13px;
  color: var(--text-3);
  min-width: 44px;
  text-align: center;
}
.ann-nav.hidden { display: none; }

/* ─── Profile page ───────────────────────────────────────────────────────── */
#profile-page {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: var(--nav-w);
  background: var(--surface);
  z-index: 200;
  overflow-y: auto;
  animation: ppIn .18s ease;
}

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

.pp-topbar {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 10;
  box-shadow: var(--shadow-xs);
}

.pp-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--r);
  background: none;
  border: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.pp-back:hover { background: var(--bg); color: var(--text); }

.pp-breadcrumb {
  font-size: 13px;
  color: var(--text-3);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pp-breadcrumb span { color: var(--text-2); }

.pp-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 44px 48px 64px;
  display: grid;
  grid-template-columns: 280px 1fr 260px;
  gap: 40px;
  align-items: start;
}

/* Home page variant: no sticky left column */
.pp-body--home {
  padding-top: 24px;
}

/* ── Left column ── */
.pp-left {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.pp-body--home .pp-left {
  position: static;
}

/* ── Center column ── */
.pp-center {
  min-width: 0;
}

/* ── Right column ── */
.pp-right {
  min-width: 0;
}

/* Portrait photo (200×240, like Ozon) */
.pp-photo {
  width: 200px;
  height: 240px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
  background: var(--bg);
}
.pp-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

.pp-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.pp-job {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 12px;
  line-height: 1.4;
}

/* ── Presence status ── */
.pp-presence {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  margin-top: -8px;
}

.pp-presence-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px #fff;
}

[data-theme="dark"] .pp-presence-dot { box-shadow: 0 0 0 2px var(--surface); }

.pp-presence-label {
  font-size: 12.5px;
  color: var(--text-3);
}

.pp-dept-tag {
  display: inline-block;
  padding: 4px 13px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 28px;
}

.pp-dept-tag--link {
  cursor: pointer;
  transition: opacity var(--transition);
}

.pp-dept-tag--link:hover { opacity: 0.75; }

/* Inline link in row value */
.pp-inline-link {
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
}

.pp-inline-link:hover { text-decoration: underline; }

.pp-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.pp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  text-decoration: none !important;
  transition: background var(--transition), box-shadow var(--transition), opacity var(--transition);
  width: 100%;
}

.pp-btn--teams {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,120,212,.25);
}
.pp-btn--teams:hover { background: var(--blue-dark); box-shadow: 0 4px 12px rgba(0,120,212,.3); }

.pp-btn--email {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.pp-btn--email:hover { background: var(--bg); }

/* ── Right column ── */
.pp-section {
  margin-bottom: 36px;
}

.pp-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-bottom: 12px;
  margin-bottom: 2px;
  border-bottom: 1.5px solid var(--border);
}

.pp-companies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
}
.pp-company-tag {
  display: inline-flex;
  align-items: center;
  background: #F0F0F3;
  color: #404154;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
}
[data-theme="dark"] .pp-company-tag {
  background: #2D2D3A;
  color: #ACADBB;
}

.pp-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-soft);
  align-items: center;
}
.pp-row:last-child { border-bottom: none; }

.pp-row-label {
  font-size: 13px;
  color: var(--text-3);
}

.pp-row-value {
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}
.pp-row-value a  { color: var(--blue); }
.pp-row-value a:hover { text-decoration: underline; }
.pp-row-value.pp-empty { color: var(--text-3); }

/* Manager card */
.pp-manager {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  text-decoration: none !important;
  margin-top: 14px;
}
.pp-manager:hover { background: var(--bg); border-color: var(--blue-mid); }

.pp-manager-av {
  width: 48px; height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  overflow: hidden;
}
.pp-manager-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.pp-manager-info { flex: 1; min-width: 0; }
.pp-manager-name  { font-size: 14px; font-weight: 600; color: var(--text); }
.pp-manager-title { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.pp-manager-arrow { color: var(--text-3); flex-shrink: 0; }

/* ── Team list in right column ── */
.pp-team-list {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
}

.pp-team-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  width: 100%;
  transition: background var(--transition);
  color: var(--text);
}

.pp-team-member:hover { background: #FEF9F4; }
[data-theme="dark"] .pp-team-member:hover { background: #2D1F0F; }

.pp-team-av {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
}

.pp-team-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.pp-team-info { flex: 1; min-width: 0; }

.pp-team-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pp-team-title {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.pp-team-more {
  margin-top: 6px;
  padding: 8px 10px;
  border: none;
  background: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  transition: background var(--transition);
  text-align: left;
}

.pp-team-more:hover { background: rgba(224,134,64,.08); }

/* Dark mode */
[data-theme="dark"] .pp-photo { box-shadow: 0 4px 24px rgba(0,0,0,.5); }
[data-theme="dark"] .pp-btn--teams { box-shadow: 0 2px 8px rgba(0,0,0,.35); }
[data-theme="dark"] .pp-btn--email { border-color: var(--border); background: var(--bg); }
[data-theme="dark"] .pp-btn--email:hover { background: var(--border); }
[data-theme="dark"] .pp-dept-tag { background: rgba(224,134,64,.14); }
[data-theme="dark"] .pp-manager { border-color: var(--border); }
[data-theme="dark"] .pp-manager:hover { border-color: var(--blue-mid); background: var(--bg); }

/* Responsive */
@media (max-width: 1080px) {
  .pp-body {
    grid-template-columns: 240px 1fr;
    grid-template-rows: auto auto;
    padding-left: 32px;
    padding-right: 32px;
  }
  .pp-right {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }
  .pp-right .pp-section { margin-bottom: 0; }
}

@media (max-width: 820px) {
  .pp-body {
    grid-template-columns: 1fr;
    padding: 24px 20px 48px;
    gap: 28px;
  }
  .pp-left { position: static; align-items: center; text-align: center; }
  .pp-photo { width: 160px; height: 192px; font-size: 52px; }
  .pp-actions { max-width: 280px; }
  .pp-topbar { padding: 0 20px; }
  .pp-right { grid-template-columns: 1fr; }
}

/* ─── Login screen ───────────────────────────────────────────────────────── */
.login-screen {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #F0F0F3;
  overflow: hidden;
}

.login-bg-logo {
  position: absolute;
  top: -100px;
  left: -100px;
  width: 600px;
  height: 600px;
  background: url('/assets/logo.png') no-repeat center / contain;
  opacity: 0.04;
  pointer-events: none;
  user-select: none;
}

.login-card {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 24px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(64, 65, 84, 0.15);
  max-width: 420px;
  width: calc(100% - 32px);
}

.login-logo-img {
  height: 60px;
  width: auto;
  object-fit: contain;
  margin-bottom: 20px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.login-company {
  font-size: 22px;
  font-weight: 600;
  color: #404154;
  margin-bottom: 4px;
}

.login-portal-label {
  font-size: 14px;
  color: #86879B;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
}

.login-divider {
  height: 1px;
  background: #F0F0F3;
  margin: 24px 0;
}

.login-hint {
  font-size: 14px;
  color: #86879B;
  line-height: 1.5;
  margin-bottom: 20px;
}

.btn-ms {
  background: #E08640;
  color: #fff;
  height: 52px;
  padding: 0 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  border: none;
  width: 100%;
  font-family: inherit;
  transition: background var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 16px rgba(224, 134, 64, 0.35);
}

.btn-ms:hover {
  background: #c9732d;
  box-shadow: 0 6px 20px rgba(224, 134, 64, 0.45);
  text-decoration: none;
  color: #fff;
}

.login-footer {
  margin-top: 20px;
  font-size: 12px;
  color: #ACADBB;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
    border-radius: 20px;
  }
}

/* ─── Admin area ─────────────────────────────────────────────────────────── */
.admin-section { margin-bottom: 28px; }
.admin-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Birthday admin table */
.bd-av {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.bd-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
#bd-table-wrap tbody tr:hover { background: var(--bg); }
#bd-table-wrap tbody tr { border-bottom: 1px solid var(--border-soft); transition: background .1s; }
#bd-table-wrap tbody tr:last-child { border-bottom: none; }

/* Role badges */
.role-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
}
.role-badge--employee { background: var(--bg); color: var(--text-3); border: 1px solid var(--border); }
.role-badge--writer   { background: rgba(59,130,246,.1); color: #3b82f6; }
.role-badge--admin    { background: rgba(224,134,64,.12); color: var(--primary); }
.role-badge--superAdmin { background: rgba(168,85,247,.12); color: #a855f7; }

/* Roles admin table hover */
#roles-tbody tr:hover { background: var(--bg); }
#roles-tbody tr { transition: background .1s; }

/* Sync log entries */
.sync-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
}

.sync-entry:last-child { border-bottom: none; }

.sync-status {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Sync status card (new inline status) ───────────────────────────────── */
.sync-status-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sync-status-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
}

.sync-badge--ok  { background: rgba(34,197,94,.12);  color: #16a34a; }
.sync-badge--err { background: rgba(239,68,68,.10);  color: #dc2626; }
[data-theme="dark"] .sync-badge--ok  { background: rgba(34,197,94,.18);  color: #4ade80; }
[data-theme="dark"] .sync-badge--err { background: rgba(239,68,68,.18);  color: #f87171; }

.sync-count {
  font-size: 12.5px;
  color: var(--text-2);
}

.sync-last-line {
  font-size: 13px;
  color: var(--text-2);
}

.sync-last-line strong {
  color: var(--text-1);
  font-weight: 500;
}

.sync-ago {
  font-size: 12px;
  color: var(--text-3);
}

.sync-error-text {
  font-size: 12px;
  color: var(--danger);
  margin-top: 2px;
}

/* Spinner animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.sync-spinner {
  animation: spin .9s linear infinite;
  flex-shrink: 0;
}

/* ─── Portal settings admin ──────────────────────────────────────────────── */
.settings-logo-preview {
  width: 80px;
  height: 80px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  overflow: hidden;
}
.settings-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}
.settings-color-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
input[type="color"].form-input {
  width: 56px;
  height: 36px;
  padding: 2px 4px;
  cursor: pointer;
}


@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: none; }
  .main-wrap { margin-left: 0; }
  .main { padding: 20px 16px; }
  .modal { max-width: 100%; }
  #profile-page { left: 0; }
}


/* ─── Dark theme ─────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --primary:      #e8954a;
  --primary-dark: #c9773a;
  --accent:       #303347;
  --blue-light:   #2d1f0e;
  --blue-mid:     #3d2810;

  --teams:       #8e92cc;
  --teams-dark:  #7476b8;

  --green:       #57b857;
  --green-light: #162a16;

  --danger:       #e05555;
  --danger-light: #2d1616;
  --warn-bg:      #2a2010;
  --warn-text:    #d4a234;

  --bg:          #111318;
  --surface:     #1c1f27;
  --border:      #2e3340;
  --border-soft: #242830;

  --text:   #eaedf2;
  --text-2: #9098a9;
  --text-3: #636b78;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.65);
}

/* Dark mode sidebar adaptations */
[data-theme="dark"] .sidebar { background: #23243a; border-right-color: #2e3340; }
[data-theme="dark"] .sidebar-logo { border-bottom-color: #2e3340; }
[data-theme="dark"] .sidebar-logo-text { color: #eaedf2; }
[data-theme="dark"] .nav-section { color: #636b78; }
[data-theme="dark"] .nav-item { color: #9098a9; }
[data-theme="dark"] .nav-item svg { color: #636b78; }
[data-theme="dark"] .nav-item:hover { background: rgba(255,255,255,.06); color: #eaedf2; }
[data-theme="dark"] .nav-item:hover svg { color: #eaedf2; }
[data-theme="dark"] .nav-item.active { background: #E08640; color: #fff; }
[data-theme="dark"] .nav-item.active svg { color: #fff; }

[data-theme="dark"] .login-screen {
  background: #1a1b22;
}

[data-theme="dark"] .login-card {
  background: #24252f;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .login-company { color: #e8e9f0; }
[data-theme="dark"] .login-divider { background: #33343f; }

[data-theme="dark"] .announcement.pinned {
  background: linear-gradient(to right, #2b2008, var(--surface));
  border-left-color: #b8880a;
}

[data-theme="dark"] .bd-card-badge-soon {
  background: #3d3000;
  color: #f0c040;
}

[data-theme="dark"] .bd-month-row.bd-month-today {
  background: rgba(224, 134, 64, 0.13);
}

[data-theme="dark"] .btn-ms {
  box-shadow: 0 4px 16px rgba(224, 134, 64, 0.25);
}


[data-theme="dark"] input[type="file"].form-input {
  color: var(--text-2);
}

