/*
 * Custom Guacamole Theme — simple, practical, human-friendly.
 * Targets Apache Guacamole 1.6.0. Overrides only; no layout breakage.
 */

:root {
  /* Theme (DPMIS-aligned) */
  --theme-bg-primary: #f8fafc;
  --theme-bg-secondary: #ffffff;
  --theme-bg-card: #ffffff;
  --theme-text-primary: #111827;
  --theme-text-secondary: #6b7280;
  --theme-accent: #2563eb;
  --theme-accent-hover: #1d4ed8;
  --theme-accent-soft: rgba(37, 99, 235, 0.12);
  --theme-success: #10b981;
  --theme-warning: #f59e0b;
  --theme-danger: #dc2626;
  --theme-border: #e5e7eb;
  --theme-shadow: 0 1px 3px rgba(0,0,0,0.08);
  --theme-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --theme-radius: 0.5rem;
  --theme-radius-lg: 0.75rem;
  --theme-spacing: 8px;
  /* DPMIS design-system compatibility */
  --dpmis-primary: #2563eb;
  --dpmis-radius-md: 0.5rem;
  --dpmis-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --dpmis-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px rgb(0 0 0 / 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --theme-bg-primary: #1a1a1a;
    --theme-bg-secondary: #262626;
    --theme-bg-card: #262626;
    --theme-text-primary: #f5f5f5;
    --theme-text-secondary: #a3a3a3;
    --theme-border: #404040;
    --theme-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }
}

/* --- Global: Source Sans 3 (match resources/DPMIS AdminLTE) --- */
body {
  background: var(--theme-bg-primary);
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--theme-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App shell: DPMIS-style background (light gradient) */
body.home,
body.settings,
body.manage,
body.client {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
}

/* Layout: fixed overlay in body so Angular never removes it */
.guac-layout-wrapper {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "nav nav" "side main" "foot foot";
}
body:has(div[ng-switch-when="ready"]) .guac-layout-wrapper {
  display: grid;
}
.guac-layout-navbar,
.guac-layout-sidebar,
.guac-layout-footer {
  pointer-events: auto;
}
.guac-layout-navbar { grid-area: nav; }
.guac-layout-sidebar { grid-area: side; }
.guac-layout-footer { grid-area: foot; }

/* Client/session window: hide navbar, sidebar, footer for full space (SSH/RDP) */
body.guac-client-window .guac-layout-navbar,
body.guac-client-window .guac-layout-sidebar,
body.guac-client-window .guac-layout-footer {
  display: none !important;
}

/* Main content offset so it sits in the "hole" below navbar and right of sidebar */
body > div[ng-switch-when="ready"] {
  position: relative;
  min-height: 100vh;
  padding-top: 4rem;
  margin-left: 220px;
  padding-bottom: 3.5rem;
  box-sizing: border-box;
}

/* Client window: full-bleed so terminal/RDP uses full viewport */
body.guac-client-window > div[ng-switch-when="ready"] {
  padding-top: 0;
  margin-left: 0;
  padding-bottom: 0;
  min-height: 100vh;
}

/* Modal overlay on top of layout */
body > div[ng-switch-when="ready"] > guac-modal {
  z-index: 1000;
}

.global-app-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(to right, #1f2937 0%, #6b7280 100%);
  color: #fff;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  padding: 0 1rem;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.navbar-coat-of-arms {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 0.5rem;
}

.navbar-coat-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
}

.navbar-republic {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.95;
  margin-top: 2px;
}

.navbar-brand {
  display: flex;
  flex-direction: column;
  margin-left: 0.25rem;
}

.navbar-brand-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.navbar-brand-sub {
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.95;
}

.navbar-user {
  margin-right: 1rem;
}

/* Sidebar: compact, light container (DPMIS sidebar-container) */
.global-admin-sidebar {
  grid-area: side;
  width: 220px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
  border-right: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}

.sidebar-inner {
  padding: 0.5rem 0.75rem;
}

.sidebar-section {
  margin-bottom: 0.75rem;
}

.menu-section-header {
  padding: 0.5rem 0.75rem 0.35rem;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  margin: 0 4px 6px 4px;
}

.sidebar-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav-list li {
  margin: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  margin: 2px 4px;
  border-radius: 8px;
  color: #6b7280;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.8125rem;
  position: relative;
}

.sidebar-link:hover {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #374151;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sidebar-link.active {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
  transform: translateX(4px);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 0 2px 2px 0;
}

.sidebar-link-icon {
  width: 1.1rem;
  margin-right: 8px;
  font-size: 0.875rem;
}

.sidebar-link-text {
  font-size: 0.8125rem;
  font-weight: 500;
}

#content {
  min-width: 0;
  padding: 1.5rem;
  font-size: 0.875rem;
  overflow: auto;
}

/* Connections panel overlays content; main area is not a grid anymore */
#other-connections {
  position: absolute;
  top: 4rem;
  left: 220px;
  right: 0;
  bottom: 3.5rem;
  z-index: 10;
  pointer-events: none;
}
body.guac-client-window #other-connections {
  top: 0;
  left: 0;
  bottom: 0;
}
body > div[ng-switch-when="ready"] {
  position: relative;
}
#other-connections .client-panel {
  pointer-events: auto;
}

/* Dashboard (home) — Dashboard vs My Connections split */
.dashboard-home-section {
  margin-bottom: 1.5rem;
  padding: 0 0.75rem;
  max-width: 100%;
}

/* Dashboard view: show only metrics; hide connection list */
body:not(.home-connections-view) .connection-list-ui {
  display: none !important;
}

/* My Connections view: hide entire dashboard (heading, metrics, chart); show only table */
body.home-connections-view .dashboard-home-section {
  display: none !important;
}

.dashboard-heading {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--theme-text-primary);
  margin: 0 0 1.25rem 0;
  letter-spacing: -0.02em;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {
  .dashboard-metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .dashboard-metrics { grid-template-columns: 1fr; }
}

.dashboard-chart-section {
  background: var(--theme-bg-card);
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--dpmis-shadow-sm);
  max-width: 420px;
}

.dashboard-chart-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--theme-text-primary);
  margin: 0 0 1rem 0;
}

.dashboard-chart-container {
  position: relative;
  height: 220px;
}

.dashboard-chart-wrap {
  position: relative;
  height: 100%;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

.dashboard-chart-wrap canvas {
  max-height: 220px;
  max-width: 320px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.5rem;
  background: var(--theme-bg-card);
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius-lg);
  box-shadow: var(--dpmis-shadow-sm);
  text-decoration: none;
  color: var(--theme-text-primary);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.metric-card:hover {
  box-shadow: var(--dpmis-shadow-md);
  border-color: var(--theme-accent);
}

.metric-value {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--theme-accent);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.25rem;
}

.metric-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--theme-text-primary);
  margin-bottom: 0.5rem;
}

.metric-link {
  font-size: 0.8125rem;
  color: var(--theme-text-secondary);
}
.metric-card:hover .metric-link {
  color: var(--theme-accent);
}

.global-app-footer {
  grid-area: foot;
  background: #1f2937;
  color: #fff;
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.global-app-footer .footer-text {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
}

@media (max-width: 1080px) {
  body > div[ng-switch-when="ready"] {
    grid-template-columns: 1fr;
    grid-template-areas: "nav" "side" "main" "foot";
  }

  .global-admin-sidebar {
    width: 100%;
  }

  #other-connections {
    grid-column: 1;
    grid-row: auto;
  }
}

.view {
  color: var(--theme-text-primary);
}

/* --- Login screen --- */
div.login-ui {
  background: var(--theme-bg-primary);
}

.login-ui .login-dialog-middle {
  padding: 16px;
}

.login-ui .login-dialog {
  max-width: 22em;
  padding: 24px;
  font-size: 1rem;
  background: var(--theme-bg-card);
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius);
  box-shadow: var(--theme-shadow);
}

.login-ui .login-dialog .login-form {
  padding-top: 0;
}

/* Single branding in custom header only; hide duplicate logo and app name in dialog */
.login-ui .login-dialog .logo,
.login-ui .login-dialog .version {
  display: none !important;
}

.login-ui .login-dialog .login-fields input {
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  font-size: 1rem;
  background: var(--theme-bg-primary);
  color: var(--theme-text-primary);
}

.login-ui .login-dialog .login-fields input:focus {
  outline: none;
  border-color: var(--theme-accent);
  background: var(--theme-bg-card);
}

.login-ui .login-dialog .buttons {
  margin-top: 20px;
}

.login-ui .login-dialog .buttons input[type="submit"] {
  width: 100%;
  padding: 10px 16px;
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  background: var(--theme-accent);
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.login-ui .login-dialog .buttons input[type="submit"]:hover {
  background: var(--theme-accent-hover);
}

.login-ui .login-dialog .buttons input[type="submit"]:active {
  opacity: 0.95;
}

.login-ui.error p.login-error {
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #b91c1c;
  border-radius: 6px;
}

/* --- Custom login header/footer (from HTML patches) --- */
.custom-login-header,
.custom-login-footer {
  text-align: center;
  padding: 12px 16px;
  color: var(--theme-text-secondary);
  font-size: 0.875rem;
}

.custom-login-header h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--theme-text-primary);
}

.custom-login-header .login-logo {
  max-height: 96px;
  width: auto;
  margin-bottom: 12px;
  vertical-align: middle;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.custom-login-footer a {
  color: var(--theme-accent);
  text-decoration: none;
}

.custom-login-footer a:hover {
  text-decoration: underline;
}

/* --- App headers and menu --- */
.header {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border-bottom: 1px solid #dbe7ff;
  box-shadow: 0 4px 14px rgba(30, 64, 175, 0.08);
  backdrop-filter: blur(6px);
}

.header h2 {
  color: var(--theme-text-primary);
  font-weight: 600;
  text-transform: none;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.header .filter input {
  border: 1px solid var(--theme-border);
  border-radius: 10px;
  background: var(--theme-bg-primary);
  color: var(--theme-text-primary);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header .filter input:focus {
  outline: none;
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 3px var(--theme-accent-soft);
}

/* Filter / Search: icon only, no visible text */
.filter .search-string::placeholder {
  color: transparent;
  opacity: 0;
}

.filter input.search-button,
.filter input[type="submit"],
.filter button[type="submit"] {
  font-size: 0 !important;
  color: transparent !important;
  text-indent: -9999px;
  overflow: hidden;
  width: 2.5rem;
  min-width: 2.5rem;
  height: 2.25rem;
  padding: 0 !important;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") center no-repeat !important;
  background-size: 1.25rem !important;
  border-radius: 8px;
}

.menu {
  background: linear-gradient(180deg, #172554 0%, #1e3a8a 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 10px 0 28px rgba(15, 23, 42, 0.35);
  color: #e5edff;
}

.menu-content .header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  box-shadow: none;
}

.menu-body {
  padding: 16px;
}

.menu-section h3 {
  color: rgba(226, 232, 255, 0.85);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 16px 0 8px;
  padding: 0 4px;
}

/* --- Connection list (home and client panel) --- */
.list-item .name {
  color: var(--theme-text-primary);
}

.list-item.selected {
  background: var(--theme-accent-soft);
  border-radius: 6px;
}

.list-item:not(.selected) .caption:hover {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
}

.recent-connections .connection,
.all-connections .connection {
  border-radius: var(--theme-radius);
  border: 1px solid var(--theme-border);
  background: var(--theme-bg-card);
  box-shadow: var(--theme-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.recent-connections .connection:hover,
.all-connections .connection .caption:hover {
  border-color: var(--theme-accent);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.15);
}

.recent-connections .connection:hover {
  transform: translateY(-1px);
}

.expandable.expanded > .children > .list-item:before {
  border-left-color: var(--theme-border);
}

.expandable.expanded > .children > .list-item:after {
  border-bottom-color: var(--theme-border);
}

/* --- Home page: cleaner cards + OS protocol icons --- */
.home-view.view {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.home-view .home-admin-sidebar {
  width: 250px;
  min-width: 250px;
  position: sticky;
  top: 12px;
  background: linear-gradient(180deg, #0f172a, #1e293b);
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.35);
  padding: 12px;
}

.home-view .home-admin-sidebar .sidebar-title {
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 8px 10px;
}

.home-view .home-admin-sidebar .sidebar-subtitle {
  color: rgba(203, 213, 225, 0.78);
  font-size: 0.78rem;
  padding: 0 8px 10px;
}

.home-view .home-admin-sidebar .sidebar-quick-actions {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.home-view .home-admin-sidebar .quick-action {
  display: block;
  text-decoration: none;
  text-align: center;
  padding: 9px 10px;
  border-radius: 10px;
  color: #f8fbff;
  font-weight: 500;
  border: 1px solid rgba(96, 165, 250, 0.5);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.45), rgba(29, 78, 216, 0.55));
  box-shadow: 0 8px 18px rgba(30, 64, 175, 0.28);
}

.home-view .home-admin-sidebar .quick-action:hover {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.58), rgba(37, 99, 235, 0.65));
}

.home-view .home-admin-sidebar .sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-view .home-admin-sidebar .sidebar-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #e2e8f0;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.home-view .home-admin-sidebar .sidebar-nav a:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(96, 165, 250, 0.4);
  transform: translateX(2px);
}

.home-view .home-admin-sidebar .sidebar-nav a::before {
  display: inline-block;
  width: 1.2em;
  margin-right: 8px;
  opacity: 0.88;
}

.home-view .home-admin-sidebar .sidebar-nav a.nav-sessions::before { content: "S"; }
.home-view .home-admin-sidebar .sidebar-nav a.nav-history::before { content: "H"; }
.home-view .home-admin-sidebar .sidebar-nav a.nav-users::before { content: "U"; }
.home-view .home-admin-sidebar .sidebar-nav a.nav-groups::before { content: "G"; }
.home-view .home-admin-sidebar .sidebar-nav a.nav-connections::before { content: "C"; }
.home-view .home-admin-sidebar .sidebar-nav a.nav-preferences::before { content: "P"; }

.home-view .connection-list-ui {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 1080px) {
  .home-view.view {
    flex-direction: column;
  }

  .home-view .home-admin-sidebar {
    width: 100%;
    min-width: 0;
    position: static;
  }

  .home-view .home-admin-sidebar .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
  }
}

/* Recent connections — card grid, modern look */
.home-view .recent-connections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  text-align: left;
  margin-top: 0.75rem;
}

.home-view .recent-connections .connection {
  margin: 0;
  max-width: none;
  width: 100%;
  padding: 0;
  position: relative;
  border-radius: 10px;
  overflow: visible;
  background: var(--theme-bg-card);
  border: 1px solid var(--theme-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-view .recent-connections .connection > a {
  overflow: hidden;
  border-radius: 10px;
}

.home-view .recent-connections .connection:hover {
  border-color: var(--theme-accent);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.home-view .recent-connections .connection > a {
  display: block;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
}

.home-view .recent-connections .connection .thumbnail {
  width: 100%;
  aspect-ratio: 16/10;
  background: #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-view .recent-connections .connection .thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-view .recent-connections .connection .caption {
  padding: 0;
}

.home-view .recent-connections .connection .name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--theme-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-view .recent-connections .connection .remove-recent {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--theme-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.home-view .recent-connections .connection .remove-recent:hover {
  opacity: 1;
  background: #fff;
}

.home-view .recent-connections .connection .remove-recent::after {
  content: "";
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E") center/contain no-repeat;
}

.home-view .recent-connections .placeholder {
  grid-column: 1 / -1;
  color: var(--theme-text-secondary);
  font-size: 0.875rem;
  padding: 1rem 0;
}

/* Limit Recent Connections cards to at most 5 visually */
.home-view .recent-connections .connection:nth-of-type(n+6) {
  display: none;
}

.home-view .all-connections .connection > .caption,
.home-view .all-connections .connection-group > .caption {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
}

.home-view .all-connections .connection > .caption .name,
.home-view .all-connections .connection-group > .caption .name {
  flex: 1 1 auto;
  margin-left: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-view .all-connections .connection > .caption .activeUserCount {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--theme-text-secondary);
}

.home-view .all-connections .connection .icon.type {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 6px;
  background-color: rgba(37, 99, 235, 0.08);
  background-size: 18px 18px;
}

.home-view .all-connections .connection .icon.type.ssh,
.home-view .all-connections .connection .icon.type.telnet,
.home-view .all-connections .connection .icon.type.kubernetes {
  background-image: url('app/ext/custom-guacamole-theme/images/linux.svg');
}

.home-view .all-connections .connection .icon.type.rdp {
  background-image: url('app/ext/custom-guacamole-theme/images/windows.svg');
}

/* All Connections: container card for header + rows */
.home-view .all-connections {
  display: block;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--theme-border);
  box-shadow: var(--theme-shadow);
  background: #fff;
  counter-reset: row 0;
  font-size: 0.875rem;
}

/* Use upstream DOM structure for groups/rows; no display:contents hacks */

/* Group row: one cell spanning all columns */
.home-view .all-connections .home-group-row-cell {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 14px;
  border-bottom: 1px solid #eef2f6;
  background: #f8fafc;
  font-weight: 500;
  color: var(--theme-text-primary);
}

.home-view .all-connections .home-group-row-cell .icon.balancer {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.12);
}

.home-view .all-connections .home-group-row-cell .name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pager below grid: span full width */
.home-view .all-connections guac-pager {
  display: block;
  grid-column: 1 / -1;
}

/* ----- Header row: same 6 fixed columns so cells align ----- */
.home-view .all-connections .home-connections-table-header {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 44px 260px 100px 200px 110px 64px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--theme-text-secondary);
}

.home-view .all-connections .home-connections-table-header .home-col {
  display: block;
  padding: 12px 14px;
  border-bottom: 2px solid var(--theme-border);
  vertical-align: middle;
}

/* Header # column should not render the row counter pseudo-element */
.home-view .all-connections .home-connections-table-header .col-num::before {
  content: "";
}

.home-view .all-connections .home-connections-table-header .col-num { text-align: center; }
.home-view .all-connections .home-connections-table-header .col-name { text-align: left; }
.home-view .all-connections .home-connections-table-header .col-protocol { text-align: left; }
.home-view .all-connections .home-connections-table-header .col-host { text-align: left; }
.home-view .all-connections .home-connections-table-header .col-device { text-align: left; }
.home-view .all-connections .home-connections-table-header .col-active { text-align: center; }

/* ----- Connection data rows: same 6 fixed columns so cells align with header ----- */
.home-view .all-connections a.home-connection {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 44px 260px 100px 200px 110px 64px;
  cursor: pointer;
  counter-increment: row;
  text-decoration: none;
  color: inherit;
  align-items: stretch;
}

.home-view .all-connections a.home-connection .home-col {
  display: block;
  padding: 8px 10px;
  border-bottom: 1px solid #eef2f6;
  color: var(--theme-text-primary);
  vertical-align: middle;
  min-height: 40px;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.home-view .all-connections a.home-connection:hover .home-col {
  background: #f8fafc;
}

.home-view .all-connections a.home-connection:nth-of-type(even) .home-col {
  background: #fafbfc;
}

.home-view .all-connections a.home-connection:nth-of-type(even):hover .home-col {
  background: #f8fafc;
}

.home-view .all-connections a.home-connection:last-of-type .home-col {
  border-bottom: none;
}

/* Column # (row index) */
.home-view .all-connections .col-num {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--theme-text-secondary);
  font-variant-numeric: tabular-nums;
}

.home-view .all-connections .col-num::before {
  content: counter(row);
}

/* Column Name: icon + connection name */
.home-view .all-connections .col-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  white-space: nowrap;
}

.home-view .all-connections .col-name .icon.type {
  vertical-align: middle;
}

.home-view .all-connections .col-name .icon.type {
  display: inline-block;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  background-color: rgba(37, 99, 235, 0.08);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  vertical-align: middle;
  margin-right: 10px;
}

.home-view .all-connections .col-name .icon.type.ssh,
.home-view .all-connections .col-name .icon.type.telnet,
.home-view .all-connections .col-name .icon.type.kubernetes {
  background-image: url('app/ext/custom-guacamole-theme/images/tux.svg');
  background-size: 24px 24px;
}

.home-view .all-connections .col-name .icon.type.rdp {
  background-image: url('app/ext/custom-guacamole-theme/images/windows.svg');
  background-size: 22px 22px;
}

.home-view .all-connections .col-name .icon.type.network {
  background-image: url('app/ext/custom-guacamole-theme/images/network.svg');
  background-size: 22px 22px;
}

.home-view .all-connections .col-name .name {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  vertical-align: middle;
}

/* Column Protocol: badge */
.home-view .all-connections .col-protocol {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-view .all-connections .protocol-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: #e0e7ff;
  color: #3730a3;
}

.home-view .all-connections .col-protocol .cell-empty {
  color: #9ca3af;
}

/* Column Host / IP */
.home-view .all-connections .col-host {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8125rem;
  color: var(--theme-text-primary);
}

.home-view .all-connections .col-host .cell-empty {
  color: #9ca3af;
  font-family: inherit;
}

/* Column Device */
.home-view .all-connections .col-device {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
  color: var(--theme-text-secondary);
}

.home-view .all-connections .col-device .cell-empty {
  color: #9ca3af;
}

/* Column Active (sessions count) */
.home-view .all-connections .col-active {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
}

.home-view .all-connections .col-active .cell-empty {
  color: #9ca3af;
  font-weight: 400;
}

.home-view .all-connections .col-active.has-active {
  color: var(--theme-success);
  font-weight: 600;
}

@media (max-width: 900px) {
  .home-view .all-connections .home-connections-table-header,
  .home-view .all-connections a.home-connection {
    grid-template-columns: 40px 200px 90px 180px 100px 56px;
  }
}

.home-view #section-header-all-connections {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.home-view #section-header-all-connections::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 22px;
  background: url('app/ext/custom-guacamole-theme/images/server.svg') center / contain no-repeat;
}

/* Hide Settings/nav links in top-right user dropdown (sidebar has them) */
.navbar-user .user-menu .page-list {
  display: none !important;
}

/* Hide duplicate user menu in page header (navbar has the correct one).
   Applies to all views that render inside #content: home, settings (all tabs),
   manage (connections, connection groups, users, user groups, sharing profiles),
   import. Exception: client view (body.guac-client-window) keeps the in-page menu
   because the navbar is hidden there. */
body:not(.guac-client-window) #content .header .user-menu,
body:not(.guac-client-window) #content .header guac-user-menu {
  display: none !important;
}

/* --- Pagination: unified DPMIS-style pager app-wide --- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  margin: 0;
  background: #f9fafb;
  border-top: 1px solid var(--theme-border);
  flex-wrap: wrap;
}

.pager .page-numbers {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pager .first-page,
.pager .prev-page,
.pager .next-page,
.pager .last-page {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius);
  background: var(--theme-bg-card);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.pager .first-page:hover:not(.disabled),
.pager .prev-page:hover:not(.disabled),
.pager .next-page:hover:not(.disabled),
.pager .last-page:hover:not(.disabled) {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.pager .first-page.disabled,
.pager .prev-page.disabled,
.pager .next-page.disabled,
.pager .last-page.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pager .set-page,
.pager .more-pages {
  min-width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  border-radius: var(--theme-radius);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--theme-text-secondary);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.pager .set-page:hover:not(.current) {
  background: #f3f4f6;
  color: var(--theme-text-primary);
}
.pager .set-page.current {
  background: var(--theme-accent);
  color: #fff;
  border-color: var(--theme-accent);
  cursor: default;
}
.pager .more-pages {
  cursor: default;
  color: #9ca3af;
}

/* Minimal connection parameter editor (SSH/RDP only) */
.minimal-connection-parameters {
  padding: 12px;
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius);
  background: var(--theme-bg-card);
}

.minimal-connection-parameters .params-mode-switch {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 12px;
  background: #eef4ff;
  border: 1px solid #dbe7ff;
  border-radius: 999px;
}

.minimal-connection-parameters .params-mode-switch button {
  border: 1px solid transparent;
  background: transparent;
  color: #1e3a8a;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 500;
  box-shadow: none;
}

.minimal-connection-parameters .params-mode-switch button.active {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #fff;
}

.minimal-connection-parameters .advanced-panel {
  margin-top: 8px;
}

.minimal-connection-parameters .mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px 16px;
}

.minimal-connection-parameters .mini-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.minimal-connection-parameters .mini-row label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--theme-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.minimal-connection-parameters .mini-row input,
.minimal-connection-parameters .mini-row select {
  border: 1px solid var(--theme-border);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--theme-bg-primary);
  color: var(--theme-text-primary);
}

.minimal-connection-parameters .mini-row input:focus,
.minimal-connection-parameters .mini-row select:focus {
  outline: none;
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 3px var(--theme-accent-soft);
}

.minimal-connection-parameters .mini-note {
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #92400e;
  font-size: 0.9rem;
}

/* --- Buttons and actions app-wide (flat DPMIS-style, no gradients/transform) --- */
input[type="submit"],
button,
a.button {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 18px;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  line-height: 1.25;
}

input[type="submit"],
button:not(.danger),
a.button:not(.danger) {
  background: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
  text-decoration: none;
}

input[type="submit"]:hover,
button:not(.danger):hover,
a.button:not(.danger):hover {
  background: #1d4ed8;
  border-color: #1e40af;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

input[type="submit"]:active,
button:active,
a.button:active {
  background: #1e40af;
  box-shadow: none;
}

button.danger,
a.button.danger {
  color: #fff;
  background: #dc2626;
  border-color: #b91c1c;
}

button.danger:hover,
a.button.danger:hover {
  background: #b91c1c;
  border-color: #991b1b;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

/* --- Active Sessions: modern kill-sessions UI --- */
.settings.section.sessions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0 1rem;
}

.settings.section.sessions > p {
  flex: 0 0 100%;
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  color: var(--theme-text-secondary);
  line-height: 1.5;
}

.settings.section.sessions > .action-buttons {
  flex: 0 0 auto;
  order: 2;
  margin: 0;
}

.settings.section.sessions > .filter {
  flex: 1 1 220px;
  min-width: 220px;
  order: 1;
  margin: 0 0 0.75rem 0;
}

.settings.section.sessions > .sorted,
.settings.section.sessions > table {
  flex: 0 0 100%;
  order: 3;
  margin-top: 0.25rem;
}

.settings.section.sessions > .placeholder {
  flex: 0 0 100%;
  order: 4;
  margin: 1rem 0;
  color: var(--theme-text-secondary);
  font-size: 0.875rem;
}

.settings.section.sessions > guac-pager {
  flex: 0 0 100%;
  order: 5;
}

/* Kill Sessions button: red, icon, clear disabled state */
.settings.sessions button.delete-sessions.danger,
button.delete-sessions.danger {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  padding: 10px 18px !important;
  font-weight: 500 !important;
  background: #dc2626 !important;
  border-color: #b91c1c !important;
  color: #fff !important;
  border-radius: 8px;
}

.settings.sessions button.delete-sessions.danger::before,
button.delete-sessions.danger::before {
  content: "";
  display: inline-block;
  width: 1.125rem;
  height: 1.125rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23fff' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16'/%3E%3C/svg%3E") center/contain no-repeat;
  flex-shrink: 0;
}

.settings.sessions button.delete-sessions.danger:hover:not(:disabled),
button.delete-sessions.danger:hover:not(:disabled) {
  background: #b91c1c !important;
  border-color: #991b1b !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3) !important;
}

.settings.sessions button.delete-sessions.danger:disabled,
button.delete-sessions.danger:disabled {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #94a3b8 !important;
  cursor: not-allowed;
  opacity: 0.9;
}

.settings.sessions button.delete-sessions.danger:disabled::before {
  opacity: 0.6;
}

/* Confirm kill-sessions dialog (global status modal) */
.global-status-modal .notification .title-bar {
  font-weight: 600;
  color: var(--theme-text-primary);
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--theme-border);
}

.global-status-modal .notification .body {
  padding: 1.25rem;
  color: var(--theme-text-secondary);
  line-height: 1.5;
}

.global-status-modal .notification .buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--theme-border);
  background: #f8fafc;
}

.global-status-modal .notification .buttons .button.danger {
  background: #dc2626;
  border-color: #b91c1c;
  color: #fff;
}

/* Settings/connections toolbar buttons (New connection, New group, Import) */
.settings .action-buttons a.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}

/* Forms and inputs — modern look (no 90s Tomcat) */
.settings input[type="text"],
.settings input[type="password"],
.settings input[type="email"],
.settings input[type="number"],
.settings select,
.settings textarea,
.manage input[type="text"],
.manage input[type="password"],
.manage input[type="email"],
.manage input[type="number"],
.manage select,
.manage textarea,
.form table.fields input,
.form table.fields select,
.form table.fields textarea {
  border-radius: var(--theme-radius);
  border: 1px solid var(--theme-border);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.settings input:focus,
.settings select:focus,
.settings textarea:focus,
.manage input:focus,
.manage select:focus,
.manage textarea:focus,
.form table.fields input:focus,
.form table.fields select:focus,
.form table.fields textarea:focus {
  outline: none;
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 3px var(--theme-accent-soft);
}
.settings .section,
.manage .section,
.preferences .section {
  border-radius: var(--theme-radius-lg);
  box-shadow: var(--dpmis-shadow-sm);
  border: 1px solid var(--theme-border);
}

/* Preferences page: compact layout */
.preferences .settings.section {
  padding: 12px 16px;
  margin-bottom: 1rem;
}

.preferences h2.header {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem 0;
  padding-bottom: 4px;
}

.preferences h2.header:first-of-type {
  margin-top: 0;
}

.preferences .section p {
  margin: 0 0 10px 0;
  font-size: 0.875rem;
  color: var(--theme-text-secondary);
}

.preferences .form table.fields {
  margin-bottom: 12px;
}

.preferences .form table.fields th,
.preferences .form table.fields td {
  padding: 8px 12px;
  font-size: 0.875rem;
}

.preferences .choices {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.preferences .choice {
  padding: 10px 14px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  background: var(--theme-bg-primary);
  min-width: 140px;
}

.preferences .choice label,
.preferences .choice .caption {
  font-size: 0.875rem;
  margin: 0;
}

.preferences .choice .caption {
  color: var(--theme-text-secondary);
  margin-top: 4px;
}

.preferences .action-buttons {
  margin-top: 12px;
}

/* --- Notification / modal --- */
.notification .body {
  background: var(--theme-bg-card);
  border: 1px solid var(--theme-border);
  border-radius: var(--theme-radius);
  color: var(--theme-text-primary);
}

/* Modernize manage/settings table and form visuals */
/* Hide Location row (always ROOT); no need to change parent group */
.manage-connection tr:has(.location-chooser),
.manage-connection-group tr:has(.location-chooser) {
  display: none !important;
}

/* Manage Connection: hide Concurrency Limits, Load Balancing, Guacamole Proxy Parameters (guacd) */
.manage-connection .form-concurrency,
.manage-connection .form-load-balancing,
.manage-connection .form-guacd {
  display: none !important;
}

/* Legacy: hide individual fields if sections ever rendered elsewhere */
.manage-connection .labeled-field[class*="labeled-field-max-connections"],
.manage-connection .labeled-field[class*="labeled-field-max-connections-per-user"],
.manage-connection .labeled-field[class*="labeled-field-failover-only"],
.manage-connection .labeled-field[class*="labeled-field-weight"],
.manage-connection .labeled-field[class*="labeled-field-guacd-"] {
  display: none !important;
}

.manage-connection .section,
.manage-connection .history.section,
.settings.section.connections .connection-list,
.settings .section {
  background: var(--theme-bg-card);
  border: 1px solid var(--theme-border);
  border-radius: 12px;
  box-shadow: var(--theme-shadow);
  padding: 12px;
}

.settings-view .page-tabs {
  margin: 10px 0 14px;
  background: var(--theme-bg-card);
  border: 1px solid var(--theme-border);
  border-radius: 12px;
  box-shadow: var(--theme-shadow);
  padding: 8px;
}

/* True sidebar + content layout for settings fragments */
.settings-view {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-areas:
    "header header"
    "sidebar content";
  gap: 14px;
}

.settings-view > .header {
  grid-area: header;
}

.settings-view > .page-tabs {
  grid-area: sidebar;
  align-self: start;
  position: sticky;
  top: 12px;
}

.settings-view > guac-settings-users,
.settings-view > guac-settings-user-groups,
.settings-view > guac-settings-connections,
.settings-view > guac-settings-connection-history,
.settings-view > guac-settings-sessions,
.settings-view > guac-settings-preferences {
  grid-area: content;
  min-width: 0;
}

.settings-view .page-tabs .page-list ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-view .page-tabs .page-list li a {
  display: flex;
  align-items: center;
  width: 100%;
  border-radius: 10px;
  padding: 8px 12px;
  border: 1px solid #dbe7ff;
  background: #f8fbff;
  color: #1e3a8a;
  font-weight: 600;
  text-decoration: none;
}

.settings-view .page-tabs .page-list li a:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.settings-view .page-tabs .page-list li a.current {
  border-color: #1d4ed8;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.32);
}

@media (max-width: 1080px) {
  .settings-view {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "sidebar"
      "content";
  }

  .settings-view > .page-tabs {
    position: static;
  }

  .settings-view .page-tabs .page-list ul {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .settings-view .page-tabs .page-list li a {
    width: auto;
    border-radius: 999px;
  }
}

/* Global sidebar is primary nav; hide duplicate local settings tabs and redundant "Settings" header */
body.settings .settings-view {
  display: block;
}

body.settings .settings-view > .page-tabs {
  display: none;
}

body.settings .settings-view > .header {
  display: none !important;
}

.settings table.sorted {
  width: 100%;
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--theme-border);
  background: var(--theme-bg-card);
  font-size: 0.875rem;
}

.settings table.sorted thead {
  background: #f1f5f9;
}

.settings table.sorted th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid var(--theme-border);
}

.settings table.sorted td {
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 16px;
  color: var(--theme-text-primary);
}

.settings table.sorted tbody tr:nth-child(even) td {
  background: #fafbfc;
}

.settings table.sorted tbody tr:hover td {
  background: #f1f5f9;
}

.settings table.sorted tbody tr:last-child td {
  border-bottom: none;
}

.settings table.sorted tbody tr:nth-child(even):hover td {
  background: #f1f5f9;
}

/* Users list table: links and icon alignment */
.settings.users table.user-list td.username a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--theme-accent);
  text-decoration: none;
  font-weight: 500;
}

.settings.users table.user-list td.username a:hover {
  text-decoration: underline;
}

.settings.users table.user-list .icon.user {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--theme-accent-soft);
  flex-shrink: 0;
}

.manage-connection table.properties {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.manage-connection table.properties th {
  width: 220px;
  text-align: left;
  color: var(--theme-text-secondary);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 10px 12px;
}

.manage-connection table.properties td {
  padding: 6px 8px;
}

.manage-connection table.properties input,
.manage-connection table.properties select,
.section.connection-parameters input,
.section.connection-parameters select,
.section.connection-parameters textarea {
  width: 100%;
  max-width: 540px;
  border: 1px solid var(--theme-border);
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
  color: var(--theme-text-primary);
}

/* Minimal mode on all connection parameter forms: hide advanced/non-essential fields */
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-enable-audio"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-disable-audio"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-audio-servername"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-enable-drive"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-drive-name"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-drive-path"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-create-drive-path"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-enable-printing"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-printer-name"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-enable-wallpaper"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-enable-theming"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-enable-font-smoothing"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-enable-full-window-drag"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-enable-desktop-composition"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-enable-menu-animations"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-disable-auth"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-gateway-"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-sftp-"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-recording-"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-create-recording-path"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-swap-red-blue"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-cursor"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-color-depth"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-read-only"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-clipboard-"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-console"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-timezone"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-server-layout"],
.minimal-connection-parameters:not(.mode-advanced) .labeled-field[class*="labeled-field-force-lossless"] {
  display: none !important;
}

/* De-emphasize large attribute/permission editors to keep data entry focused */
.manage-user .attributes,
.manage-user-group .attributes,
.manage-connection-group .attributes,
.manage-sharing-profile .attributes,
system-permission-editor,
connection-permission-editor,
identifier-set-editor {
  opacity: 0.97;
}

.manage-connection table.properties input:focus,
.manage-connection table.properties select:focus,
.section.connection-parameters input:focus,
.section.connection-parameters select:focus,
.section.connection-parameters textarea:focus {
  outline: none;
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 3px var(--theme-accent-soft);
}

/* --- Tables: match resources/design-system (DPMIS-style) --- */
.settings table,
.settings table.sorted,
.history table,
.preferences table,
.settings .form table.fields,
.preferences .form table.fields {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--theme-bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--theme-border);
  font-size: 0.875rem;
}

.settings thead,
.history thead,
.preferences .form table.fields thead {
  background: #f1f5f9;
}

.settings thead th,
.history thead th,
.preferences .form table.fields thead th,
.settings table.sorted th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
}

.settings tbody td,
.history tbody td,
.preferences .form table.fields tbody td,
.settings table.sorted td {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  color: var(--theme-text-primary);
  transition: background-color 0.1s ease;
}

.settings tbody tr:hover td,
.history tbody tr:hover td,
.preferences .form table.fields tbody tr:hover td,
.settings table.sorted tbody tr:hover td {
  background: #f1f5f9;
}

.settings tbody tr:last-child td,
.history tbody tr:last-child td,
.settings table.sorted tbody tr:last-child td {
  border-bottom: none;
}

.settings table.sorted tr:nth-child(even) td {
  background: #fafbfc;
}

.settings table.sorted tbody tr:nth-child(even):hover td {
  background: #f1f5f9;
}

/* Table wrapper card (resources-style) */
.settings .section > .form,
.history.section > div:first-child,
.settings-view guac-settings-users .form,
.settings-view guac-settings-connections .connection-list,
.settings-view guac-settings-connection-history .form,
.settings-view guac-settings-sessions .form {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--theme-border);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
}

/* --- Settings tables: one style for all (sessions, users, history, groups) - DPMIS --- */
.settings table.sorted.session-list,
.settings table.sorted.user-list,
.settings table.sorted.history-list,
.settings table.sorted.user-group-list {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--theme-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.settings table.sorted.session-list thead,
.settings table.sorted.session-list th,
.settings table.sorted.session-list td,
.settings table.sorted.user-list thead,
.settings table.sorted.user-list th,
.settings table.sorted.user-list td,
.settings table.sorted.history-list thead,
.settings table.sorted.history-list th,
.settings table.sorted.history-list td,
.settings table.sorted.user-group-list thead,
.settings table.sorted.user-group-list th,
.settings table.sorted.user-group-list td {
  border-color: #e2e8f0;
}

.settings table.sorted.session-list thead th,
.settings table.sorted.session-list thead td,
.settings table.sorted.user-list thead th,
.settings table.sorted.history-list thead th,
.settings table.sorted.user-group-list thead th {
  background: #f1f5f9 !important;
  color: #475569 !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  padding: 12px 16px !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0 !important;
}

.settings table.sorted.session-list tbody td,
.settings table.sorted.user-list tbody td,
.settings table.sorted.history-list tbody td,
.settings table.sorted.user-group-list tbody td {
  padding: 12px 16px !important;
  font-size: 0.875rem;
  color: var(--theme-text-primary);
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.settings table.sorted.session-list tbody tr:nth-child(even) td,
.settings table.sorted.user-list tbody tr:nth-child(even) td,
.settings table.sorted.history-list tbody tr:nth-child(even) td,
.settings table.sorted.user-group-list tbody tr:nth-child(even) td {
  background: #fafbfc !important;
}

.settings table.sorted.session-list tbody tr:hover td,
.settings table.sorted.session-list tr.session:hover td,
.settings table.sorted.user-list tbody tr:hover td,
.settings table.sorted.history-list tbody tr:hover td,
.settings table.sorted.user-group-list tbody tr:hover td {
  background: #f1f5f9 !important;
}

.settings table.sorted.session-list tbody tr:nth-child(even):hover td {
  background: #f1f5f9 !important;
}

.settings table.sorted.session-list .select-session {
  width: 44px;
  min-width: 44px;
  text-align: center;
  vertical-align: middle;
}

.settings table.sorted.session-list .select-session input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--theme-accent);
}

.settings table.sorted.session-list tbody td a {
  color: var(--theme-accent);
  font-weight: 500;
  text-decoration: none;
}

.settings table.sorted.session-list tbody td a:hover {
  text-decoration: underline;
}
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

/* Label/tag denoting the user that shared a connection */
.jdbc-share-tag {

    background: #0095ff;
    padding: 0.25em;

    -moz-border-radius:    0.25em;
    -webkit-border-radius: 0.25em;
    -khtml-border-radius:  0.25em;
    border-radius:         0.25em;

    color: white;
    font-size: 0.75em;
    font-weight: bold;

}
