/* ==========================================================================
   AIOFFICE UNIFIED MENU & UNIVERSAL CROSS-OFFICE SETTINGS PAGE
   100% identical across Podpora, Release & Deploy, Vzdrževanje, Analitika
   ========================================================================== */
.aio-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.aio-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 35px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  user-select: none;
}

.aio-menu-btn:hover { background: #f8fafc; border-color: #94a3b8; }
.aio-menu-btn.open { background: #f1f5f9; border-color: #64748b; box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.14); }
.aio-menu-btn svg { width: 15px; height: 15px; color: #475569; flex-shrink: 0; }
.aio-menu-caret { font-size: 10px; color: #64748b; margin-left: 1px; }

.aio-menu-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 248px;
  max-width: calc(100vw - 20px);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 13px;
  box-shadow: 0 18px 40px -10px rgba(15, 23, 42, 0.2), 0 4px 12px rgba(15, 23, 42, 0.06);
  z-index: 2500;
  overflow: hidden;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.aio-menu-panel.open { display: block; animation: aioPopIn 0.12s ease-out; }
@keyframes aioPopIn { from { opacity: 0; transform: translateY(-4px) scale(0.99); } to { opacity: 1; transform: translateY(0) scale(1); } }

.aio-menu-userbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 11px 13px; background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.aio-menu-user-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.aio-menu-avatar {
  width: 29px; height: 29px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: #ffffff; font-size: 13px; font-weight: 800; flex-shrink: 0;
}
.aio-menu-username { font-size: 13px; font-weight: 800; color: #0f172a; line-height: 1.2; }
.aio-menu-usersub { font-size: 11px; color: #64748b; font-weight: 500; }
.aio-menu-sso-pill {
  font-size: 10px; font-weight: 800; color: #15803d; background: #dcfce7;
  border: 1px solid #86efac; padding: 2px 7px; border-radius: 999px; white-space: nowrap;
}
.aio-menu-list { padding: 5px; }
.aio-menu-item {
  width: 100%; border: none; background: transparent; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px; cursor: pointer; text-align: left;
  transition: background 0.12s ease; font-family: inherit;
}
.aio-menu-item:hover { background: #f1f5f9; }
.aio-menu-ico {
  width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; border: 1px solid #e2e8f0; background: #f8fafc;
}
.aio-menu-title { font-size: 13px; font-weight: 700; color: #0f172a; line-height: 1.25; }
.aio-menu-sep { height: 1px; background: #e2e8f0; margin: 0; }
.aio-menu-item.danger:hover { background: #fef2f2; }
.aio-menu-item.danger .aio-menu-title { color: #dc2626; }
.aio-menu-item.danger .aio-menu-ico { background: #fef2f2; border-color: #fecaca; }

/* ==========================================================================
   UNIVERSAL SETTINGS PAGE VIEW (INLINE PAGE BELOW .topbar)
   ========================================================================== */
#appScreen.aio-settings-open { height: 100dvh !important; overflow: hidden !important; }
#appScreen.aio-settings-open > :not(.topbar):not(#aioSettingsPageView) { display: none !important; }
#appScreen.aio-settings-open > #aioSettingsPageView { display: flex !important; }

.aio-settings-page {
  display: none; flex-direction: column; flex: 1; min-height: 0; width: 100%;
  background: #f1f5f9; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #0f172a; overflow: hidden;
}

.aio-sp-header {
  background: #ffffff; border-bottom: 1px solid #cbd5e1; flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}
.aio-sp-header-inner { max-width: 1180px; width: 100%; margin: 0 auto; padding: 14px 24px 0; }
.aio-sp-toprow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.aio-sp-title-group { display: flex; align-items: center; gap: 12px; min-width: 0; }

.aio-sp-back-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px;
  border-radius: 8px; border: 1px solid #cbd5e1; background: #f8fafc; color: #0f172a;
  font-family: inherit; font-size: 12.8px; font-weight: 700; cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease; flex-shrink: 0;
}
.aio-sp-back-btn:hover { background: #e2e8f0; border-color: #94a3b8; }
.aio-sp-divider { width: 1px; height: 22px; background: #cbd5e1; flex-shrink: 0; }
.aio-sp-heading { font-size: 17px; font-weight: 800; color: #0f172a; letter-spacing: -0.01em; line-height: 1.2; }
.aio-sp-sub { font-size: 12px; color: #64748b; font-weight: 500; margin-top: 1px; }

.aio-hub-tabs { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: thin; }
.aio-hub-tab {
  border: none; border-bottom: 2.5px solid transparent; background: transparent; color: #475569;
  padding: 9px 14px 10px; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; border-radius: 8px 8px 0 0;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.aio-hub-tab:hover { color: #0f172a; background: #f8fafc; }
.aio-hub-tab.active { color: #0f172a; border-bottom-color: var(--tab-col, #2563eb); background: #f8fafc; }
.aio-hub-tab-pill { font-size: 10px; font-weight: 800; padding: 1.5px 6px; border-radius: 999px; }

.aio-sp-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.aio-sp-container { max-width: 1180px; width: 100%; margin: 0 auto; padding: 20px 24px 56px; }

.aio-subpills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.aio-subpill {
  border: 1px solid #cbd5e1; background: #ffffff; color: #334155; border-radius: 999px;
  padding: 6px 13px; font-family: inherit; font-size: 12.3px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: all 0.12s ease;
}
.aio-subpill:hover { background: #f8fafc; border-color: #94a3b8; }
.aio-subpill.active { background: #0f172a; border-color: #0f172a; color: #ffffff; }

.aio-card {
  background: #ffffff; border: 1px solid #cbd5e1; border-radius: 13px; margin-bottom: 16px;
  overflow: hidden; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.aio-card-head {
  padding: 13px 18px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center;
  justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.aio-card-title { font-size: 14.2px; font-weight: 800; color: #0f172a; }
.aio-card-sub { font-size: 12px; color: #475569; margin-top: 2px; }
.aio-card-body { padding: 16px 18px; }

.aio-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800;
  padding: 3.5px 10px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
}
.aio-b-ok { background: #dcfce7; color: #15803d; border-color: #86efac; }
.aio-b-warn { background: #fef3c7; color: #b45309; border-color: #fcd34d; }
.aio-b-muted { background: #f1f5f9; color: #64748b; border-color: #cbd5e1; }
.aio-b-violet { background: #f3e8ff; color: #6d28d9; border-color: #d8b4fe; }
.aio-b-blue { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }

.aio-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.aio-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.aio-split { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.aio-side-list { display: flex; flex-direction: column; gap: 6px; }
.aio-side-item {
  border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 10px; padding: 9px 11px;
  cursor: pointer; text-align: left; transition: all 0.12s ease;
}
.aio-side-item:hover { border-color: #94a3b8; background: #ffffff; }
.aio-side-item.active { border-color: #2563eb; background: #eff6ff; box-shadow: 0 0 0 2px rgba(37,99,235,0.12); }

.aio-app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 7px; max-height: 230px; overflow-y: auto; padding: 4px 2px; }
.aio-app-chk {
  display: flex; align-items: center; gap: 8px; padding: 6px 9px; border: 1px solid #e2e8f0;
  border-radius: 8px; background: #f8fafc; font-size: 12px; font-weight: 600; cursor: pointer;
}
.aio-app-chk img { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; flex-shrink: 0; }

.aio-tbl-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 10px; }
.aio-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #ffffff; }
.aio-tbl th { background: #f8fafc; color: #475569; font-weight: 800; text-align: left; padding: 9px 11px; border-bottom: 1px solid #e2e8f0; font-size: 11.3px; text-transform: uppercase; }
.aio-tbl td { padding: 8px 11px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.aio-tbl tr:last-child td { border-bottom: none; }
.aio-tbl .num { text-align: right; }

.aio-field { display: flex; flex-direction: column; gap: 5px; }
.aio-field label { font-size: 12px; font-weight: 700; color: #334155; }
.aio-field input:not([type="checkbox"]), .aio-field select, .aio-field textarea {
  width: 100%; box-sizing: border-box; padding: 8.5px 11px; border: 1px solid #cbd5e1;
  border-radius: 8px; font-size: 13px; font-family: inherit; color: #0f172a; background: #ffffff;
}
.aio-field input:focus, .aio-field select:focus, .aio-field textarea:focus {
  outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.aio-stat-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; }
.aio-stat-lbl { font-size: 10.8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: #64748b; }
.aio-stat-val { font-size: 15.5px; font-weight: 800; color: #0f172a; margin-top: 2px; }
.aio-stat-sub { font-size: 11.2px; color: #64748b; margin-top: 1px; }

.aio-meter { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin: 7px 0 12px; }
.aio-meter-fill { height: 100%; border-radius: 999px; transition: width 0.25s ease; }

.aio-actions-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.aio-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px;
  border-radius: 8px; font-family: inherit; font-size: 12.8px; font-weight: 700; cursor: pointer;
  border: 1px solid #cbd5e1; background: #ffffff; color: #1e293b; text-decoration: none;
  transition: background 0.13s ease, opacity 0.13s ease;
}
.aio-btn:hover { background: #f1f5f9; }
.aio-btn:disabled { opacity: 0.58; cursor: not-allowed; }
.aio-btn-xs { padding: 5px 10px; font-size: 11.8px; }
.aio-btn-blue { background: #2563eb; border-color: #2563eb; color: #ffffff; }
.aio-btn-blue:hover { background: #1d4ed8; }
.aio-btn-green { background: #15803d; border-color: #15803d; color: #ffffff; }
.aio-btn-green:hover { background: #166534; }
.aio-btn-amber { background: #d97706; border-color: #d97706; color: #ffffff; }
.aio-btn-amber:hover { background: #b45309; }
.aio-btn-violet { background: #7c3aed; border-color: #7c3aed; color: #ffffff; }
.aio-btn-violet:hover { background: #6d28d9; }
.aio-btn-dark { background: #0f172a; border-color: #0f172a; color: #ffffff; }
.aio-btn-dark:hover { background: #1e293b; }
.aio-btn-danger-outline { color: #b91c1c; border-color: #fca5a5; background: #ffffff; }
.aio-btn-danger-outline:hover { background: #fef2f2; }
.aio-msg { font-size: 12.3px; font-weight: 700; margin-top: 8px; }

@media (max-width: 860px) {
  .aio-split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .aio-sp-header-inner { padding: 10px 12px 0; }
  .aio-sp-container { padding: 14px 12px 40px; }
  .aio-sp-sub { display: none; }
  .aio-grid-2, .aio-grid-3 { grid-template-columns: 1fr; }
  .aio-hub-tab { padding: 8px 11px 9px; font-size: 12.2px; }
}