:root {
   /* Brand Colors (from palette.jpg) */
   --brand-deep-pockets: #0d231f;
   --brand-evergreen: #143831;
   --brand-safe-harbor: #2b5655;
   --brand-teal: #00b787;
   --brand-market-mint: #6ed3b6;

   /* Dark Mode Palette - desaturated brand variants */
   --dark-bg: hsl(from var(--brand-deep-pockets) h calc(s * 0.25) calc(l - 2));
   --dark-surface: hsl(from var(--brand-evergreen) h calc(s * 0.85) l);
   --dark-border: hsl(from var(--brand-safe-harbor) h calc(s * 0.4) l);
   --dark-header-bg: var(--dark-bg);
   /*--dark-header-bg: hsl(
      from var(--brand-deep-pockets) h calc(s * 0.65) calc(l - 2)
   );*/
   /* Light Mode (default) */
   --color-primary: var(--brand-teal);
   --color-primary-hover: var(--brand-evergreen);
   --color-bg: #f5f5f5;
   --color-surface: #ffffff;
   --color-text: var(--brand-deep-pockets);
   --color-text-muted: #777777;
   --color-border: #dddddd;
   --color-error: #cc3333;
   --color-success: var(--brand-teal);
   --color-header-bg: var(--brand-deep-pockets);
   --color-menu-bg: #ffffff;
   --color-sidebar-bg: #f5f5f5;
   --radius: 8px;
   --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Dark mode via data attribute */
[data-theme="dark"] {
   --color-bg: var(--dark-bg);
   --color-surface: var(--dark-surface);
   --color-text: #eeeeee;
   --color-text-muted: #999999;
   --color-border: var(--dark-border);
   --color-header-bg: var(--dark-header-bg);
   --color-menu-bg: var(--dark-surface);
   --color-sidebar-bg: var(--dark-surface);
   --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
}

/* System preference when no explicit theme set */
@media (prefers-color-scheme: dark) {
   :root:not([data-theme="light"]) {
      --color-bg: var(--dark-bg);
      --color-surface: var(--dark-surface);
      --color-text: #eeeeee;
      --color-text-muted: #999999;
      --color-border: var(--dark-border);
      --color-header-bg: var(--dark-header-bg);
      --color-menu-bg: var(--dark-surface);
      --color-sidebar-bg: var(--dark-surface);
      --shadow:
         0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
   }
}

* {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
}

body {
   font-family:
      system-ui,
      -apple-system,
      BlinkMacSystemFont,
      "Segoe UI",
      Roboto,
      sans-serif;
   background: var(--color-bg);
   color: var(--color-text);
   line-height: 1.5;
   min-height: 100vh;
}

/* Login Page */
.login-container {
   display: grid;
   place-items: center;
   min-height: 100vh;
   padding: 1rem;
}

.login-card {
   background: var(--color-surface);
   padding: 2.5rem;
   border-radius: var(--radius);
   box-shadow: var(--shadow);
   width: 100%;
   max-width: 400px;
}

.login-card h1 {
   font-size: 1.875rem;
   font-weight: 700;
   text-align: center;
   margin-bottom: 0.25rem;
}

.subtitle {
   text-align: center;
   color: var(--color-text-muted);
   margin-bottom: 2rem;
}

.form-group {
   margin-bottom: 1.25rem;
}

.form-group label {
   display: block;
   font-size: 0.875rem;
   font-weight: 500;
   margin-bottom: 0.5rem;
}

.form-group input {
   width: 100%;
   padding: 0.75rem 1rem;
   font-size: 1rem;
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   transition:
      border-color 0.15s,
      box-shadow 0.15s;
}

.form-group input:focus {
   outline: none;
   border-color: var(--color-primary);
   box-shadow: 0 0 0 2px var(--brand-market-mint);
}

.btn-primary {
   width: 100%;
   padding: 0.75rem 1rem;
   font-size: 1rem;
   font-weight: 500;
   color: white;
   background: var(--color-primary);
   border: none;
   border-radius: var(--radius);
   cursor: pointer;
   transition: background-color 0.15s;
}

.btn-primary:hover {
   background: var(--color-primary-hover);
}

.btn-primary .htmx-indicator {
   display: none;
}

.htmx-request .htmx-indicator {
   display: inline;
}

.htmx-request .btn-text {
   display: none;
}

.divider {
   display: flex;
   align-items: center;
   margin: 1.5rem 0;
   color: var(--color-text-muted);
   font-size: 0.875rem;
}

.divider::before,
.divider::after {
   content: "";
   flex: 1;
   height: 1px;
   background: var(--color-border);
}

.divider span {
   padding: 0 1rem;
}

.btn-google {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 0.75rem;
   width: 100%;
   padding: 0.75rem 1rem;
   font-size: 1rem;
   font-weight: 500;
   color: var(--color-text);
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   text-decoration: none;
   cursor: pointer;
}

.btn-google:hover {
   background: var(--color-bg);
}

#login-result {
   margin-top: 1rem;
}

.error {
   color: var(--color-error);
   font-size: 0.875rem;
   text-align: center;
}

.success {
   color: var(--color-success);
   font-size: 0.875rem;
   text-align: center;
}

/* ==========================================================================
   App Shell Layout
   ========================================================================== */

.app-shell {
   display: grid;
   grid-template-rows: 56px 28px 1fr;
   grid-template-columns: 1fr;
   grid-template-areas:
      "header"
      "menu"
      "main";
   min-height: 100vh;
}

/* Header */
.app-header {
   grid-area: header;
   position: sticky;
   top: 0;
   z-index: 100;
   display: flex;
   align-items: center;
   justify-content: space-between;
   padding: 0 1.5rem;
   background: var(--color-header-bg);
   color: white;
}

.app-header .logo {
   height: 32px;
   width: auto;
}

.app-header .cls-1,
.app-header .cls-2 {
   fill: white;
}

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

.logo-link {
   display: flex;
   align-items: center;
}

.header-right {
   display: flex;
   align-items: center;
   gap: 1rem;
}

/* Notification Bell */
.notification-bell {
   position: relative;
   background: none;
   border: none;
   color: white;
   cursor: pointer;
   padding: 0.5rem;
}

.notification-bell svg {
   width: 20px;
   height: 20px;
}

.notification-badge {
   position: absolute;
   top: 2px;
   right: 2px;
   min-width: 16px;
   height: 16px;
   padding: 0 4px;
   font-size: 0.625rem;
   font-weight: 600;
   color: white;
   background: var(--color-error);
   border-radius: 8px;
   display: flex;
   align-items: center;
   justify-content: center;
}

.notification-badge:empty {
   display: none;
}

/* Notification Dropdown */
.notification-wrapper {
   position: relative;
}

.notification-dropdown {
   display: none;
   position: absolute;
   top: 100%;
   right: 0;
   width: 320px;
   max-height: 400px;
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
   z-index: 100;
   overflow: hidden;
   margin-top: 0.5rem;
}

.notification-dropdown.open {
   display: block;
}

.notification-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 0.75rem 1rem;
   border-bottom: 1px solid var(--color-border);
   font-weight: 600;
   color: var(--color-text);
}

.notification-header button {
   font-size: 0.75rem;
   color: var(--brand-teal);
   background: none;
   border: none;
   cursor: pointer;
   padding: 0;
}

.notification-header button:hover {
   text-decoration: underline;
}

#notification-list {
   max-height: 320px;
   overflow-y: auto;
}

.notification-item {
   display: flex;
   gap: 0.75rem;
   padding: 0.75rem 1rem;
   border-bottom: 1px solid var(--color-border);
   text-decoration: none;
   color: var(--color-text);
   position: relative;
}

.notification-item:last-child {
   border-bottom: none;
}

.notification-item:hover {
   background: var(--color-bg);
}

.notification-item.unread {
   background: var(--color-bg);
}

.notification-item.unread::before {
   content: "";
   position: absolute;
   left: 4px;
   top: 50%;
   transform: translateY(-50%);
   width: 6px;
   height: 6px;
   background: var(--brand-teal);
   border-radius: 50%;
}

.notification-icon {
   flex-shrink: 0;
   width: 32px;
   height: 32px;
   display: flex;
   align-items: center;
   justify-content: center;
   background: var(--color-border);
   border-radius: 50%;
   color: var(--color-text-muted);
}

.notification-content {
   flex: 1;
   min-width: 0;
}

.notification-title {
   font-weight: 500;
   margin-bottom: 2px;
}

.notification-body {
   font-size: 0.875rem;
   color: var(--color-text-muted);
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

.notification-time {
   font-size: 0.75rem;
   color: var(--color-text-muted);
   margin-top: 4px;
}

.notification-empty {
   padding: 2rem;
   text-align: center;
   color: var(--color-text-muted);
}

.notification-list {
   list-style: none;
}

.notification-list > li {
   list-style: none;
}

/* User Pill */
.user-pill {
   display: flex;
   align-items: center;
   gap: 0.5rem;
   padding: 0.25rem 0.75rem 0.25rem 0.25rem;
   background: rgba(255, 255, 255, 0.1);
   border: none;
   border-radius: 9999px;
   color: white;
   cursor: pointer;
   font-size: 0.875rem;
}

.user-pill:hover {
   background: rgba(255, 255, 255, 0.2);
}

.user-pill .avatar {
   width: 32px;
   height: 32px;
   border-radius: 50%;
   object-fit: cover;
}

.user-pill .chevron {
   width: 12px;
   height: 12px;
   margin-left: 0.25rem;
}

/* User Dropdown */
.user-dropdown {
   position: relative;
}

.user-menu {
   position: absolute;
   top: calc(100% + 0.5rem);
   right: 0;
   min-width: 160px;
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   box-shadow: var(--shadow);
   display: none;
   overflow: hidden;
}

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

.user-menu a,
.user-menu button {
   display: block;
   width: 100%;
   padding: 0.75rem 1rem;
   text-align: left;
   color: var(--color-text);
   text-decoration: none;
   background: none;
   border: none;
   font-size: 0.875rem;
   cursor: pointer;
}

.user-menu a:hover,
.user-menu button:hover {
   background: var(--color-bg);
}

.user-menu .divider {
   height: 1px;
   margin: 0;
   background: var(--color-border);
}

.user-menu .divider::before,
.user-menu .divider::after {
   display: none;
}

/* Menu Bar */
.app-menu {
   grid-area: menu;
   position: sticky;
   top: 56px;
   z-index: 90;
   display: flex;
   align-items: center;
   gap: 0;
   padding: 0 1.5rem;
   background: var(--color-menu-bg);
   border-bottom: 1px solid var(--color-border);
}

.menu-tabs {
   display: flex;
   height: 100%;
}

.menu-tab {
   display: flex;
   align-items: center;
   justify-content: center;
   padding: 0 1rem;
   height: 100%;
   color: var(--color-text-muted);
   text-decoration: none;
   font-size: 0.8125rem;
   font-weight: 500;
   border-bottom: 2px solid transparent;
   margin-bottom: -1px;
}

.menu-tab:hover {
   color: var(--color-text);
}

.menu-tab.active {
   color: var(--brand-teal);
   border-bottom-color: var(--brand-teal);
}

/* Sidebar */
.app-sidebar {
   grid-area: sidebar;
   background: var(--color-sidebar-bg);
   border-right: 1px solid var(--color-border);
   padding: 1rem 0;
   overflow-y: auto;
}

.sidebar-nav {
   display: flex;
   flex-direction: column;
}

.sidebar-item {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   padding: 0.625rem 1.5rem;
   color: var(--color-text-muted);
   text-decoration: none;
   font-size: 0.875rem;
   border-left: 3px solid transparent;
}

.sidebar-item:hover {
   color: var(--color-text);
   background: rgba(0, 0, 0, 0.02);
}

.sidebar-item.active {
   color: var(--brand-teal);
   background: var(--color-bg);
   border-left-color: var(--brand-teal);
}

.sidebar-item svg {
   width: 18px;
   height: 18px;
   flex-shrink: 0;
}

.sidebar-section {
   padding: 1rem 1.5rem 0.5rem;
   font-size: 0.75rem;
   font-weight: 600;
   color: var(--color-text-muted);
   text-transform: uppercase;
   letter-spacing: 0.05em;
}

/* Sidebar Filter */
.sidebar-filter {
   padding: 0.75rem;
   border-bottom: 1px solid var(--color-border);
}

.sidebar-filter input {
   width: 100%;
   padding: 0.5rem 0.75rem;
   font-size: 0.875rem;
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   background: var(--color-surface);
   color: var(--color-text);
}

.sidebar-filter input:focus {
   outline: none;
   border-color: var(--brand-teal);
}

/* Sidebar List */
.sidebar-list {
   flex: 1;
   overflow-y: auto;
   list-style: none;
}

.sidebar-list > li {
   list-style: none;
}

.sidebar-list-item {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   padding: 0.625rem 1rem;
   color: var(--color-text);
   text-decoration: none;
   font-size: 0.875rem;
   border-bottom: 1px solid var(--color-border);
   cursor: pointer;
}

.sidebar-list-item:last-child {
   border-bottom: none;
}

.sidebar-list-item:hover {
   background: var(--color-bg);
}

.sidebar-list-item.active {
   background: var(--color-bg);
   border-left: 3px solid var(--brand-teal);
   padding-left: calc(1rem - 3px);
}

.sidebar-avatar {
   width: 32px;
   height: 32px;
   border-radius: 50%;
   flex-shrink: 0;
   object-fit: cover;
}

.sidebar-avatar.placeholder {
   background: var(--brand-safe-harbor);
   color: white;
   display: flex;
   align-items: center;
   justify-content: center;
   font-weight: 600;
   font-size: 0.875rem;
}

.sidebar-list-content {
   flex: 1;
   min-width: 0;
}

.sidebar-list-name {
   font-weight: 500;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

.sidebar-list-meta {
   font-size: 0.75rem;
   color: var(--color-text-muted);
   margin-top: 2px;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

.sidebar-badge {
   font-size: 0.625rem;
   padding: 0.125rem 0.375rem;
   border-radius: 4px;
   text-transform: uppercase;
   font-weight: 600;
   flex-shrink: 0;
}

.sidebar-badge.disabled {
   background: var(--color-error);
   color: white;
}

.sidebar-badge.pending {
   background: #f59e0b;
   color: white;
}

/* Page Detail */
.page-detail {
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   padding: 1.5rem;
   min-height: calc(100vh - 220px);
}

/* Main Content */
.app-main {
   grid-area: main;
   padding: 1.5rem;
   overflow-y: auto;
}

/* Page Header */
.page-header {
   margin-bottom: 1.5rem;
}

.page-header h1 {
   font-size: 1.5rem;
   font-weight: 600;
   color: var(--color-text);
}

/* Hamburger Menu Toggle */
.menu-toggle {
   display: none;
   background: none;
   border: none;
   padding: 0.5rem;
   cursor: pointer;
   color: inherit;
}

.menu-toggle svg {
   width: 24px;
   height: 24px;
}

/* Sidebar Overlay (for mobile/tablet) */
.sidebar-overlay {
   display: none;
   position: fixed;
   inset: 0;
   background: rgba(0, 0, 0, 0.5);
   z-index: 80;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1023px) {
   .app-shell {
      grid-template-columns: 1fr;
      grid-template-areas:
         "header"
         "menu"
         "main";
   }

   .app-sidebar {
      position: fixed;
      left: 0;
      top: 104px;
      bottom: 0;
      width: 280px;
      z-index: 85;
      transform: translateX(-100%);
      transition: transform 0.2s ease-out;
   }

   .app-sidebar.open {
      transform: translateX(0);
   }

   .sidebar-overlay.open {
      display: block;
   }

   .menu-toggle {
      display: flex;
   }

   .app-header {
      padding: 0 1rem;
   }

   .app-menu {
      padding: 0 1rem;
   }
}

@media (max-width: 767px) {
   .app-shell {
      grid-template-rows: 56px 1fr;
      grid-template-areas:
         "header"
         "main";
   }

   .app-menu {
      position: fixed;
      left: 0;
      top: 56px;
      bottom: 0;
      width: 280px;
      z-index: 85;
      flex-direction: column;
      align-items: stretch;
      padding: 1rem 0;
      transform: translateX(-100%);
      transition: transform 0.2s ease-out;
      border-bottom: none;
      border-right: 1px solid var(--color-border);
   }

   .app-menu.open {
      transform: translateX(0);
   }

   .menu-tabs {
      flex-direction: column;
      height: auto;
   }

   .menu-tab {
      padding: 0.75rem 1.5rem;
      border-bottom: none;
      border-left: 3px solid transparent;
      margin-bottom: 0;
   }

   .menu-tab.active {
      border-bottom: none;
      border-left-color: var(--brand-teal);
      background: var(--color-bg);
   }

   .app-sidebar {
      top: 56px;
      width: 280px;
      transform: translateX(-100%);
   }

   .user-pill span {
      display: none;
   }

   .user-pill {
      padding: 0.25rem;
   }
}

/* ==========================================================================
   Dashboard
   ========================================================================== */

.dashboard-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
   gap: 1rem;
   margin-top: 1rem;
}

.stat-card {
   background: var(--color-surface);
   padding: 1.5rem;
   border-radius: var(--radius);
   border: 1px solid var(--color-border);
}

.stat-label {
   font-size: 0.875rem;
   color: var(--color-text-muted);
   margin-bottom: 0.5rem;
}

.stat-value {
   font-size: 1.75rem;
   font-weight: 600;
   color: var(--color-text);
}

/* Dashboard Charts */
.dashboard-charts {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
   gap: 1.5rem;
   margin-top: 1.5rem;
}

.chart-card {
   background: var(--color-surface);
   border-radius: var(--radius);
   border: 1px solid var(--color-border);
   padding: 1rem;
   min-height: 280px;
}

/* Client Grid (Manager Dashboard) */
.client-grid {
   display: grid;
   grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
   gap: 1.5rem;
   margin-top: 1rem;
}

.client-card {
   background: var(--color-surface);
   border-radius: var(--radius);
   border: 1px solid var(--color-border);
   overflow: hidden;
}

.client-card.single-portfolio {
   cursor: pointer;
   transition: border-color 0.15s, box-shadow 0.15s;
}

.client-card.single-portfolio:hover {
   border-color: var(--brand-teal);
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.client-card-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 1rem 1.25rem;
   background: var(--color-bg);
   border-bottom: 1px solid var(--color-border);
}

.client-card.single-portfolio .client-card-header {
   border-bottom: none;
}

.client-card-title {
   font-size: 1rem;
   font-weight: 600;
   margin: 0;
   color: var(--color-text);
}

.client-card-count {
   font-size: 0.75rem;
   color: var(--color-text-muted);
}

.client-card-meta {
   font-size: 0.75rem;
   color: var(--color-text-muted);
}

.portfolio-cards {
   display: flex;
   flex-direction: column;
}

.portfolio-card {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 0.75rem 1.25rem;
   text-decoration: none;
   color: var(--color-text);
   border-bottom: 1px solid var(--color-border);
   transition: background 0.15s;
}

.portfolio-card:last-child {
   border-bottom: none;
}

.portfolio-card:hover {
   background: var(--color-bg);
}

.portfolio-card-name {
   font-weight: 500;
}

.portfolio-card-units {
   font-size: 0.75rem;
   color: var(--color-text-muted);
}

/* List-Detail Layout (in-page master/detail pattern) */
.list-detail-layout {
   display: grid;
   grid-template-columns: 280px 1fr;
   gap: 1.5rem;
   height: calc(100vh - 140px);
}

.list-panel {
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   display: flex;
   flex-direction: column;
   overflow: hidden;
}

.list-panel-header {
   padding: 1rem;
   border-bottom: 1px solid var(--color-border);
}

.list-panel-header h2 {
   margin: 0;
   font-size: 1rem;
   font-weight: 600;
}

.list-panel-filter {
   padding: 0.75rem 1rem;
   border-bottom: 1px solid var(--color-border);
}

.list-panel-filter input,
.list-panel-filter select {
   width: 100%;
   padding: 0.5rem 0.75rem;
   font-size: 0.875rem;
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   background: var(--color-bg);
   color: var(--color-text);
}

.list-panel-filter input:focus,
.list-panel-filter select:focus {
   outline: none;
   border-color: var(--brand-teal);
}

.list-panel-options {
   padding: 0.5rem 1rem;
   border-bottom: 1px solid var(--color-border);
   font-size: 0.75rem;
}

.toggle-label {
   display: flex;
   align-items: center;
   gap: 0.5rem;
   cursor: pointer;
   color: var(--color-text-muted);
}

.toggle-label input[type="checkbox"] {
   cursor: pointer;
}

.list-panel-items {
   flex: 1;
   overflow-y: auto;
   list-style: none;
   margin: 0;
   padding: 0;
}

.list-panel-item {
   display: flex;
   flex-direction: column;
   gap: 0.25rem;
   padding: 0.75rem 1rem;
   text-decoration: none;
   color: var(--color-text);
   border-bottom: 1px solid var(--color-border);
   cursor: pointer;
   transition: background 0.15s;
}

.list-panel-item:hover {
   background: var(--color-bg);
}

.list-panel-item.active {
   background: var(--color-bg);
   border-left: 3px solid var(--brand-teal);
   padding-left: calc(1rem - 3px);
}

.list-panel-item-name {
   font-weight: 500;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

.list-panel-item-meta {
   display: flex;
   align-items: center;
   gap: 0.5rem;
   font-size: 0.75rem;
   color: var(--color-text-muted);
}

.detail-panel {
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   padding: 1.5rem;
   overflow-y: auto;
}

.detail-empty {
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   height: 100%;
   color: var(--color-text-muted);
   text-align: center;
}

.detail-empty svg {
   width: 48px;
   height: 48px;
   opacity: 0.3;
   margin-bottom: 1rem;
}

/* List panel item variants */
.list-panel-item.user-item {
   flex-direction: row;
   align-items: center;
   gap: 0.75rem;
}

.user-avatar {
   width: 32px;
   height: 32px;
   border-radius: 50%;
   flex-shrink: 0;
   object-fit: cover;
}

.user-avatar.placeholder {
   background: var(--brand-safe-harbor);
   color: white;
   display: flex;
   align-items: center;
   justify-content: center;
   font-weight: 600;
   font-size: 0.875rem;
}

.user-info {
   flex: 1;
   min-width: 0;
   display: flex;
   flex-direction: column;
}

.list-panel-item.job-item {
   flex-direction: row;
   align-items: center;
   gap: 0.75rem;
}

.job-info {
   flex: 1;
   min-width: 0;
   display: flex;
   flex-direction: column;
}

/* Responsive list-detail layout */
@media (max-width: 767px) {
   .list-detail-layout {
      grid-template-columns: 1fr;
      grid-template-rows: auto 1fr;
      height: auto;
   }

   .list-panel {
      max-height: 300px;
   }
}

.theme-toggle {
   display: flex;
   align-items: center;
   gap: 0.5rem;
}

/* ==========================================================================
   Jobs Admin
   ========================================================================== */

.jobs-layout {
   display: grid;
   grid-template-columns: 280px 1fr;
   gap: 1.5rem;
   height: calc(100vh - 180px);
}

.jobs-list-panel {
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   overflow: hidden;
   display: flex;
   flex-direction: column;
}

.panel-header {
   padding: 0.75rem 1rem;
   font-weight: 600;
   font-size: 0.875rem;
   border-bottom: 1px solid var(--color-border);
   background: var(--color-bg);
}

.jobs-list {
   flex: 1;
   overflow-y: auto;
}

.job-item {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   padding: 0.75rem 1rem;
   border-bottom: 1px solid var(--color-border);
   text-decoration: none;
   color: var(--color-text);
   cursor: pointer;
}

.job-item:last-child {
   border-bottom: none;
}

.job-item:hover {
   background: var(--color-bg);
}

.job-item.active {
   background: var(--color-bg);
   border-left: 3px solid var(--brand-teal);
   padding-left: calc(1rem - 3px);
}

.job-status-dot {
   width: 10px;
   height: 10px;
   border-radius: 50%;
   flex-shrink: 0;
   background: var(--color-border);
}

.job-status-dot.job-status-completed {
   background: var(--brand-teal);
}

.job-status-dot.job-status-running {
   background: #f59e0b;
   animation: pulse 1.5s infinite;
}

.job-status-dot.job-status-failed {
   background: var(--color-error);
}

.job-status-dot.job-status-pending {
   background: #6b7280;
}

@keyframes pulse {
   0%,
   100% {
      opacity: 1;
   }
   50% {
      opacity: 0.5;
   }
}

.job-item-content {
   flex: 1;
   min-width: 0;
}

.job-item-name {
   font-weight: 500;
   font-size: 0.875rem;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

.job-item-meta {
   font-size: 0.75rem;
   color: var(--color-text-muted);
   margin-top: 2px;
}

.jobs-detail-panel {
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   padding: 1.5rem;
   overflow-y: auto;
}

.jobs-empty {
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   height: 100%;
   color: var(--color-text-muted);
   gap: 1rem;
}

.jobs-empty svg {
   width: 48px;
   height: 48px;
}

@media (max-width: 768px) {
   .jobs-layout {
      grid-template-columns: 1fr;
      grid-template-rows: auto 1fr;
   }

   .jobs-list-panel {
      max-height: 200px;
   }
}

/* ==========================================================================
   Job Detail
   ========================================================================== */

.job-detail-header {
   display: flex;
   align-items: center;
   gap: 1rem;
   margin-bottom: 1.5rem;
}

.job-detail-header h2 {
   font-size: 1.25rem;
   font-weight: 600;
   margin: 0;
}

.job-type-badge {
   font-size: 0.75rem;
   padding: 0.25rem 0.5rem;
   background: var(--color-bg);
   border: 1px solid var(--color-border);
   border-radius: 4px;
   font-family: monospace;
   color: var(--color-text-muted);
}

.job-section {
   margin-bottom: 1.5rem;
}

.job-section h3 {
   font-size: 0.875rem;
   font-weight: 600;
   color: var(--color-text-muted);
   text-transform: uppercase;
   letter-spacing: 0.05em;
   margin-bottom: 0.75rem;
}

.job-status-card {
   background: var(--color-bg);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   padding: 1rem;
}

.status-row {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 0.5rem 0;
   border-bottom: 1px solid var(--color-border);
}

.status-row:last-child {
   border-bottom: none;
}

.status-row.error .status-value {
   color: var(--color-error);
   font-size: 0.875rem;
}

.status-label {
   font-size: 0.875rem;
   color: var(--color-text-muted);
}

.status-value {
   font-weight: 500;
}

.status-value.status-completed {
   color: var(--brand-teal);
}

.status-value.status-running {
   color: #f59e0b;
}

.status-value.status-failed {
   color: var(--color-error);
}

.progress-container {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   flex: 1;
   max-width: 200px;
}

.progress-bar {
   flex: 1;
   height: 8px;
   background: var(--color-border);
   border-radius: 4px;
   overflow: hidden;
}

.progress-fill {
   height: 100%;
   background: var(--brand-teal);
   transition: width 0.3s ease;
}

.progress-text {
   font-size: 0.875rem;
   font-weight: 500;
   min-width: 40px;
   text-align: right;
}

/* Schedule Form */
.schedule-form {
   background: var(--color-bg);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   padding: 1rem;
}

.form-row {
   margin-bottom: 1rem;
}

.form-row:last-of-type {
   margin-bottom: 0;
}

.form-row label {
   display: block;
   font-size: 0.875rem;
   font-weight: 500;
   margin-bottom: 0.5rem;
}

.form-row select {
   width: 100%;
   padding: 0.5rem;
   font-size: 0.875rem;
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   background: var(--color-surface);
   color: var(--color-text);
}

.toggle-label {
   display: flex;
   align-items: center;
   gap: 0.5rem;
   cursor: pointer;
}

.toggle-label input[type="checkbox"] {
   width: 18px;
   height: 18px;
   accent-color: var(--brand-teal);
}

.next-run {
   font-size: 0.875rem;
   color: var(--color-text-muted);
}

.form-actions {
   display: flex;
   gap: 0.75rem;
   margin-top: 1rem;
   padding-top: 1rem;
   border-top: 1px solid var(--color-border);
}

.btn-secondary {
   padding: 0.5rem 1rem;
   font-size: 0.875rem;
   font-weight: 500;
   color: var(--color-text);
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   cursor: pointer;
}

.btn-secondary:hover {
   background: var(--color-bg);
}

/* Recent Runs */
.recent-runs {
   background: var(--color-bg);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   overflow: hidden;
}

.run-item {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   padding: 0.75rem 1rem;
   border-bottom: 1px solid var(--color-border);
}

.run-item:last-child {
   border-bottom: none;
}

.run-status {
   width: 20px;
   height: 20px;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 0.75rem;
   border-radius: 50%;
   flex-shrink: 0;
}

.run-status.run-status-completed {
   background: var(--brand-teal);
   color: white;
}

.run-status.run-status-failed {
   background: var(--color-error);
   color: white;
}

.run-status.run-status-running {
   background: #f59e0b;
   color: white;
}

.run-status.run-status-pending {
   background: var(--color-border);
   color: var(--color-text-muted);
}

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

.run-time {
   font-size: 0.875rem;
}

.run-error {
   font-size: 0.75rem;
   color: var(--color-error);
   margin-top: 2px;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

.run-duration {
   font-size: 0.75rem;
   color: var(--color-text-muted);
   font-family: monospace;
}

.no-runs {
   color: var(--color-text-muted);
   font-size: 0.875rem;
   padding: 1rem;
   text-align: center;
   background: var(--color-bg);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
}

/* Toast */
@keyframes fadeIn {
   from {
      opacity: 0;
      transform: translateY(10px);
   }
   to {
      opacity: 1;
      transform: translateY(0);
   }
}

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

/* ==========================================================================
   Login Error
   ========================================================================== */

.error-message {
   color: var(--color-error);
   text-align: center;
   margin-bottom: 1rem;
}

.error-detail {
   text-align: center;
   color: var(--color-text-muted);
   margin-bottom: 1.5rem;
}

.login-hint {
   text-align: center;
   color: var(--color-text-muted);
   font-size: 0.875rem;
   margin-top: 1rem;
}

.login-message {
   text-align: center;
   color: var(--brand-teal);
   font-size: 0.9375rem;
   margin-bottom: 1.5rem;
   padding: 0.75rem 1rem;
   background: hsl(from var(--brand-teal) h s l / 0.1);
   border-radius: var(--radius);
}

/* ==========================================================================
   List-Detail Pattern (reusable for users, etc.)
   ========================================================================== */

.list-detail-layout {
   display: grid;
   grid-template-columns: 280px 1fr;
   gap: 1.5rem;
   height: calc(100vh - 180px);
}

.list-panel {
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   overflow: hidden;
   display: flex;
   flex-direction: column;
}

.list-filter {
   padding: 0.75rem;
   border-bottom: 1px solid var(--color-border);
   background: var(--color-bg);
}

.list-filter input {
   width: 100%;
   padding: 0.5rem 0.75rem;
   font-size: 0.875rem;
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   background: var(--color-surface);
   color: var(--color-text);
}

.list-filter input:focus {
   outline: none;
   border-color: var(--brand-teal);
}

.list-items {
   flex: 1;
   overflow-y: auto;
}

.list-item {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   padding: 0.75rem 1rem;
   border-bottom: 1px solid var(--color-border);
   text-decoration: none;
   color: var(--color-text);
   cursor: pointer;
}

.list-item:last-child {
   border-bottom: none;
}

.list-item:hover {
   background: var(--color-bg);
}

.list-item.active {
   background: var(--color-bg);
   border-left: 3px solid var(--brand-teal);
   padding-left: calc(1rem - 3px);
}

.list-item-avatar {
   width: 32px;
   height: 32px;
   border-radius: 50%;
   flex-shrink: 0;
   object-fit: cover;
}

.list-item-avatar.placeholder {
   background: var(--brand-safe-harbor);
   color: white;
   display: flex;
   align-items: center;
   justify-content: center;
   font-weight: 600;
   font-size: 0.875rem;
}

.list-item-content {
   flex: 1;
   min-width: 0;
}

.list-item-name {
   font-weight: 500;
   font-size: 0.875rem;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

.list-item-meta {
   font-size: 0.75rem;
   color: var(--color-text-muted);
   margin-top: 2px;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

.list-item-badge {
   font-size: 0.625rem;
   padding: 0.125rem 0.375rem;
   border-radius: 4px;
   text-transform: uppercase;
   font-weight: 600;
   flex-shrink: 0;
}

.list-item-badge.disabled {
   background: var(--color-error);
   color: white;
}

.list-item-badge.pending {
   background: #f59e0b;
   color: white;
}

.detail-panel {
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   padding: 1.5rem;
   overflow-y: auto;
}

.detail-empty {
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   height: 100%;
   color: var(--color-text-muted);
   gap: 1rem;
}

.detail-empty svg {
   width: 48px;
   height: 48px;
}

@media (max-width: 768px) {
   .list-detail-layout {
      grid-template-columns: 1fr;
      grid-template-rows: auto 1fr;
   }

   .list-panel {
      max-height: 200px;
   }
}

/* User Detail */
.user-detail-header {
   display: flex;
   align-items: center;
   gap: 1rem;
   margin-bottom: 1.5rem;
   padding-bottom: 1.5rem;
   border-bottom: 1px solid var(--color-border);
}

.user-detail-avatar {
   width: 64px;
   height: 64px;
   border-radius: 50%;
   flex-shrink: 0;
   object-fit: cover;
}

.user-detail-avatar.placeholder {
   background: var(--brand-safe-harbor);
   color: white;
   display: flex;
   align-items: center;
   justify-content: center;
   font-weight: 600;
   font-size: 1.5rem;
}

.user-detail-info h2 {
   font-size: 1.25rem;
   font-weight: 600;
   margin: 0 0 0.25rem 0;
}

.user-detail-email {
   font-size: 0.875rem;
   color: var(--color-text-muted);
}

.user-form .form-section {
   margin-bottom: 1.5rem;
}

.user-form .form-section h3 {
   font-size: 0.875rem;
   font-weight: 600;
   color: var(--color-text-muted);
   text-transform: uppercase;
   letter-spacing: 0.05em;
   margin-bottom: 0.75rem;
}

.form-hint {
   font-size: 0.75rem;
   color: var(--color-text-muted);
   margin-top: 0.25rem;
}

.role-descriptions {
   margin-top: 0.75rem;
   font-size: 0.75rem;
   color: var(--color-text-muted);
}

.role-desc {
   margin-bottom: 0.25rem;
}

.info-grid {
   background: var(--color-bg);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   padding: 0.75rem 1rem;
}

.info-row {
   display: flex;
   justify-content: space-between;
   padding: 0.5rem 0;
   border-bottom: 1px solid var(--color-border);
}

.info-row:last-child {
   border-bottom: none;
}

.info-label {
   font-size: 0.875rem;
   color: var(--color-text-muted);
}

.info-value {
   font-size: 0.875rem;
   font-weight: 500;
}

/* ==========================================================================
   Pending Approval Page
   ========================================================================== */

.pending-container {
   display: flex;
   align-items: center;
   justify-content: center;
   min-height: calc(100vh - 180px);
}

.pending-card {
   background: var(--color-surface);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   padding: 3rem;
   text-align: center;
   max-width: 400px;
}

.pending-card svg {
   width: 64px;
   height: 64px;
   color: #f59e0b;
   margin-bottom: 1.5rem;
}

.pending-card h1 {
   font-size: 1.5rem;
   font-weight: 600;
   margin: 0 0 1rem 0;
}

.pending-message {
   color: var(--color-text);
   margin-bottom: 0.5rem;
}

.pending-hint {
   color: var(--color-text-muted);
   font-size: 0.875rem;
   margin-bottom: 1.5rem;
}

/* ==========================================================================
   Portfolio Styles
   ========================================================================== */

/* Sidebar Sort Button */
.sidebar-sort {
   padding: 0.5rem 1rem;
   border-bottom: 1px solid var(--color-border);
}

.sort-btn {
   background: none;
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   padding: 0.25rem 0.75rem;
   cursor: pointer;
   font-size: 0.75rem;
   color: var(--color-text-muted);
}

.sort-btn:hover {
   background: var(--color-bg);
}

.sort-btn.active {
   background: var(--brand-teal);
   color: white;
   border-color: var(--brand-teal);
}

/* Sidebar Warning Icon */
.sidebar-icon-warning {
   display: flex;
   align-items: center;
   color: #f59e0b;
   flex-shrink: 0;
}

.sidebar-icon-warning svg {
   width: 16px;
   height: 16px;
}

/* Sidebar Manager Filter */
.sidebar-manager-filter {
   padding: 0.5rem 0.75rem;
   border-bottom: 1px solid var(--color-border);
}

.sidebar-manager-filter select {
   width: 100%;
   padding: 0.375rem 0.5rem;
   font-size: 0.75rem;
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   background: var(--color-surface);
   color: var(--color-text);
   cursor: pointer;
}

.sidebar-manager-filter select:focus {
   outline: none;
   border-color: var(--brand-teal);
}

/* Status Badges */
.status-badge {
   display: inline-block;
   padding: 0.125rem 0.5rem;
   border-radius: var(--radius);
   font-size: 0.75rem;
   font-weight: 500;
   text-transform: capitalize;
}

.status-active {
   background: var(--brand-market-mint);
   color: var(--brand-deep-pockets);
}

.status-inactive {
   background: var(--color-border);
   color: var(--color-text-muted);
}

.status-pending {
   background: #fef3c7;
   color: #92400e;
}

/* Priority Badges */
.priority-badge {
   display: inline-block;
   padding: 0.125rem 0.5rem;
   border-radius: var(--radius);
   font-size: 0.75rem;
   font-weight: 500;
   text-transform: capitalize;
}

.priority-low {
   background: var(--color-border);
   color: var(--color-text-muted);
}

.priority-medium {
   background: #dbeafe;
   color: #1e40af;
}

.priority-high {
   background: #fee2e2;
   color: #991b1b;
}

/* Portfolio Detail Header */
.portfolio-detail-header {
   display: flex;
   align-items: center;
   gap: 1rem;
   padding-bottom: 1.5rem;
   border-bottom: 1px solid var(--color-border);
   margin-bottom: 1.5rem;
}

.portfolio-detail-icon {
   width: 3rem;
   height: 3rem;
   color: var(--brand-teal);
}

.portfolio-detail-icon svg {
   width: 100%;
   height: 100%;
}

.portfolio-detail-info h2 {
   font-size: 1.5rem;
   font-weight: 600;
}

.portfolio-detail-meta {
   color: var(--color-text-muted);
   font-size: 0.875rem;
}

.portfolio-detail-info {
   flex: 1;
}

/* Portfolio Edit Form */
.portfolio-edit-header {
   display: flex;
   align-items: center;
   justify-content: space-between;
   padding-bottom: 1.5rem;
   border-bottom: 1px solid var(--color-border);
   margin-bottom: 1.5rem;
}

.portfolio-edit-header h2 {
   font-size: 1.25rem;
   font-weight: 600;
}

.form-section {
   margin-bottom: 1.5rem;
   padding-bottom: 1.5rem;
   border-bottom: 1px solid var(--color-border);
}

.form-section:last-of-type {
   border-bottom: none;
}

.form-section h3 {
   font-size: 0.875rem;
   font-weight: 600;
   color: var(--color-text-muted);
   text-transform: uppercase;
   letter-spacing: 0.05em;
   margin-bottom: 1rem;
}

.form-grid {
   display: grid;
   grid-template-columns: repeat(2, 1fr);
   gap: 1rem;
}

.form-field {
   display: flex;
   flex-direction: column;
   gap: 0.375rem;
}

.form-field-wide {
   grid-column: span 2;
}

.form-label {
   font-size: 0.875rem;
   font-weight: 500;
   color: var(--color-text-muted);
}

.form-field input,
.form-field select,
.form-field textarea {
   width: 100%;
   padding: 0.5rem 0.75rem;
   font-size: 0.875rem;
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
   background: var(--color-surface);
   color: var(--color-text);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
   outline: none;
   border-color: var(--brand-teal);
}

.form-field select {
   appearance: none;
   background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
   background-repeat: no-repeat;
   background-position: right 0.75rem center;
   padding-right: 2rem;
}

.form-field input[type="date"] {
   color-scheme: dark;
}

.form-field textarea {
   resize: vertical;
   min-height: 60px;
}

.form-checkboxes {
   display: flex;
   flex-wrap: wrap;
   gap: 1rem;
}

.form-checkbox {
   display: flex;
   align-items: center;
   gap: 0.5rem;
   cursor: pointer;
   font-size: 0.875rem;
}

.form-checkbox input[type="checkbox"] {
   width: 18px;
   height: 18px;
   accent-color: var(--brand-teal);
}

.form-help {
   font-size: 0.75rem;
   color: var(--color-text-muted);
   margin-top: 0.5rem;
}

.btn {
   padding: 0.5rem 1rem;
   font-size: 0.875rem;
   font-weight: 500;
   border-radius: var(--radius);
   cursor: pointer;
   transition: all 0.15s;
}

.btn-sm {
   padding: 0.25rem 0.5rem;
   font-size: 0.75rem;
}

.btn-danger {
   background: var(--color-error);
   color: white;
   border: none;
}

.btn-danger:hover {
   background: #aa2222;
}

/* Credentials Section */
.credentials-section {
   margin-top: 2rem;
}

.credentials-list {
   display: flex;
   flex-direction: column;
   gap: 0.5rem;
}

.credential-item {
   display: flex;
   align-items: center;
   justify-content: space-between;
   padding: 0.75rem 1rem;
   background: var(--color-bg);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
}

.credential-info {
   display: flex;
   flex-wrap: wrap;
   gap: 0.5rem 1rem;
   align-items: center;
}

.credential-platform {
   font-weight: 500;
}

.credential-type {
   font-size: 0.875rem;
   color: var(--color-text-muted);
}

.credential-expires {
   font-size: 0.75rem;
   color: var(--color-text-muted);
}

.empty-state {
   color: var(--color-text-muted);
   font-size: 0.875rem;
   padding: 1rem;
   text-align: center;
   background: var(--color-bg);
   border: 1px solid var(--color-border);
   border-radius: var(--radius);
}

@media (max-width: 768px) {
   .form-grid {
      grid-template-columns: 1fr;
   }

   .form-field-wide {
      grid-column: span 1;
   }
}

/* ==========================================================================
   Impersonation
   ========================================================================== */

.impersonation-banner {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 1rem;
   padding: 0.5rem 1.5rem;
   background: linear-gradient(90deg, #f59e0b, #ea580c);
   color: white;
   font-size: 0.875rem;
   font-weight: 500;
}

.impersonation-text strong {
   font-weight: 600;
}

.impersonation-stop {
   background: rgba(255, 255, 255, 0.2);
   border: 1px solid rgba(255, 255, 255, 0.3);
   color: white;
   padding: 0.25rem 0.75rem;
   border-radius: var(--radius);
   cursor: pointer;
   font-size: 0.8125rem;
   font-weight: 500;
   transition: background 0.15s;
}

.impersonation-stop:hover {
   background: rgba(255, 255, 255, 0.3);
}

.impersonate-link {
   width: 100%;
   text-align: left;
   background: none;
   border: none;
   padding: 0.5rem 1rem;
   cursor: pointer;
   color: inherit;
   font-size: inherit;
}

.impersonate-link:hover {
   background: var(--color-bg);
}

.impersonate-dialog {
   padding: 0;
   border: none;
   border-radius: var(--radius);
   box-shadow: var(--shadow);
   max-width: 480px;
   width: 90vw;
}

.impersonate-dialog::backdrop {
   background: rgba(0, 0, 0, 0.5);
}

.impersonate-dialog .dialog-header {
   display: flex;
   align-items: center;
   justify-content: space-between;
   padding: 1rem 1.5rem;
   border-bottom: 1px solid var(--color-border);
}

.impersonate-dialog .dialog-header h3 {
   margin: 0;
   font-size: 1.125rem;
   font-weight: 600;
}

.impersonate-dialog .dialog-close {
   background: none;
   border: none;
   font-size: 1.5rem;
   cursor: pointer;
   color: var(--color-text-muted);
   line-height: 1;
   padding: 0.25rem;
}

.impersonate-dialog .dialog-close:hover {
   color: var(--color-text);
}

.impersonate-dialog .dialog-body {
   padding: 1rem 1.5rem 1.5rem;
}

.impersonate-dialog .dialog-hint {
   color: var(--color-text-muted);
   font-size: 0.875rem;
   margin-bottom: 1rem;
}

.impersonate-list {
   list-style: none;
   max-height: 400px;
   overflow-y: auto;
}

.impersonate-item {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   padding: 0.75rem;
   cursor: pointer;
   border-radius: var(--radius);
   transition: background 0.15s;
}

.impersonate-item:hover {
   background: var(--color-bg);
}

.impersonate-avatar img,
.impersonate-avatar .avatar {
   width: 40px;
   height: 40px;
   border-radius: 50%;
   object-fit: cover;
}

.impersonate-avatar .placeholder {
   display: flex;
   align-items: center;
   justify-content: center;
   background: var(--brand-teal);
   color: white;
   font-weight: 600;
}

.impersonate-info {
   display: flex;
   flex-direction: column;
   gap: 0.125rem;
}

.impersonate-name {
   font-weight: 500;
}

.impersonate-meta {
   font-size: 0.75rem;
   color: var(--color-text-muted);
}

.impersonate-empty {
   padding: 2rem 1rem;
   text-align: center;
   color: var(--color-text-muted);
}
