:root {
  --brand: #8b7cf8;
  --brand-2: #6d5ce8;
  --brand-soft: rgba(139, 124, 248, .12);
  --background: #09090b;
  --card: #141416;
  --muted: #0f0f11;
  --surface: #18181b;
  --surface-2: #1f1f23;
  --text: #fafafa;
  --subtle: #a1a1aa;
  --border: #27272a;
  --border-soft: rgba(255, 255, 255, .06);
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .28);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --motion-fast: .14s;
  --motion-base: .2s;
  --motion-slow: .32s;
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
  --scrollbar-track: #111113;
  --scrollbar-thumb: #3f3f46;
  --scrollbar-thumb-hover: #6366f1;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23a78bfa' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --select-arrow-focus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23c4b5fd' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border: 2px solid var(--scrollbar-track);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

*::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}
html { scroll-behavior: smooth; }
html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  display: flex;
  border-radius: 0;
  background: var(--muted);
  box-shadow: none;
  border: 0;
  overflow: hidden;
  animation: uiAppEnter var(--motion-slow) var(--motion-ease);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  border: 0;
  padding: 0;
  background: rgba(0, 0, 0, .52);
  backdrop-filter: blur(3px);
  cursor: pointer;
}

body.sidebar-collapsed .sidebar {
  width: 76px;
  flex-basis: 76px;
}

.sidebar {
  width: 248px;
  flex: 0 0 248px;
  height: 100%;
  padding: 18px 14px;
  color: var(--text);
  background: var(--card);
  border-right: 1px solid var(--border);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: width .22s ease, flex-basis .22s ease, transform .25s var(--motion-ease);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 28px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(139, 124, 248, .22);
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--subtle);
  font-weight: 500;
  font-size: 11px;
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--subtle);
  background: var(--surface);
  box-shadow: none;
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.sidebar-collapsed .brand {
  justify-content: center;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .sidebar-user-meta,
body.sidebar-collapsed .sidebar-user-logout,
body.sidebar-collapsed .nav-label {
  display: none;
}

body.sidebar-collapsed .brand-left {
  justify-content: center;
}

body.sidebar-collapsed .sidebar-toggle {
  position: absolute;
  top: 62px;
  left: 50%;
  transform: translateX(-50%) rotate(180deg);
}

body.sidebar-collapsed .sidebar nav {
  margin-top: 42px;
}

.sidebar nav {
  display: grid;
  gap: 7px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--subtle);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background var(--motion-fast) ease, color var(--motion-fast) ease;
  font-size: 13px;
  font-weight: 500;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  font-weight: 900;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

body.sidebar-collapsed .sidebar a {
  justify-content: center;
  padding: 12px;
}

.sidebar a:hover {
  background: var(--surface);
  color: var(--text);
}

.sidebar a.active {
  background: var(--brand-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(139, 124, 248, .18);
}

.sidebar-user {
  margin-top: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  min-width: 0;
}

.sidebar-user-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.sidebar-user-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(139, 124, 248, .2);
}

.sidebar-user-meta {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sidebar-user-email {
  font-size: 11px;
  line-height: 1.4;
  color: var(--subtle);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.sidebar-user-role {
  font-size: 11px;
  font-weight: 500;
  color: var(--subtle);
  line-height: 1.3;
}

.sidebar-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sidebar-user-logout {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--subtle);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  transition: color var(--motion-fast) ease, border-color var(--motion-fast) ease;
  white-space: nowrap;
}

.sidebar-user-logout:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--brand) 22%, var(--border));
}

body.sidebar-collapsed .sidebar-user {
  padding: 10px 8px;
  align-items: center;
  gap: 0;
}

body.sidebar-collapsed .sidebar-user-meta,
body.sidebar-collapsed .sidebar-user-actions {
  display: none;
}

body.sidebar-collapsed .sidebar-user-head {
  justify-content: center;
}

body.sidebar-collapsed .sidebar-user-avatar {
  width: 40px;
  height: 40px;
  font-size: 12px;
}

.main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
  background: var(--background);
  border-radius: 0;
  padding: 16px 20px 28px;
  scroll-padding-top: 88px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 8px 0 16px;
  margin-bottom: 12px;
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.topbar-copy {
  flex: 1;
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 600;
  letter-spacing: -.03em;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 13px;
}

.mobile-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  box-shadow: none;
  place-items: center;
}

.mobile-nav-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.userbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 8px 6px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.userbox span {
  font-size: 13px;
  color: var(--subtle);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.userbox a {
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
}

.cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: uiTabEnter var(--motion-slow) var(--motion-ease);
}

.dashboard-shortcuts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-shortcuts button {
  box-shadow: none;
}

.card,
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card {
  min-height: 112px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color var(--motion-base) ease, background var(--motion-base) ease;
}

.card:hover {
  border-color: color-mix(in srgb, var(--brand) 24%, var(--border));
  background: var(--surface);
}

.card .label {
  color: var(--subtle);
  font-size: 13px;
  font-weight: 700;
}

.card .value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
}

.panel:hover {
  border-color: color-mix(in srgb, var(--brand) 18%, var(--border));
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-title h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -.02em;
}

.panel-title p {
  margin: 5px 0 0;
  color: var(--subtle);
  font-size: 13px;
}

.searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-clear-button {
  flex-shrink: 0;
  box-shadow: none;
  white-space: nowrap;
}

.searchbar input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 14px;
  outline: none;
  color: var(--text);
  transition: border-color var(--motion-base) ease, box-shadow var(--motion-base) ease;
}

.searchbar input:focus {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  box-shadow: 0 0 0 3px var(--brand-soft);
}

button,
.searchbar button,
.button-link {
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border));
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  box-shadow: none;
  transition: background var(--motion-fast) ease, border-color var(--motion-fast) ease, opacity var(--motion-fast) ease;
}

button:hover,
.searchbar button:hover,
.button-link:hover {
  filter: brightness(1.06);
}

button:active,
.searchbar button:active,
.button-link:active {
  transform: scale(.98);
}

.button-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.excel-button {
  position: relative;
  gap: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #052e16;
  border: 1px solid rgba(134, 239, 172, .7);
  box-shadow: 0 12px 26px rgba(34, 197, 94, .24), 0 0 18px rgba(34, 197, 94, .18);
}

.excel-button::before {
  content: 'XLS';
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 24px;
  border-radius: 8px;
  background: rgba(5, 46, 22, .16);
  color: #052e16;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
}

.excel-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.panel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: #1b1529;
  color: var(--subtle);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

tr:last-child td { border-bottom: 0; }

.platform-inventory {
  display: grid;
  gap: 18px;
}

.platform-group {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #120e1d;
  overflow: hidden;
}

.platform-group.has-alert {
  border-color: rgba(245, 158, 11, .28);
}

.platform-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0));
  cursor: pointer;
  list-style: none;
}

.platform-header::-webkit-details-marker {
  display: none;
}

.platform-group[open] .platform-header {
  border-bottom: 1px solid var(--border);
}

.platform-header::after {
  content: '▾';
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: rgba(255,255,255,.035);
  font-size: 14px;
  font-weight: 800;
  flex: 0 0 auto;
  transition: transform var(--motion-base) var(--motion-ease), background var(--motion-base) ease, border-color var(--motion-base) ease;
}

.platform-group[open] .platform-header::after {
  transform: rotate(180deg);
  background: rgba(139, 92, 246, .18);
  border-color: rgba(139, 92, 246, .35);
}

.platform-group[open] .plan-grid {
  animation: detailsReveal var(--motion-base) var(--motion-ease);
}

.platform-header h3 {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: -.03em;
}

.platform-main {
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.platform-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
}

.platform-summary span {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
  padding: 9px 12px;
  color: var(--subtle);
  font-size: 12px;
  transition: transform var(--motion-fast) var(--motion-ease), background var(--motion-base) ease, border-color var(--motion-base) ease;
}

.platform-summary strong {
  color: var(--text);
  font-size: 16px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 16px;
}

.plan-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #171225;
  padding: 16px;
  display: grid;
  gap: 14px;
  transition: transform var(--motion-base) var(--motion-ease), box-shadow var(--motion-base) ease, border-color var(--motion-base) ease;
}

.plan-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, .32);
  box-shadow: 0 14px 30px rgba(15, 10, 28, .28);
}

.plan-card.ok {
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, .08);
}

.plan-card.warn {
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, .14);
}

.plan-card.danger {
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, .14);
}

.plan-card-top,
.plan-actions,
.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.plan-id {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}

.plan-card h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  min-height: 42px;
}

.plan-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.plan-metrics div {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  background: #120e1d;
}

.plan-metrics strong {
  display: block;
  font-size: 21px;
  line-height: 1;
}

.plan-metrics span,
.progress-row {
  color: var(--subtle);
  font-size: 12px;
}

.plan-progress {
  display: grid;
  gap: 7px;
}

.progress-bar {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: #0d0a16;
  border: 1px solid var(--border);
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.plan-actions button {
  padding: 9px 11px;
  font-size: 12px;
  border-radius: 12px;
  box-shadow: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.ok { background: rgba(22, 163, 74, .18); color: #86efac; }
.warn { background: rgba(217, 119, 6, .18); color: #fcd34d; }
.danger { background: rgba(220, 38, 38, .18); color: #fca5a5; }

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 13px;
  background: #1b1529;
}

.item strong { display: block; }
.muted { color: var(--subtle); }

.account-preview {
  white-space: pre-wrap;
  font-size: 13px;
  color: #d6d3e1;
  max-height: 110px;
  overflow: auto;
  background: #120e1d;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  margin-top: 9px;
}

.inventory-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

.inventory-date-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, .12);
}

.inventory-date-filters .filter-field {
  flex: 0 1 168px;
  min-width: 140px;
}

.inventory-date-filters input[type="date"],
.inventory-date-filters select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--border);
  background-color: #1d172d;
  color: var(--text);
  border-radius: 14px;
  padding: 11px 12px;
  outline: none;
  font: inherit;
  color-scheme: dark;
}

.inventory-date-filters input[type="date"]::-webkit-datetime-edit,
.inventory-date-filters input[type="date"]::-webkit-datetime-edit-fields-wrapper,
.inventory-date-filters input[type="date"]::-webkit-datetime-edit-text,
.inventory-date-filters input[type="date"]::-webkit-datetime-edit-month-field,
.inventory-date-filters input[type="date"]::-webkit-datetime-edit-day-field,
.inventory-date-filters input[type="date"]::-webkit-datetime-edit-year-field {
  color: var(--text);
  background: transparent;
}

.inventory-date-filters input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: .85;
}

.inventory-date-filters input[type="date"]:focus,
.inventory-date-filters select:focus {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.inventory-date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  flex: 1 1 280px;
  padding-bottom: 1px;
}

.date-preset {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  box-shadow: none;
}

.date-preset:hover,
.date-preset:focus-visible {
  border-color: rgba(167, 139, 250, .55);
  background: rgba(139, 92, 246, .12);
  filter: none;
  outline: none;
}

.date-preset.is-active {
  border-color: rgba(167, 139, 250, .75);
  background: rgba(139, 92, 246, .22);
  color: #ddd6fe;
}

.filter-bar {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #120e1d;
}

.filter-bar-inventory {
  gap: 10px;
}

.filter-bar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.filter-bar-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  width: 100%;
}

.filter-toolbar-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-toolbar-button {
  box-shadow: none;
  white-space: nowrap;
}

.filter-bar-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  padding-top: 2px;
}

.filter-bar-chips[hidden] {
  display: none !important;
}

.filter-bar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 10px;
  padding-top: 2px;
  border-top: 1px solid rgba(148, 163, 184, .1);
}

.filter-bar-fields + .filter-bar-meta {
  margin-top: -2px;
}

.filter-bar-meta .filter-clear-button {
  flex-shrink: 0;
}

.filter-active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(139, 92, 246, .35);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(139, 92, 246, .12);
  color: #ddd6fe;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: background var(--motion-fast) ease, border-color var(--motion-fast) ease;
}

.filter-chip::after {
  content: "×";
  font-size: 14px;
  line-height: 1;
  opacity: .75;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  background: rgba(139, 92, 246, .2);
  border-color: rgba(167, 139, 250, .55);
  outline: none;
}

.filter-clear-button {
  flex-shrink: 0;
  box-shadow: none;
}

.filter-field {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
}

.filter-field-label {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--subtle);
}

.color-picker-field {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
}

.color-picker-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--subtle);
}

.color-picker-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background-color: #1d172d;
}

.color-picker-control input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.color-picker-control input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.color-picker-control input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 6px;
}

.color-picker-control input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 6px;
}

.color-picker-value {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.inventory-create-form .color-picker-field,
.managed-controls .color-picker-field,
.bulk-controls .color-picker-field,
.important-add-inventory-form .color-picker-field,
.template-editor-form .color-picker-field {
  grid-column: span 1;
}

.filter-saved-field {
  display: grid;
  gap: 6px;
  min-width: min(240px, 100%);
  flex: 1 1 220px;
  max-width: min(360px, 100%);
}

.filter-bar-inventory .filter-saved-field select {
  width: 100%;
  min-height: 42px;
}

.filter-delete-saved[hidden] {
  display: none !important;
}

.today-panel {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(139, 92, 246, .22);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(139, 92, 246, .08), rgba(18, 14, 29, .92));
}

.today-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.today-panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.today-panel-head p {
  margin: 4px 0 0;
  color: var(--subtle);
  font-size: 13px;
}

.today-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.today-panel-card {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #171223;
  color: var(--text);
  cursor: pointer;
  box-shadow: none;
  transition: transform var(--motion-fast) ease, border-color var(--motion-fast) ease, background var(--motion-fast) ease;
}

.today-panel-card:hover,
.today-panel-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(167, 139, 250, .45);
  outline: none;
}

.today-panel-card.severity-danger {
  border-color: rgba(248, 113, 113, .35);
  background: rgba(127, 29, 29, .18);
}

.today-panel-card.severity-warn {
  border-color: rgba(251, 191, 36, .28);
  background: rgba(120, 53, 15, .16);
}

.today-panel-value {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.today-panel-label {
  font-size: 14px;
  font-weight: 850;
}

.today-panel-desc {
  font-size: 12px;
  color: var(--subtle);
  line-height: 1.35;
}

.toast-host {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 12000;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #1a1428;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .24s ease, transform .24s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-color: rgba(34, 197, 94, .35);
  background: rgba(20, 83, 45, .92);
}

.toast-error {
  border-color: rgba(248, 113, 113, .35);
  background: rgba(127, 29, 29, .92);
}

.toast-info {
  border-color: rgba(139, 92, 246, .35);
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 18px;
  border: 1px dashed rgba(148, 163, 184, .22);
  border-radius: 18px;
  text-align: center;
  background: rgba(18, 14, 29, .55);
}

.empty-state-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(139, 92, 246, .12);
  color: #c4b5fd;
  font-size: 18px;
}

.empty-state p {
  margin: 0;
  max-width: 46ch;
}

.empty-state-action {
  margin-top: 4px;
  box-shadow: none;
}

.skeleton-block {
  display: grid;
  gap: 10px;
}

.skeleton-line,
.skeleton-toolbar {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(148, 163, 184, .08), rgba(148, 163, 184, .18), rgba(148, 163, 184, .08));
  background-size: 200% 100%;
  animation: skeletonPulse 1.2s ease-in-out infinite;
}

.skeleton-toolbar {
  height: 36px;
  margin-bottom: 8px;
  border-radius: 12px;
}

.skeleton-line:nth-child(3n) { width: 92%; }
.skeleton-line:nth-child(3n + 1) { width: 78%; }
.skeleton-line:nth-child(3n + 2) { width: 86%; }

@keyframes skeletonPulse {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.inventory-board-loading {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #120e1d;
}

.row-copy-actions {
  display: inline-flex;
  gap: 4px;
  margin-right: 4px;
}

.row-copy-button {
  min-width: 34px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 900;
  box-shadow: none;
}

.inventory-create-box {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 14px;
  background: #120e1d;
}

.inventory-create-box summary {
  cursor: pointer;
  font-weight: 850;
  color: var(--text);
  transition: color var(--motion-base) ease;
}

.inventory-create-box[open] > .inventory-create-form {
  animation: detailsReveal var(--motion-base) var(--motion-ease);
}

.inventory-create-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.inventory-create-form textarea {
  grid-column: span 3;
  min-height: 46px;
  resize: vertical;
}

.inventory-create-form label[data-profile-field] {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--subtle);
}

.inventory-create-form [data-family-field]:disabled,
.family-fields input:disabled {
  opacity: .45;
  cursor: not-allowed;
  background: #151020;
}

.family-hint {
  grid-column: 1 / -1;
  color: var(--subtle);
  font-size: 12px;
}

.inventory-create-form button {
  box-shadow: none;
}

.inventory-filters input,
.inventory-filters select,
.inventory-create-form input,
.inventory-create-form select,
.inventory-create-form textarea,
.managed-controls input,
.managed-controls select,
.family-fields input,
.comment-box input,
.managed-notes textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background-color: #1d172d;
  color: var(--text);
  border-radius: 14px;
  padding: 11px 12px;
  outline: none;
}

.inventory-filters select,
.inventory-create-form select,
.managed-controls select,
.important-filters select,
.bulk-controls select,
select:not([multiple]):not([size]):not(.custom-select-native) {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 36px;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.custom-select-native {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.custom-select-trigger {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  background-color: #1d172d;
  color: var(--text);
  border-radius: 14px;
  padding: 11px 36px 11px 12px;
  text-align: left;
  font: inherit;
  line-height: 1.35;
  cursor: pointer;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition:
    border-color var(--motion-base) ease,
    box-shadow var(--motion-base) ease,
    transform var(--motion-fast) var(--motion-ease),
    background-image var(--motion-base) ease;
}

.custom-select-trigger.is-placeholder {
  color: var(--subtle);
}

.custom-select-trigger:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.custom-select.is-open .custom-select-trigger {
  border-color: rgba(139, 92, 246, .55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .12);
  background-image: var(--select-arrow-focus);
}

.custom-select.is-open-animate .custom-select-trigger {
  transform: translateY(-1px);
}

.custom-select-menu {
  max-height: min(280px, 52vh);
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(139, 92, 246, .28);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(29, 23, 45, .98) 0%, rgba(17, 13, 29, .98) 100%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .48);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top center;
  transition:
    opacity var(--motion-base) var(--motion-ease),
    transform var(--motion-base) var(--motion-ease);
  pointer-events: none;
}

.custom-select-menu[hidden] {
  display: none !important;
}

.custom-select:not(.is-open) .custom-select-menu:not(.is-menu-open) {
  display: none !important;
}

.custom-select-menu.is-menu-open {
  display: block !important;
}

.custom-select.is-open-animate .custom-select-menu,
.custom-select-menu.is-menu-animate {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.custom-select.is-open-animate .custom-select-option,
.custom-select-menu.is-menu-animate .custom-select-option {
  opacity: 1;
  transform: translateY(0);
}

.custom-select-option {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    background var(--motion-fast) ease,
    transform var(--motion-fast) ease,
    color var(--motion-fast) ease;
}

.platform-option-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.platform-option-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-option-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.platform-option-img {
  object-fit: cover;
  background: #111827;
  border: 1px solid rgba(148, 163, 184, .18);
}

.platform-option-fallback {
  color: #fff;
  background: var(--platform-accent, #6366f1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

.custom-select-trigger .platform-option-item {
  width: 100%;
}

.custom-select-trigger .platform-option-name {
  font-weight: 600;
}

.custom-select.is-open-animate .custom-select-option {
  animation: customSelectOptionIn var(--motion-base) var(--motion-ease) forwards;
  animation-delay: calc(var(--option-index, 0) * 24ms);
}

.custom-select-option:hover:not(:disabled) {
  background: rgba(139, 92, 246, .16);
  transform: translateX(2px);
}

.custom-select-option.is-selected {
  background: rgba(139, 92, 246, .22);
  color: #e9d5ff;
  font-weight: 600;
}

.custom-select-option.is-active {
  background: rgba(139, 92, 246, .28);
  color: #f3e8ff;
  box-shadow: inset 0 0 0 1px rgba(196, 181, 253, .45);
}

.custom-select-option.is-selected.is-active {
  background: rgba(139, 92, 246, .34);
}

.custom-select-option:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.bulk-controls .custom-select-trigger {
  min-height: 42px;
  height: 42px;
}

@keyframes customSelectOptionIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

select:not([multiple]):not([size])::-ms-expand {
  display: none;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.main:has(#gestion.tab-panel.active) {
  scroll-padding-bottom: 24px;
}

.inventory-board {
  display: block;
}

.inventory-board-shell {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: visible;
}

.inventory-board-shell .inventory-table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  overflow: visible;
}

.inventory-live,
.setup-warning {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: #1b1529;
}

.inventory-live {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--subtle);
  font-size: 13px;
}

.global-important-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(248, 113, 113, .45);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(127, 29, 29, .52), rgba(88, 28, 135, .38)),
    #1b0f1f;
  box-shadow: 0 16px 40px rgba(127, 29, 29, .2);
}

.global-important-alert[hidden] {
  display: none;
}

.global-important-alert strong,
.global-important-alert span {
  display: block;
}

.global-important-alert strong {
  color: #fecaca;
  font-size: 15px;
}

.global-important-alert span {
  margin-top: 3px;
  color: #fde2e2;
  font-size: 13px;
}

.global-important-alert button {
  flex: 0 0 auto;
  background: #ef4444;
  box-shadow: 0 12px 28px rgba(239, 68, 68, .24);
}

.setup-warning {
  display: grid;
  gap: 6px;
  border-color: rgba(217, 119, 6, .35);
}

.setup-warning code {
  color: #fcd34d;
}

.important-accounts-list {
  display: grid;
  gap: 12px;
}

.important-panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.important-panel-actions .secondary:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.important-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px);
  gap: 10px;
  margin-bottom: 0;
}

.important-filters input,
.important-filters select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background-color: #1d172d;
  color: var(--text);
  border-radius: 14px;
  padding: 11px 12px;
  outline: none;
}

.important-section {
  display: grid;
  gap: 12px;
}

.important-section + .important-section {
  margin-top: 10px;
}

.important-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 18px;
  padding: 12px 14px;
  background: #120e1d;
}

.important-section-title h3 {
  margin: 0;
}

.important-section-title span {
  color: var(--subtle);
  font-size: 13px;
}

.important-section.important .important-section-title {
  border-color: rgba(248, 113, 113, .38);
  background: rgba(127, 29, 29, .18);
}

.important-account {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  background: #111827;
}

.important-account-source-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.important-source-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.important-source-chip.is-bot {
  color: #bae6fd;
  background: rgba(14, 116, 144, .24);
  border: 1px solid rgba(56, 189, 248, .35);
}

.important-source-chip.is-rule {
  color: #ddd6fe;
  background: rgba(109, 40, 217, .22);
  border: 1px solid rgba(167, 139, 250, .35);
}

.important-source-chip.is-rule-soft {
  color: #c4b5fd;
  background: rgba(91, 33, 182, .14);
  border: 1px solid rgba(139, 92, 246, .22);
}

.important-source-chip.is-normal {
  color: #fde68a;
  background: rgba(120, 53, 15, .22);
  border: 1px solid rgba(251, 191, 36, .28);
}

.important-source-copy {
  font-size: 12px;
  line-height: 1.35;
}

.important-account.pending {
  border-color: rgba(217, 119, 6, .3);
}

.important-account.is-important {
  border-color: rgba(248, 113, 113, .45);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, .12), 0 20px 50px rgba(127, 29, 29, .16);
}

.important-account.cut {
  opacity: .75;
}

.important-account-main {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.important-account h3 {
  margin: 9px 0 6px;
  font-size: 18px;
}

.important-account p {
  margin: 0;
  color: #d6d3e1;
  white-space: pre-wrap;
}

.important-account-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  color: var(--subtle);
  font-size: 12px;
}

.important-account-actions button {
  background: #ef4444;
  box-shadow: 0 12px 28px rgba(239, 68, 68, .24);
}

.important-account-actions .secondary {
  background: rgba(139, 92, 246, .14);
  border: 1px solid rgba(139, 92, 246, .35);
  color: #ddd6fe;
  box-shadow: none;
}

.important-add-inventory-modal .account-edit-dialog {
  --modal-width: 860px;
}

.important-add-inventory-layout {
  display: grid;
  gap: 16px;
}

.important-add-preview {
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 16px;
  background: rgba(15, 23, 42, .55);
  overflow: hidden;
}

.important-add-preview > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  border-bottom: 1px solid transparent;
}

.important-add-preview[open] > summary {
  border-bottom-color: rgba(148, 163, 184, .12);
}

.important-add-preview > summary::-webkit-details-marker {
  display: none;
}

.important-add-preview > summary::after {
  content: '▾';
  float: right;
  color: var(--subtle);
  transition: transform var(--motion-fast) var(--motion-ease);
}

.important-add-preview:not([open]) > summary::after {
  transform: rotate(-90deg);
}

.important-add-preview-body {
  display: grid;
  gap: 12px;
  padding: 12px 14px 14px;
}

.important-add-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  justify-content: space-between;
}

.important-add-preview-actions p {
  margin: 0;
  flex: 1 1 220px;
  font-size: 12px;
}

.important-add-preview-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.important-add-preview-list div {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(17, 24, 39, .85);
  border: 1px solid rgba(148, 163, 184, .1);
}

.important-add-preview-list dt {
  margin: 0 0 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--subtle);
}

.important-add-preview-list dd {
  margin: 0;
  font-size: 13px;
  word-break: break-word;
}

.important-add-preview-list .copyable-value {
  display: inline;
}

.important-add-preview-block {
  display: grid;
  gap: 8px;
}

.important-add-preview-block strong {
  font-size: 12px;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.important-add-preview-data {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(2, 6, 23, .72);
  border: 1px solid rgba(148, 163, 184, .12);
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
}

.important-add-inventory-form {
  margin-top: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.important-add-inventory-form textarea {
  grid-column: 1 / -1;
}

.important-add-inventory-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
}

.important-add-inventory-status {
  grid-column: 1 / -1;
}

.important-add-inventory-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
  grid-column: 1 / -1;
}

.important-account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, .14);
  color: #d6d3e1;
  font-size: 13px;
}

.important-account-grid span {
  min-width: 0;
  word-break: break-word;
}

.important-cut-info {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(22, 163, 74, .12);
  color: #bbf7d0;
  font-size: 13px;
}

.important-account-data {
  max-height: 150px;
  overflow: auto;
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 16px;
  background: #0b101b;
  color: #d6d3e1;
  white-space: pre-wrap;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.inventory-table-wrap {
  overflow: visible;
  border: 1px solid rgba(34, 211, 238, .35);
  border-radius: 20px;
  background: #0b101b;
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, .2),
    0 0 24px rgba(34, 211, 238, .14);
}

.inventory-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: separate;
  border-spacing: 0;
}

.inventory-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inventory-pagination-top {
  margin: 0;
  padding: 10px 14px;
  gap: 8px 12px;
  border-bottom: 1px solid rgba(34, 211, 238, .28);
  background: linear-gradient(180deg, rgba(15, 23, 42, .96) 0%, rgba(11, 16, 27, .92) 100%);
}

.inventory-pagination-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inventory-pagination-numbers {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.inventory-pagination-ellipsis {
  color: #64748b;
  font-size: 13px;
  padding: 0 2px;
  user-select: none;
}

.inventory-pagination-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(34, 211, 238, .18);
  border: 1px solid rgba(34, 211, 238, .45);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
}

.inventory-pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.inventory-page-input {
  width: 56px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, .35);
  background-color: rgba(29, 23, 45, .95);
  color: #e2e8f0;
  font-size: 13px;
  text-align: center;
}

.inventory-page-input:focus {
  outline: none;
  border-color: rgba(34, 211, 238, .55);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, .12);
}

.inventory-pagination-meta {
  color: #94a3b8;
  font-size: 12px;
  white-space: nowrap;
}

.inventory-pagination button.secondary {
  min-width: auto;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.inventory-pagination button.inventory-page-edge {
  min-width: 34px;
  padding: 0 8px;
}

.inventory-pagination button.inventory-page-num {
  min-width: 34px;
  padding: 0 8px;
}

.inventory-pagination button.inventory-page-go {
  min-width: 44px;
  padding: 0 10px;
}

.inventory-pagination button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.inventory-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #101522;
  color: #d7fbff;
  border-bottom: 1px solid rgba(34, 211, 238, .35);
  text-shadow: 0 0 10px rgba(34, 211, 238, .45);
}

.inventory-table td {
  background: #111827;
  color: #f8fafc;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
  vertical-align: middle;
  transition: background var(--motion-base) ease, box-shadow var(--motion-base) ease;
}

.managed-row {
  position: relative;
}

.managed-row.is-detail-open td {
  background: #172033;
  box-shadow: inset 3px 0 0 var(--brand);
}

.inventory-table .muted {
  display: block;
  color: #9ca3af;
  font-size: 12px;
  margin-top: 4px;
}

.copyable-value {
  cursor: copy;
  border-radius: 6px;
  transition: background var(--motion-fast) ease, box-shadow var(--motion-fast) ease, color var(--motion-fast) ease;
}

.copyable-value:not(.is-empty):hover,
.copyable-value:not(.is-empty):focus-visible {
  background: rgba(34, 211, 238, .12);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .28);
  outline: none;
}

.copyable-value.is-copied {
  background: rgba(22, 163, 74, .18);
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, .35);
  color: #bbf7d0;
}

.copyable-value.is-empty {
  cursor: default;
}

.copyable-link {
  word-break: break-all;
}

.account-password-copy {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.02em;
}

.detail-item .copyable-value,
.important-account-grid .copyable-value {
  display: inline-block;
  max-width: 100%;
}

.managed-row.has-error td {
  background: #23131a;
}

.managed-row.is-inactive td {
  opacity: .72;
}

.note-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.note-chip-wrap {
  position: relative;
  display: inline-flex;
  z-index: 1;
}

.note-chip-wrap:hover,
.note-chip-wrap:focus-within {
  z-index: 30;
}

.note-chip {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(217, 119, 6, .2);
  color: #fcd34d;
  font-size: 11px;
  font-weight: 800;
  cursor: help;
  transition: transform var(--motion-fast) ease, filter var(--motion-fast) ease;
}

.note-chip-error {
  background: rgba(239, 68, 68, .22);
  color: #fca5a5;
}

.note-chip-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 2px);
  z-index: 40;
  min-width: 240px;
  max-width: min(340px, 72vw);
  max-height: min(280px, 50vh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 12px;
  border-radius: 14px;
  background: #0f172a;
  border: 1px solid rgba(251, 191, 36, .35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity var(--motion-base) ease, transform var(--motion-base) var(--motion-ease), visibility var(--motion-base) ease;
}

.note-chip-popover-error {
  border-color: rgba(248, 113, 113, .42);
  box-shadow: 0 16px 40px rgba(127, 29, 29, .28);
}

.note-chip-popover::before {
  content: '';
  position: absolute;
  left: -10px;
  right: -10px;
  top: 100%;
  height: 14px;
}

.note-chip-popover::after {
  content: '';
  position: absolute;
  left: 18px;
  top: 100%;
  border: 7px solid transparent;
  border-top-color: rgba(251, 191, 36, .35);
  pointer-events: none;
}

.note-chip-popover-error::after {
  border-top-color: rgba(248, 113, 113, .42);
}

.note-chip-wrap.is-open .note-chip-popover.is-floating,
.note-chip-popover.is-floating:hover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.note-chip-item + .note-chip-item {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, .14);
}

.note-chip-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #fcd34d;
}

.note-chip-item-error strong {
  color: #fca5a5;
}

.note-chip-meta {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  color: var(--subtle);
}

.note-chip-item p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

.managed-row:has(.note-chip-wrap.is-open),
.managed-row:has(.note-chip-wrap:hover),
.managed-row:has(.note-chip-wrap:focus-within),
.managed-row:has(.note-chip-popover:hover),
.managed-row:has(.profile-slot-panel.is-open),
.managed-row:has(.profile-slot-panel:focus-within),
.managed-row:has(.profile-slot-popover:hover) {
  z-index: 8;
}

.note-chip-popover.is-floating,
.profile-slot-popover.is-floating {
  position: fixed;
  left: auto;
  right: auto;
  bottom: auto;
  top: auto;
  z-index: 1300;
  transform: none;
}

.note-chip-popover.is-floating::before,
.note-chip-popover.is-floating::after,
.profile-slot-popover.is-floating::before,
.profile-slot-popover.is-floating::after {
  display: none;
}

.inventory-table-wrap .note-chip-popover {
  top: calc(100% + 6px);
  bottom: auto;
  transform: translateY(-6px);
}

.inventory-table-wrap .note-chip-wrap:hover .note-chip-popover,
.inventory-table-wrap .note-chip-wrap:focus-within .note-chip-popover,
.inventory-table-wrap .note-chip-wrap.is-open .note-chip-popover,
.inventory-table-wrap .note-chip-popover:hover {
  transform: translateY(0);
}

.inventory-table-wrap .note-chip-popover::before {
  top: auto;
  bottom: 100%;
  height: 14px;
}

.inventory-table-wrap .note-chip-popover::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: rgba(251, 191, 36, .35);
}

.inventory-table-wrap .note-chip-popover-error::after {
  border-bottom-color: rgba(248, 113, 113, .42);
}

body.detail-modal-open {
  overflow: hidden;
}

.account-edit-modal,
.account-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: safe center;
  justify-content: center;
  padding: clamp(12px, 2vh, 24px);
  overflow: auto;
  overscroll-behavior: contain;
}

.account-edit-modal[hidden],
.account-detail-modal[hidden] {
  display: none;
}

.account-detail-modal {
  z-index: 1200;
}

body.edit-modal-open,
body.upload-modal-open,
body.bulk-create-modal-open,
body.rest-bulk-create-modal-open,
body.rest-bulk-text-create-modal-open,
body.bulk-upload-modal-open,
body.important-rules-modal-open,
body.template-manager-modal-open,
body.account-create-modal-open,
body.rest-create-modal-open {
  overflow: hidden;
}

.account-upload-modal {
  z-index: 1350;
}

.account-bulk-create-modal,
.account-bulk-upload-modal {
  z-index: 1340;
}

.account-bulk-upload-modal {
  z-index: 1345;
}

.account-bulk-upload-modal .account-edit-dialog {
  --modal-width: 920px;
  --modal-max-height: min(94vh, 1080px);
}

.account-bulk-upload-modal .account-edit-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 16px;
}

.bulk-upload-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 12px;
}

.bulk-upload-config {
  flex: 0 0 auto;
  display: grid;
  gap: 14px;
  max-height: min(38vh, 360px);
  overflow: auto;
  padding-right: 2px;
}

.bulk-upload-actions-bar {
  flex: 0 0 auto;
  display: grid;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 12px 0 10px;
  border-top: 1px solid rgba(148, 163, 184, .14);
  border-bottom: 1px solid rgba(148, 163, 184, .14);
  background: linear-gradient(180deg, #151020 0%, #120e1d 100%);
}

.bulk-upload-actions-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
}

.bulk-upload-preview-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.bulk-upload-scope-options {
  display: grid;
  gap: 10px;
}

.bulk-upload-scope-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 14px;
  background: rgba(15, 23, 42, .35);
  cursor: pointer;
}

.bulk-upload-scope-option.is-selected {
  border-color: rgba(56, 189, 248, .45);
  background: rgba(14, 116, 144, .16);
}

.bulk-upload-scope-option input {
  margin-top: 3px;
}

.bulk-upload-summary-box {
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, .28);
}

.bulk-upload-preview-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.bulk-upload-preview-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, .45);
  font-size: 12px;
}

.bulk-upload-summary-box.is-stale {
  border-color: rgba(251, 191, 36, .35);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .08);
}

.bulk-upload-preview-card {
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 12px;
  background: rgba(15, 23, 42, .42);
  padding: 10px 12px;
}

.bulk-upload-preview-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.bulk-upload-preview-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bulk-upload-preview-destination {
  font-size: 12px;
}

.bulk-upload-preview-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 10px;
}

.bulk-upload-preview-meta div {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(17, 24, 39, .72);
}

.bulk-upload-preview-meta dt {
  margin: 0 0 3px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--subtle);
}

.bulk-upload-preview-meta dd {
  margin: 0;
  font-size: 12px;
  word-break: break-word;
}

.bulk-upload-preview-format-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--subtle);
}

.bulk-upload-preview-format-body {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(2, 6, 23, .72);
  border: 1px solid rgba(148, 163, 184, .1);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.bulk-upload-preview-format-body p {
  margin: 0;
}

.bulk-upload-preview-truncated {
  padding: 8px 2px 2px;
  font-size: 12px;
}

.bulk-upload-preview-hint {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.bulk-upload-preview-hint.warn {
  color: #fde68a;
  background: rgba(120, 53, 15, .28);
  border: 1px solid rgba(251, 191, 36, .24);
}

.bulk-upload-footer #bulkUploadSubmitButton.needs-preview {
  opacity: .82;
}

.account-bulk-upload-modal .bulk-controls select:not(.custom-select-native) {
  width: 100%;
  min-height: 42px;
}

.account-bulk-upload-modal .bulk-controls label {
  display: grid;
  gap: 6px;
}

.bulk-upload-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.account-bulk-create-modal .account-edit-dialog {
  --modal-width: 920px;
}

.account-upload-modal .account-edit-dialog {
  --modal-width: 820px;
}

.bulk-create-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bulk-batches-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: min(50vh, 520px);
  overflow: auto;
  padding-right: 4px;
}

.modal-size-lg .bulk-batches-list,
.modal-size-xl .bulk-batches-list,
.modal-size-full .bulk-batches-list {
  max-height: none;
  overflow: visible;
}

.bulk-batch {
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 18px;
  padding: 14px;
  background: rgba(15, 23, 42, .35);
}

.bulk-batch-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.bulk-batch-head strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.bulk-email-count {
  font-size: 12px;
}

.bulk-create-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 2px;
}

.bulk-batch-remove {
  flex-shrink: 0;
  padding: 6px 10px;
  font-size: 12px;
}

.bulk-batch-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bulk-batch-section {
  border-top: 1px solid rgba(148, 163, 184, .1);
  padding-top: 14px;
}

.bulk-batch-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.bulk-batch-section h4 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #d7fbff;
}

.bulk-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bulk-controls-stack {
  grid-template-columns: 1fr;
}

.bulk-controls label {
  display: grid;
  gap: 6px;
  align-content: start;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}

.bulk-emails-input {
  min-height: 108px;
  resize: vertical;
}

.bulk-controls textarea:not(.bulk-emails-input) {
  min-height: 72px;
  resize: vertical;
}

.bulk-controls input:not([type="color"]),
.bulk-controls select,
.bulk-controls textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background-color: #1d172d;
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  outline: none;
  font: inherit;
  line-height: 1.35;
}

.bulk-controls input:not([type="color"]):not([type="date"]),
.bulk-controls select {
  min-height: 42px;
  height: 42px;
}

.bulk-controls input[type="date"] {
  min-height: 42px;
}

.bulk-controls .color-picker-control {
  width: 100%;
}

.bulk-controls select {
  min-height: 42px;
  height: 42px;
}

.bulk-batch-section .bulk-controls + .bulk-controls {
  margin-top: 10px;
}

.bulk-controls textarea {
  height: auto;
}

.bulk-batch-form [data-family-field]:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.bulk-batch-remove {
  font-size: 13px;
}

.bulk-create-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.bulk-create-summary {
  width: min(820px, 100%);
  max-height: min(92vh, 940px);
}

.rest-bulk-desc-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.rest-bulk-desc-table-wrap {
  overflow: auto;
  max-height: min(42vh, 360px);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.rest-bulk-create-modal .rest-bulk-desc-table-wrap {
  max-height: min(50vh, 460px);
  overflow-x: hidden;
  overflow-y: auto;
}

.rest-bulk-accounts-table {
  width: 100%;
  table-layout: fixed;
}

.rest-bulk-desc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.rest-bulk-desc-table th,
.rest-bulk-desc-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  vertical-align: top;
}

.rest-bulk-desc-table th {
  position: sticky;
  top: 0;
  background: var(--surface-2, #111827);
  text-align: left;
  z-index: 1;
}

.rest-bulk-desc-table td:first-child {
  width: 28%;
  word-break: break-all;
}

.rest-bulk-accounts-table th:nth-child(1),
.rest-bulk-accounts-table td:nth-child(1) {
  width: 26%;
  min-width: 0;
  word-break: normal;
  white-space: nowrap;
}

.rest-bulk-accounts-table th:nth-child(2),
.rest-bulk-accounts-table td:nth-child(2) {
  width: 20%;
  min-width: 0;
}

.rest-bulk-accounts-table th:nth-child(3),
.rest-bulk-accounts-table td:nth-child(3) {
  width: 54%;
  min-width: 0;
}

.rest-bulk-accounts-table th,
.rest-bulk-accounts-table td {
  vertical-align: middle;
}

.rest-bulk-accounts-table .password-field {
  min-width: 0;
}

.rest-bulk-accounts-table .password-field input {
  width: 100%;
  min-height: 38px;
  padding: 8px 36px 8px 10px;
  font-size: 0.84rem;
  border: 1px solid var(--border);
  background-color: #1d172d;
  color: var(--text);
  border-radius: 12px;
  outline: none;
  font: inherit;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.rest-bulk-accounts-table .password-field input::placeholder {
  color: rgba(148, 163, 184, .72);
}

.rest-bulk-accounts-table .password-field input:-webkit-autofill,
.rest-bulk-accounts-table .password-field input:-webkit-autofill:hover,
.rest-bulk-accounts-table .password-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px #1d172d inset;
  transition: background-color 99999s ease-out 0s;
}

.rest-bulk-password-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rest-bulk-quick-copy-cell {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 4px;
  vertical-align: middle;
}

.rest-bulk-quick-copy-cell .copyable-value,
.rest-bulk-account-email {
  flex: 0 1 auto;
  max-width: calc(100% - 34px);
  min-width: 0;
  word-break: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.84rem;
  display: block;
}

.rest-bulk-password-cell .password-field {
  flex: 1 1 auto;
  min-width: 0;
}

.rest-bulk-quick-copy {
  flex: 0 0 auto;
  min-width: 34px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.rest-bulk-quick-copy.is-copied {
  border-color: rgba(74, 222, 128, .45);
  color: #bbf7d0;
  background: rgba(22, 163, 74, .16);
}

.rest-bulk-desc-table textarea {
  width: 100%;
  min-height: 52px;
  resize: none;
  overflow: hidden;
  border: 1px solid var(--border);
  background-color: #1d172d;
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  outline: none;
  font: inherit;
  line-height: 1.35;
}

.rest-bulk-desc-table textarea::placeholder {
  color: rgba(148, 163, 184, .72);
}

.inventory-bulk-meta-table input[type="text"] {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background-color: #1d172d;
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  outline: none;
  font: inherit;
  line-height: 1.35;
  min-height: 42px;
}

.inventory-bulk-meta-table input[type="text"]::placeholder {
  color: rgba(148, 163, 184, .72);
}

.bulk-controls .password-field input {
  border: 1px solid var(--border);
  background-color: #1d172d;
  color: var(--text);
  border-radius: 14px;
  padding: 10px 44px 10px 12px;
  outline: none;
  font: inherit;
  line-height: 1.35;
  min-height: 42px;
}

.bulk-controls .password-field input::placeholder {
  color: rgba(148, 163, 184, .72);
}

.bulk-controls .password-field input:-webkit-autofill,
.bulk-controls .password-field input:-webkit-autofill:hover,
.bulk-controls .password-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 1000px #1d172d inset;
  transition: background-color 99999s ease-out 0s;
}

.rest-bulk-format-hint {
  margin: 0 0 8px;
  font-size: 0.86rem;
}

.rest-bulk-format-hint code {
  font-size: 0.84rem;
}

.upload-detail {
  gap: 14px;
}

.upload-summary-grid {
  margin-top: -2px;
}

.upload-destination-controls {
  margin-top: -2px;
}

.upload-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 8px;
}

.upload-section-head h4 {
  margin: 0;
}

.upload-section-help {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
}

.upload-toggle-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--subtle);
  cursor: pointer;
  user-select: none;
}

.upload-toggle-option input {
  margin: 0;
}

.upload-profile-slots {
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 16px;
  background: rgba(15, 23, 42, .45);
  min-height: 72px;
}

.upload-profile-slot {
  min-width: 72px;
  padding: 8px 10px 10px;
  border-radius: 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.upload-profile-slot:hover {
  background: rgba(15, 23, 42, .72);
  border-color: rgba(148, 163, 184, .16);
}

.upload-profile-slot.is-upload-selected {
  background: rgba(34, 211, 238, .08);
  border-color: rgba(34, 211, 238, .35);
}

.upload-profile-slot.is-upload-disabled {
  opacity: .52;
  cursor: not-allowed;
}

.upload-profile-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.upload-profile-icon {
  position: relative;
  overflow: hidden;
  width: 42px;
  min-height: 42px;
  padding: 5px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #1b1529;
  color: var(--text);
  transition: transform var(--motion-fast) var(--motion-ease), box-shadow var(--motion-base) ease, border-color var(--motion-base) ease, background var(--motion-base) ease;
}

.upload-profile-slot.free .upload-profile-icon {
  border-color: rgba(22, 163, 74, .35);
  color: #86efac;
}

.upload-profile-slot.taken .upload-profile-icon {
  border-color: rgba(220, 38, 38, .55);
  color: #fecaca;
  background: rgba(127, 29, 29, .92);
}

.upload-profile-slot.error .upload-profile-icon {
  border-color: rgba(220, 38, 38, .45);
  color: #fca5a5;
}

.upload-profile-slot.is-upload-selected .upload-profile-icon {
  box-shadow: 0 0 0 2px rgba(34, 211, 238, .28);
}

.upload-profile-slot .upload-profile-status {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
}

.upload-profile-slot .platform-slot-badge {
  transform: scale(.92);
}

.upload-pin-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.upload-pin-field {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .14);
  background: #111827;
  font-size: 12px;
  transition: opacity .18s ease, border-color .18s ease;
}

.upload-pin-field.is-disabled {
  opacity: .45;
}

.upload-pin-field-label {
  font-weight: 800;
  font-size: 12px;
  color: #d7fbff;
}

.upload-pin-field input {
  width: 100%;
}

.upload-preview-section {
  padding-bottom: 4px;
}

.upload-preview-box {
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 16px;
  padding: 14px 16px;
  background: #111827;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
  min-height: 96px;
}

.upload-preview-box p {
  margin: 0;
}

.upload-modal-actions {
  border-top: 1px solid rgba(148, 163, 184, .12);
  padding-top: 14px;
  margin-top: 2px;
}

.upload-modal-actions .muted {
  flex: 1 1 100%;
  font-size: 12px;
}

.upload-button {
  background: linear-gradient(135deg, rgba(34, 211, 238, .22), rgba(56, 189, 248, .12));
  border: 1px solid rgba(34, 211, 238, .35);
  color: #a5f3fc;
}

.upload-button:hover {
  filter: brightness(1.08);
}

.account-edit-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(4px);
}

.account-edit-dialog,
.account-detail-dialog {
  --modal-width: 760px;
  --modal-max-height: min(96vh, 1200px);
  position: relative;
  z-index: 1;
  width: min(var(--modal-width), calc(100vw - 32px));
  max-height: var(--modal-max-height);
  display: flex;
  flex-direction: column;
  background: #0b101b;
  border: 1px solid rgba(34, 211, 238, .28);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
  overflow: hidden;
}

.account-edit-dialog.modal-size-lg,
.account-detail-dialog.modal-size-lg {
  --modal-width: 960px;
}

.account-edit-dialog.modal-size-xl,
.account-detail-dialog.modal-size-xl {
  --modal-width: min(1140px, calc(100vw - 28px));
  --modal-max-height: min(96vh, 1320px);
}

.account-edit-dialog.modal-size-full,
.account-detail-dialog.modal-size-full {
  --modal-width: min(1280px, calc(100vw - 24px));
  --modal-max-height: 96vh;
}

.rest-bulk-create-modal .account-edit-dialog,
.rest-bulk-create-modal .account-edit-dialog.modal-size-lg,
.rest-bulk-create-modal .account-edit-dialog.modal-size-xl,
.rest-bulk-create-modal .account-edit-dialog.modal-size-full {
  --modal-width: min(1280px, calc(100vw - 24px));
  --modal-max-height: min(96vh, 980px);
  width: min(1280px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
}

.rest-bulk-create-modal .account-edit-content,
.rest-bulk-create-modal .bulk-create-body,
.rest-bulk-create-modal .bulk-batch,
.rest-bulk-create-modal .rest-bulk-desc-editor {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.rest-bulk-create-modal .account-edit-content {
  padding: 14px 16px 16px;
}

.rest-bulk-create-modal .bulk-create-summary {
  width: 100%;
}

.rest-bulk-create-modal .rest-bulk-accounts-row {
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.rest-bulk-create-modal .rest-bulk-shared-password-field {
  align-content: start;
}

.rest-bulk-create-modal .bulk-emails-input {
  min-height: 96px;
}

.rest-bulk-create-modal .rest-bulk-platform-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.35fr) minmax(88px, 0.42fr);
  grid-template-areas:
    "platform plan days"
    "provider provider provider";
  gap: 10px 10px;
  align-items: end;
  width: 100%;
}

.rest-bulk-create-modal .rest-bulk-platform-field {
  grid-area: platform;
}

.rest-bulk-create-modal .rest-bulk-plan-field {
  grid-area: plan;
}

.rest-bulk-create-modal .rest-bulk-days-field {
  grid-area: days;
}

.rest-bulk-create-modal .rest-bulk-platform-field,
.rest-bulk-create-modal .rest-bulk-plan-field,
.rest-bulk-create-modal .rest-bulk-days-field {
  display: grid;
  gap: 6px;
  align-content: start;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
  min-width: 0;
}

.rest-bulk-create-modal .rest-bulk-provider-block {
  grid-area: provider;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 2px;
  width: 100%;
  min-width: 0;
}

.rest-bulk-create-modal .provider-recent-host {
  width: 100%;
}

.rest-bulk-create-modal .rest-bulk-provider-field {
  width: 100%;
  max-width: none;
  margin: 0;
}

.rest-bulk-create-modal .provider-recent-chips {
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  margin: 0;
  gap: 8px;
}

.rest-bulk-create-modal .provider-recent-label {
  flex: 0 0 auto;
}

.rest-bulk-create-modal .rest-bulk-accounts-table th,
.rest-bulk-create-modal .rest-bulk-accounts-table td {
  padding: 6px 8px;
}

.rest-bulk-create-modal .rest-bulk-quick-copy {
  min-width: 30px;
  padding: 5px 7px;
}

.rest-bulk-create-modal .bulk-batch-section .bulk-controls:not(.rest-bulk-accounts-row):not(.rest-bulk-platform-layout) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rest-bulk-text-create-modal .rest-bulk-text-create-form {
  display: grid;
  gap: 14px;
}

.rest-bulk-text-create-modal .rest-bulk-text-field {
  display: grid;
  gap: 8px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}

.rest-bulk-text-create-modal .rest-bulk-text-input {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.rest-bulk-text-create-modal .rest-bulk-text-meta {
  margin-top: 4px;
}

.rest-bulk-text-create-modal .rest-bulk-text-preview {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 88%, var(--bg) 12%);
}

.rest-bulk-text-create-modal .rest-bulk-text-preview-table-wrap {
  overflow-x: auto;
}

.rest-bulk-text-create-modal .rest-bulk-text-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.rest-bulk-text-create-modal .rest-bulk-text-preview-table th,
.rest-bulk-text-create-modal .rest-bulk-text-preview-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.rest-bulk-text-create-modal .rest-bulk-text-preview-table th {
  color: var(--subtle);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rest-bulk-text-create-modal .rest-bulk-text-preview-more {
  margin-top: 8px;
  font-size: 12px;
}

.account-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
}

.account-edit-header h3 {
  margin: 6px 0 0;
  font-size: 18px;
  word-break: break-word;
}

.account-edit-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px 20px 20px;
}

.account-detail-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px 20px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.account-edit-header,
.account-detail-header {
  flex: 0 0 auto;
}

.edit-account-meta,
.edit-account-credentials {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.edit-account-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
}

.edit-account-credentials label,
.edit-account-dates label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.edit-account-credentials input,
.edit-account-dates input {
  width: 100%;
  min-width: 0;
}

.edit-account-primary {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
}

.edit-section-title {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #67e8f9;
}

.edit-account-dates {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-edit-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid rgba(148, 163, 184, .14);
  background: #0f172a;
}

.account-edit-footer .primary {
  min-width: 148px;
}

.edit-account-secondary-actions {
  justify-content: space-between;
  flex-wrap: wrap;
}

.managed-row.is-edit-open {
  outline: 1px solid rgba(34, 211, 238, .35);
  outline-offset: -1px;
}

.account-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(4px);
}

.account-detail-dialog {
  --modal-width: 720px;
}

.account-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, .14);
}

.account-detail-label {
  display: block;
  color: var(--subtle);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.account-detail-header h3 {
  margin: 6px 0 0;
  font-size: 18px;
  word-break: break-word;
}

.account-detail-close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(148, 163, 184, .12);
  color: #e2e8f0;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  transition: transform var(--motion-fast) var(--motion-ease), background var(--motion-base) ease, color var(--motion-base) ease;
}

.account-detail-close::after {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  background:
    linear-gradient(45deg, transparent 46%, currentColor 46%, currentColor 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, currentColor 46%, currentColor 54%, transparent 54%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
}

.account-detail-close:hover {
  transform: scale(1.08);
  background: rgba(148, 163, 184, .22);
  color: #fff;
}

.account-detail-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid rgba(148, 163, 184, .14);
  background: #0f172a;
}

.account-detail-footer-spacer {
  flex: 1;
}

.profile-slot.platform-blocked {
  box-shadow: 0 0 0 1px rgba(220, 38, 38, .45);
}

.profile-slot.platform-active {
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .45);
}

.profile-slot.platform-expired {
  box-shadow: 0 0 0 1px rgba(248, 113, 113, .45);
}

.profile-slot.platform-uploaded,
.profile-slot.platform-linked {
  box-shadow: 0 0 0 1px rgba(56, 189, 248, .35);
}

.platform-sync-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid rgba(148, 163, 184, .18);
}

.platform-sync-badge.ok {
  color: #86efac;
  border-color: rgba(34, 197, 94, .35);
  background: rgba(34, 197, 94, .08);
}

.platform-account-chip {
  display: inline-flex;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: #7dd3fc;
  background: rgba(56, 189, 248, .1);
  border: 1px solid rgba(56, 189, 248, .25);
}

.full-account-panel {
  position: relative;
  display: inline-flex;
  max-width: 100%;
}

.full-account-triggers {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.full-account-trigger {
  cursor: help;
}

.full-account-triggers .platform-account-chip {
  margin-top: 0;
}

.full-account-panel .profile-slot-popover {
  min-width: 280px;
}

.table-slots .full-account-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.platform-slot-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
}

.platform-slot-badge.none {
  color: var(--subtle);
  background: rgba(148, 163, 184, .08);
}

.platform-slot-badge.uploaded,
.platform-slot-badge.sold {
  color: #7dd3fc;
  background: rgba(56, 189, 248, .12);
}

.platform-slot-badge.active,
.platform-slot-badge.taken-active,
.platform-slot-badge.taken-shop {
  color: #fecaca;
  background: rgba(127, 29, 29, .75);
  border: 1px solid rgba(220, 38, 38, .45);
}

.platform-slot-badge.taken-shop {
  color: #fca5a5;
}

.platform-slot-badge.expired {
  color: #fca5a5;
  background: rgba(248, 113, 113, .12);
}

.platform-days-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
}

.platform-days-chip.ok {
  color: #86efac;
  background: rgba(34, 197, 94, .14);
}

.platform-days-chip.warn {
  color: #fde68a;
  background: rgba(245, 158, 11, .16);
}

.platform-days-chip.danger {
  color: #fecaca;
  background: rgba(248, 113, 113, .16);
}

.platform-due-inline {
  display: block;
  font-size: 11px;
  margin-top: 2px;
}

.platform-buyer {
  display: block;
  font-size: 10px;
  color: #86efac;
}

.platform-slot-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.platform-sync-detail-summary {
  margin-bottom: 10px;
}

.platform-sync-detail-blocks {
  display: grid;
  gap: 10px;
}

.platform-sync-detail-block {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, .82);
  border: 1px solid rgba(148, 163, 184, .16);
}

.platform-sync-detail-block.is-empty {
  border-style: dashed;
}

.platform-sync-detail-block strong {
  display: block;
  font-size: 13px;
  color: #e2e8f0;
}

.platform-sync-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-detail-content .platform-sync-detail-block .profile-slot-popover-meta {
  margin: 0;
}

.account-detail-content .platform-sync-detail-block .profile-slot-popover-warn {
  margin: 0;
}

.platform-slot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, .75);
  border: 1px solid rgba(148, 163, 184, .12);
}

.danger-button {
  background: var(--red);
  color: #fff;
  box-shadow: none;
}

.danger-button:hover {
  filter: brightness(1.08);
}

.delete-hint {
  margin: -4px 0 0;
  font-size: 12px;
}

.managed-actions .danger-button {
  margin-left: auto;
}

.detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-item {
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 14px;
  padding: 10px 12px;
  background: #111827;
}

.detail-item span {
  display: block;
  color: var(--subtle);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.detail-item strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  word-break: break-word;
}

.detail-section {
  border-top: 1px solid rgba(148, 163, 184, .12);
  padding-top: 12px;
}

.detail-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #d7fbff;
}

.detail-section p {
  margin: 0;
  color: #d6d3e1;
  white-space: pre-wrap;
  font-size: 13px;
}

.detail-section.is-error h4 {
  color: #fca5a5;
}

.detail-comment {
  border: 1px solid rgba(148, 163, 184, .12);
  border-radius: 14px;
  padding: 10px 12px;
  background: #111827;
}

.detail-comment + .detail-comment {
  margin-top: 8px;
}

.detail-comment strong,
.detail-comment small {
  display: block;
}

.detail-comment small {
  color: var(--subtle);
  margin-top: 2px;
}

.detail-comment p {
  margin-top: 6px;
}

.ghost-button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

.ghost-button:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--brand) 20%, var(--border));
}

.primary-button {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  border: 0;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(99, 102, 241, .28);
}

.primary-button:hover {
  filter: brightness(1.05);
}

.managed-detail-row td {
  background: #0f172a;
  color: var(--text);
  border-bottom: 1px solid rgba(34, 211, 238, .25);
}

.managed-detail {
  display: grid;
  gap: 12px;
}

.managed-head,
.managed-actions,
.comment-box {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.managed-head h3 {
  margin: 4px 0 6px;
  font-size: 18px;
  letter-spacing: -.02em;
  word-break: break-word;
}

.managed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--subtle);
  font-size: 12px;
}

.managed-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.managed-controls label {
  display: grid;
  gap: 6px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}

.family-fields,
.managed-notes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.managed-notes textarea {
  min-height: 86px;
  resize: vertical;
}

.profile-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.profile-slot {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  color: var(--subtle);
  font-size: 11px;
}

.profile-slot-panel {
  z-index: 1;
}

.profile-slot-panel.is-open,
.profile-slot-panel:hover,
.profile-slot-panel:focus-within {
  z-index: 35;
}

.profile-slot-main,
.profile-slot > button:first-child {
  position: relative;
  overflow: hidden;
  width: 38px;
  min-height: 38px;
  padding: 5px;
  display: grid;
  place-items: center;
  gap: 2px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #1b1529;
  color: var(--text);
  box-shadow: none;
  transition: transform var(--motion-fast) var(--motion-ease), box-shadow var(--motion-base) ease, border-color var(--motion-base) ease, background var(--motion-base) ease;
}

.profile-slot-hover-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #f8fafc;
  opacity: 0;
  transform: translateY(3px) scale(0.92);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
  z-index: 2;
  text-shadow: 0 1px 10px rgba(15, 23, 42, .75);
}

.profile-slot:hover .profile-slot-hover-label,
.profile-slot:focus-within .profile-slot-hover-label,
.upload-profile-slot:hover .profile-slot-hover-label,
.upload-profile-slot:focus-within .profile-slot-hover-label {
  opacity: .82;
  transform: translateY(0) scale(1);
}

.profile-slot:hover .person-icon,
.profile-slot:focus-within .person-icon,
.upload-profile-slot:hover .person-icon,
.upload-profile-slot:focus-within .person-icon {
  opacity: .22;
}

.profile-slot > button:first-child .person-icon,
.upload-profile-slot .upload-profile-icon .person-icon {
  transition: opacity .18s ease;
}

.table-slots {
  flex-wrap: nowrap;
  align-items: center;
}

.table-slots .profile-slot-main,
.table-slots .profile-slot > button:first-child {
  width: 28px;
  min-height: 28px;
  border-radius: 9px;
}

.table-slots .profile-slot-hover-label {
  font-size: 10px;
}

.table-slots .profile-slot small,
.table-slots .profile-slot em {
  display: none;
}

.profile-slot.has-streamcodex-link .profile-slot-main {
  border-color: rgba(34, 211, 238, .35);
}

.profile-streamcodex-link {
  position: absolute;
  top: -5px;
  right: -6px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(34, 211, 238, .18);
  border: 1px solid rgba(34, 211, 238, .45);
  color: #a5f3fc;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .35);
}

.profile-streamcodex-link:hover {
  background: rgba(34, 211, 238, .28);
  color: #ecfeff;
}

.profile-slot-popover {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  z-index: 50;
  width: min(280px, 72vw);
  max-width: min(280px, 72vw);
  overflow: visible;
  padding: 10px 12px;
  border-radius: 14px;
  background: #0f172a;
  border: 1px solid rgba(34, 211, 238, .32);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px);
  transition: opacity var(--motion-base) ease, transform var(--motion-base) var(--motion-ease), visibility var(--motion-base) ease;
}

.profile-slot-popover-empty {
  border-color: rgba(148, 163, 184, .24);
}

.profile-slot-popover::before {
  content: '';
  position: absolute;
  left: -12px;
  right: -12px;
  top: 100%;
  height: 14px;
}

.profile-slot-popover::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: -7px;
  border: 7px solid transparent;
  border-top-color: rgba(34, 211, 238, .32);
  pointer-events: none;
}

.profile-slot-popover-empty::after {
  border-top-color: rgba(148, 163, 184, .24);
}

.profile-slot-panel.is-open .profile-slot-popover.is-floating,
.profile-slot-panel:focus-within .profile-slot-popover.is-floating,
.profile-slot-popover.is-floating:hover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.profile-slot-panel.is-open .profile-slot-popover:not(.is-floating),
.profile-slot-panel:focus-within .profile-slot-popover:not(.is-floating),
.profile-slot-popover:not(.is-floating):hover {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.profile-slot-popover strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #e2e8f0;
}

.profile-slot-popover-warn {
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(217, 119, 6, .14);
  color: #fcd34d;
  font-size: 11px;
  line-height: 1.4;
}

.profile-slot-popover-meta {
  margin: 0 0 10px;
  display: grid;
  gap: 6px;
}

.profile-slot-popover-meta div {
  display: grid;
  gap: 2px;
}

.profile-slot-popover-meta dt {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--subtle);
}

.profile-slot-popover-meta dd {
  margin: 0;
  font-size: 12px;
  color: #e2e8f0;
  word-break: break-word;
}

.profile-slot-popover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.profile-slot-popover-actions .profile-popover-action {
  font-size: 11px;
  padding: 6px 10px;
  max-width: 100%;
}

.inventory-table-wrap .profile-slot-popover {
  top: calc(100% + 8px);
  bottom: auto;
  transform: translateX(-50%) translateY(-8px);
}

.inventory-table-wrap .profile-slot-panel.is-open .profile-slot-popover:not(.is-floating),
.inventory-table-wrap .profile-slot-panel:focus-within .profile-slot-popover:not(.is-floating),
.inventory-table-wrap .profile-slot-popover:not(.is-floating):hover {
  transform: translateX(-50%) translateY(0);
}

.inventory-table-wrap .profile-slot-popover::before {
  top: auto;
  bottom: 100%;
  height: 14px;
}

.inventory-table-wrap .profile-slot-popover::after {
  top: auto;
  bottom: 100%;
  margin-left: -7px;
  border-top-color: transparent;
  border-bottom-color: rgba(34, 211, 238, .32);
}

.inventory-table-wrap .profile-slot-popover-empty::after {
  border-bottom-color: rgba(148, 163, 184, .24);
}

.profile-slot-popover-hint {
  margin: 8px 0 0;
  font-size: 10px;
  line-height: 1.35;
}

.slot-id-tag {
  display: block;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #94a3b8;
  font-weight: 700;
  user-select: none;
}

.table-slots .slot-id-tag {
  margin-top: 1px;
}

.profile-slot.free > .profile-slot-main,
.profile-slot.free > button:first-child {
  border-color: rgba(22, 163, 74, .35);
  color: #86efac;
}

.profile-slot.taken > .profile-slot-main,
.profile-slot.taken > button:first-child {
  border-color: rgba(220, 38, 38, .55);
  color: #fecaca;
  background: rgba(127, 29, 29, .92);
}

.profile-slot.error > .profile-slot-main,
.profile-slot.error > button:first-child {
  border-color: rgba(220, 38, 38, .45);
  color: #fca5a5;
}

.person-icon {
  width: 12px;
  height: 12px;
  display: block;
  border-radius: 50% 50% 45% 45%;
  background: currentColor;
  position: relative;
}

.person-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 14px;
  width: 20px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 999px 999px 8px 8px;
  background: currentColor;
}

.slot-error {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 999px;
  background: var(--red);
  box-shadow: none;
  font-size: 12px;
}

.table-slots .slot-error {
  display: none;
}

.profile-slot em {
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.full-account-note {
  width: 100%;
  border: 1px dashed var(--border);
  border-radius: 18px;
  padding: 14px;
  color: var(--subtle);
  background: rgba(139, 92, 246, .08);
}

.managed-actions button,
.comment-box button {
  box-shadow: none;
}

.inventory-table .managed-actions-cell {
  width: 1%;
  min-width: 470px;
  white-space: nowrap;
}

.row-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
}

.row-actions button {
  padding: 8px 10px;
  border-radius: 10px;
  box-shadow: none;
  font-size: 12px;
}

.row-actions [data-quick-error] {
  background: var(--red);
}

.comment-box {
  align-items: center;
}

.comment-box input {
  flex: 1;
}

.comment-list {
  display: grid;
  gap: 8px;
}

.comment-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  background: #1b1529;
}

.comment-item.error {
  border-color: rgba(220, 38, 38, .35);
}

.comment-item strong,
.comment-item span {
  display: block;
  font-size: 12px;
}

.comment-item span {
  color: var(--subtle);
  margin-top: 2px;
}

.comment-item p {
  margin: 7px 0 0;
  white-space: pre-wrap;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(190px, .7fr);
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: #120e1d;
}

.history-item.error {
  border-color: rgba(220, 38, 38, .36);
  background: #1f1119;
}

.history-item.profile_change {
  border-color: rgba(217, 119, 6, .32);
}

.history-item strong,
.history-item span,
.history-item small {
  display: block;
}

.history-item span,
.history-item small {
  color: var(--subtle);
  margin-top: 4px;
}

.history-item p {
  grid-column: 1 / -1;
  margin: 0;
  color: #d6d3e1;
  white-space: pre-wrap;
}

.admin-users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.admin-users-filters,
.admin-activity-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px);
  gap: 10px;
  margin-bottom: 0;
}

.admin-activity-filters {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 220px) minmax(160px, 200px) minmax(140px, 170px) minmax(140px, 170px) minmax(160px, 200px);
}

.admin-users-filters input,
.admin-users-filters select,
.admin-activity-filters input,
.admin-activity-filters select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background-color: #1d172d;
  color: var(--text);
  border-radius: 14px;
  padding: 11px 12px;
  outline: none;
}

.admin-activity-filters input[type="date"] {
  color-scheme: dark;
}

.admin-user-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  min-width: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, .14);
  background: rgba(15, 23, 42, .72);
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}

.admin-user-card:hover,
.admin-user-card.is-selected {
  border-color: rgba(139, 92, 246, .45);
  transform: translateY(-1px);
}

.admin-user-card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.admin-user-card-head > div:last-child {
  min-width: 0;
  flex: 1;
}

.admin-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #ede9fe;
  background: linear-gradient(135deg, rgba(139, 92, 246, .35), rgba(59, 130, 246, .25));
}

.admin-user-card-head strong {
  display: block;
  font-size: 15px;
}

.admin-user-card-head span {
  display: block;
  color: var(--subtle);
  font-size: 12px;
  word-break: break-word;
}

.admin-user-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.admin-user-stat {
  padding: 10px 12px;
  border-radius: 12px;
  min-width: 0;
  overflow: hidden;
  background: rgba(17, 24, 39, .85);
  border: 1px solid rgba(148, 163, 184, .1);
}

.admin-user-stat span {
  display: block;
  font-size: 11px;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.admin-user-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.admin-user-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  color: var(--subtle);
  font-size: 12px;
}

.admin-user-card-foot > span:last-child {
  min-width: 0;
  flex: 1 1 140px;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-align: right;
}

.online-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.online-badge.is-online {
  background: rgba(34, 197, 94, .16);
  color: #86efac;
}

.online-badge.is-offline {
  background: rgba(148, 163, 184, .12);
  color: #cbd5e1;
}

.online-badge.is-online::before,
.online-badge.is-offline::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.admin-user-detail-panel {
  margin-top: 16px;
}

.admin-user-detail-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.admin-user-detail-meta .detail-item strong {
  font-size: 14px;
}

.admin-activity-list {
  display: grid;
  gap: 10px;
}

.admin-activity-item {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, .12);
  background: rgba(15, 23, 42, .72);
}

.admin-activity-item-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: space-between;
}

.admin-activity-item p {
  margin: 0;
  color: #d6d3e1;
  white-space: pre-wrap;
}

.admin-activity-item small {
  color: var(--subtle);
}

.login-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background:
    radial-gradient(900px 520px at 12% 8%, rgba(109, 92, 232, .28), transparent 62%),
    radial-gradient(720px 480px at 92% 100%, rgba(229, 9, 20, .14), transparent 58%),
    #07070c;
}

.login-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: #07070c;
}

.login-photo {
  position: absolute;
  inset: -4%;
  background: url("../img/login-background.webp") center / cover no-repeat;
  filter: blur(3px) saturate(1.05);
  transform: scale(1.06);
  animation: loginPhotoDrift 32s ease-in-out infinite alternate;
}

.login-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, .42) 0%, rgba(0, 0, 0, .62) 58%, rgba(0, 0, 0, .82) 100%);
}

.login-particles span {
  position: absolute;
  left: var(--x);
  bottom: -16px;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: rgba(255, 255, 255, var(--o));
  box-shadow: 0 0 10px rgba(255, 255, 255, .45);
  animation: loginParticle var(--d) linear infinite;
  animation-delay: var(--delay);
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(940px, 100%);
  display: grid;
  grid-template-columns: .92fr 1.08fr;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  background: #101014;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .48);
}

.login-brand {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 36px;
  text-align: center;
  background:
    radial-gradient(420px 220px at 50% 18%, rgba(255, 255, 255, .2), transparent 70%),
    linear-gradient(165deg, #8b7cf8 0%, #6d5ce8 46%, #3a2d86 100%);
  color: #fff;
}

.login-logo {
  width: 240px;
  height: 240px;
  background: transparent;
  border-radius: 28px;
  position: relative;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  overflow: hidden;
}

.login-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><circle cx='20' cy='20' r='1' fill='white' opacity='0.35'/><circle cx='80' cy='40' r='1' fill='white' opacity='0.25'/><circle cx='40' cy='80' r='1' fill='white' opacity='0.4'/><circle cx='90' cy='90' r='1' fill='white' opacity='0.3'/><circle cx='10' cy='60' r='1' fill='white' opacity='0.22'/></svg>");
  animation: loginTwinkle 3s ease-in-out infinite alternate;
}

.login-logo img {
  width: 210px;
  height: 210px;
  margin: 0;
  object-fit: contain;
  object-position: center;
  animation: loginLogoGlow 3s ease-in-out infinite alternate;
}

.login-brand h1 {
  margin: 8px 0 0;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.04em;
}

.login-brand p {
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: 15px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.login-brand-rule {
  width: 42px;
  height: 3px;
  margin: 14px 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
}

.login-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 280px;
  margin-top: 8px;
}

.login-chips span {
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  transition: transform .3s ease, background .3s ease;
}

.login-chips span:hover {
  background: rgba(255, 255, 255, .2);
  transform: translateY(-2px);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 42px;
  background: linear-gradient(180deg, #16161b, #101014);
}

.login-panel h2 {
  margin: 0;
  text-align: center;
  font-size: 30px;
  letter-spacing: -.03em;
  transition: transform .3s ease, letter-spacing .3s ease;
}

.login-panel:hover h2 {
  transform: translateY(-2px);
  letter-spacing: -.02em;
}

.login-lead,
.login-note {
  margin: 8px 0 0;
  text-align: center;
  color: var(--subtle);
  font-size: 13px;
}

.login-panel .error {
  margin-top: 18px;
  margin-bottom: 0;
}

.login-panel label {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  color: #e4e4e7;
  font-size: 13px;
  font-weight: 650;
  transition: color .25s ease, transform .25s ease;
}

.login-panel label:hover {
  color: #fff;
  transform: translateY(-2px);
}

.login-panel input {
  width: 100%;
  border: 1px solid #2c2c33;
  background: #1b1b21;
  color: var(--text);
  border-radius: 12px;
  padding: 13px 14px;
  outline: none;
  color-scheme: dark;
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}

.login-panel label:hover input {
  border-color: rgba(139, 124, 248, .55);
  background: #22222b;
  box-shadow: 0 10px 22px rgba(0, 0, 0, .22);
}

.login-panel input::placeholder {
  color: #71717a;
}

.login-panel input:focus {
  border-color: rgba(139, 124, 248, .7);
  box-shadow: 0 0 0 3px rgba(139, 124, 248, .16);
}

.login-panel input:-webkit-autofill,
.login-panel input:-webkit-autofill:hover,
.login-panel input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px #1b1b21 inset;
  transition: background-color 9999s ease-out;
}

.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 22px;
  border: 0;
  border-radius: 14px;
  padding: 13px 16px;
  background: linear-gradient(90deg, #8b7cf8, #6d5ce8);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(109, 92, 232, .32);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}

.login-submit svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.login-submit:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(109, 92, 232, .4);
}

.login-note {
  position: relative;
  min-height: 1.5em;
  margin-top: 16px;
}

.login-note.is-typing::after {
  content: '|';
  margin-left: 2px;
  animation: loginCaretBlink 1s infinite;
}

@keyframes loginTwinkle {
  from { opacity: .3; }
  to { opacity: .8; }
}

@keyframes loginLogoGlow {
  from { opacity: .8; transform: scale(1); }
  to { opacity: 1; transform: scale(1.05); }
}

@keyframes loginCaretBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes loginPhotoDrift {
  from { transform: scale(1.06) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-1.5%, -1%, 0); }
}

@keyframes loginParticle {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: .65; }
  100% { transform: translateY(-108vh); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .login-brand::before,
  .login-logo img,
  .login-photo,
  .login-particles span,
  .login-note.is-typing::after,
  .login-shell {
    animation: none;
  }
}

@media (max-width: 820px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand,
  .login-panel {
    padding: 32px 22px;
  }

  .login-brand h1 {
    font-size: 28px;
  }

}

.password-field {
  position: relative;
  width: 100%;
  min-width: 0;
}

.password-field input {
  width: 100%;
  min-width: 0;
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--subtle);
  cursor: pointer;
  padding: 0;
  line-height: 0;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(148, 163, 184, .14);
  color: var(--text);
  outline: none;
}

.password-toggle-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.password-toggle-hide[hidden],
.password-toggle-show[hidden] {
  display: none !important;
}

.error {
  background: rgba(220, 38, 38, .16);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, .35);
  border-radius: 14px;
  padding: 11px;
  margin-bottom: 16px;
}

/* Subtle motion system */
@keyframes uiAppEnter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes uiModalBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes uiModalDialog {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes uiAlertEnter {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes uiPulseSoft {
  0%, 100% { opacity: 1; }
  50% { opacity: .72; }
}

.topbar {
  animation: uiFadeUp calc(var(--motion-slow) + .08s) var(--motion-ease) backwards;
}

.cards .card {
  animation: uiFadeUp var(--motion-slow) var(--motion-ease) backwards;
}

.cards .card:nth-child(1) { animation-delay: .04s; }
.cards .card:nth-child(2) { animation-delay: .08s; }
.cards .card:nth-child(3) { animation-delay: .12s; }
.cards .card:nth-child(4) { animation-delay: .16s; }
.cards .card:nth-child(5) { animation-delay: .2s; }

.login-shell {
  animation: uiModalDialog calc(var(--motion-slow) + .12s) var(--motion-ease);
}

.account-detail-modal:not([hidden]),
.account-edit-modal:not([hidden]) {
  animation: uiModalBackdrop var(--motion-base) ease;
}

.account-detail-modal:not([hidden]) .account-detail-dialog,
.account-edit-modal:not([hidden]) .account-edit-dialog {
  animation: uiModalDialog calc(var(--motion-base) + .06s) var(--motion-ease);
}

.account-detail-backdrop,
.account-edit-backdrop {
  animation: uiModalBackdrop var(--motion-base) ease;
}

.panel,
.platform-group,
.important-account,
.history-list .history-item {
  transition: transform var(--motion-base) var(--motion-ease), box-shadow var(--motion-base) ease, border-color var(--motion-base) ease;
}

.important-account:hover {
  transform: translateY(-1px);
}

.platform-header {
  transition: background var(--motion-base) ease, border-color var(--motion-base) ease;
}

.badge,
.platform-slot-badge,
.platform-sync-badge {
  transition: transform var(--motion-fast) ease, box-shadow var(--motion-fast) ease, background var(--motion-base) ease, border-color var(--motion-base) ease;
}

.inventory-pagination button,
.row-actions button,
.ghost-button,
.danger-button,
.upload-button {
  transition: transform var(--motion-fast) var(--motion-ease), box-shadow var(--motion-base) ease, filter var(--motion-fast) ease, background var(--motion-base) ease, opacity var(--motion-fast) ease, border-color var(--motion-base) ease;
}

.inventory-pagination button:not(:disabled):active,
.row-actions button:active {
  transform: translateY(1px) scale(.98);
}

.global-important-alert:not([hidden]) {
  animation: uiAlertEnter var(--motion-base) var(--motion-ease);
}

.setup-warning,
.item.ok,
.item.warn,
#inventoryManagementStatus .error,
#inventoryManagementStatus .setup-warning {
  animation: uiAlertEnter var(--motion-base) var(--motion-ease);
}

#inventoryManagementStatus:empty {
  animation: none;
}

/* Live inventory refresh: no entrance animations on polling updates */
.inventory-live,
#inventoryManagementBoard,
#inventoryManagementBoard *,
.inventory-pagination {
  animation: none !important;
}

.managed-row.is-detail-open,
.managed-row.is-edit-open {
  transition: outline-color var(--motion-base) ease, outline-offset var(--motion-base) ease;
}

.profile-slot > button:first-child,
.upload-profile-icon,
.upload-profile-slot,
.detail-item,
.comment-item,
.detail-comment {
  transition: transform var(--motion-fast) var(--motion-ease), box-shadow var(--motion-base) ease, border-color var(--motion-base) ease, background var(--motion-base) ease, opacity var(--motion-fast) ease;
}

.managed-detail,
.upload-detail {
  animation: uiFadeUp var(--motion-slow) var(--motion-ease);
}

.sidebar-toggle {
  transition: transform var(--motion-base) var(--motion-ease), background var(--motion-base) ease;
}

.sidebar-toggle:hover {
  transform: scale(1.04);
}

body.sidebar-collapsed .sidebar-toggle:hover {
  transform: translateX(-50%) rotate(180deg) scale(1.04);
}

input,
select,
textarea {
  transition: border-color var(--motion-base) ease, box-shadow var(--motion-base) ease, background var(--motion-base) ease, opacity var(--motion-fast) ease;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .12);
}

select:not([multiple]):not([size]):not(.custom-select-native):focus {
  background-image: var(--select-arrow-focus);
}

.custom-select-trigger:focus-visible {
  outline: none;
  border-color: rgba(139, 92, 246, .55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .12);
  background-image: var(--select-arrow-focus);
}

.is-loading-soft {
  animation: uiPulseSoft 1.2s ease-in-out infinite;
}

/* Hover interactions */
.managed-row:hover:not(.has-error):not(.is-inactive):not(.is-detail-open):not(.is-edit-open) td {
  background: #151d2e;
}

.managed-row.is-detail-open:hover td,
.managed-row.is-edit-open:hover td {
  filter: brightness(1.04);
}

.profile-slot > button:first-child:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .35);
}

.upload-profile-slot:not(.is-upload-disabled):hover .upload-profile-icon {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .35);
}

.upload-profile-slot.is-upload-selected:hover {
  border-color: rgba(34, 211, 238, .5);
}

.platform-header:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
}

.platform-header:hover::after {
  background: rgba(255,255,255,.08);
  border-color: rgba(139, 92, 246, .28);
}

.platform-summary span:hover {
  transform: translateY(-1px);
  border-color: rgba(139, 92, 246, .24);
  background: rgba(139, 92, 246, .08);
}

.detail-item:hover,
.comment-item:hover,
.detail-comment:hover,
.upload-pin-field:not(.is-disabled):hover {
  transform: translateY(-1px);
  border-color: rgba(139, 92, 246, .22);
  box-shadow: 0 8px 20px rgba(15, 10, 28, .18);
}

.history-list .history-item:hover {
  transform: translateX(4px);
  border-color: rgba(139, 92, 246, .22);
}

.badge:hover,
.platform-slot-badge:hover,
.platform-sync-badge:hover {
  transform: scale(1.04);
}

.userbox a {
  transition: transform var(--motion-fast) var(--motion-ease), filter var(--motion-fast) ease, box-shadow var(--motion-base) ease;
}

.userbox a:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.row-actions button:hover,
.upload-button:hover,
.danger-button:hover,
.inventory-pagination button:not(:disabled):hover,
.dashboard-shortcuts button:hover,
.plan-actions button:hover {
  transform: translateY(-2px);
}

.row-actions button:active,
.upload-button:active,
.danger-button:active {
  transform: translateY(0) scale(.98);
}

.upload-preview-box:hover {
  border-color: rgba(34, 211, 238, .22);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .08);
}

.inventory-create-box summary {
  transition: color var(--motion-base) ease, transform var(--motion-fast) var(--motion-ease);
}

.inventory-create-box summary:hover {
  color: #d7fbff;
  transform: translateX(2px);
}

.note-chip-wrap:hover .note-chip,
.note-chip-wrap:focus-within .note-chip,
.note-chip-wrap.is-open .note-chip {
  transform: scale(1.03);
  filter: brightness(1.08);
}

.note-chip-wrap.is-open,
.note-chip-wrap.is-open:hover {
  z-index: 30;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media(max-width: 1180px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-two { grid-template-columns: 1fr; }
  .filter-bar-toolbar-left {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-saved-field {
    max-width: none;
  }
  .filter-toolbar-buttons {
    justify-content: flex-start;
  }
  .inventory-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-create-form textarea { grid-column: 1 / -1; }
  .inventory-filters input { grid-column: 1 / -1; }
  .important-account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .important-filters { grid-template-columns: 1fr; }
  .admin-activity-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media(max-width: 960px) {
  body {
    overflow: auto;
  }

  body.sidebar-mobile-open {
    overflow: hidden;
  }

  .mobile-nav-toggle {
    display: grid;
  }

  .app-shell {
    display: block;
    width: 100%;
    height: auto;
    min-height: 100dvh;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    width: min(292px, 88vw);
    flex-basis: auto;
    height: 100dvh;
    transform: translateX(-105%);
    box-shadow: var(--shadow-md);
  }

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

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

  body.sidebar-collapsed .sidebar {
    width: min(292px, 88vw);
    flex-basis: auto;
  }

  body.sidebar-collapsed .brand-text,
  body.sidebar-collapsed .sidebar-user-meta,
  body.sidebar-collapsed .sidebar-user-logout,
  body.sidebar-collapsed .nav-label {
    display: block;
  }

  body.sidebar-collapsed .sidebar-toggle {
    position: static;
    transform: none;
  }

  .main {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    padding: 12px 14px 24px;
  }

  .topbar {
    flex-wrap: wrap;
    padding-top: 4px;
  }

  .userbox {
    width: 100%;
    justify-content: space-between;
  }

  .panel-title {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-actions {
    justify-content: flex-start;
  }

  .global-important-alert,
  .important-account-main {
    display: grid;
    justify-items: stretch;
  }

  .important-account-actions {
    justify-items: stretch;
  }

  .inventory-filters {
    grid-template-columns: 1fr;
  }

  .inventory-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .managed-actions-cell .row-actions {
    flex-wrap: wrap;
  }

  .calendar-toolbar,
  .calendar-toolbar-filters {
    flex-direction: column;
    align-items: stretch;
  }
}

@media(max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
  .filter-toolbar-buttons {
    width: 100%;
  }
  .filter-toolbar-buttons .ghost-button {
    flex: 1 1 auto;
    min-width: 0;
  }
  .plan-grid { grid-template-columns: 1fr; }
  .important-account-grid { grid-template-columns: 1fr; }
  .important-add-preview-list { grid-template-columns: 1fr; }
  .important-add-preview-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .important-add-preview-list { grid-template-columns: 1fr; }
  .important-add-preview-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .account-detail-modal,
  .account-edit-modal,
  .account-upload-modal,
  .account-bulk-create-modal,
  .account-bulk-upload-modal {
    padding: 0;
    align-items: end;
  }
  .account-detail-dialog,
  .account-edit-dialog {
    width: 100%;
    max-width: 100%;
    --modal-width: 100%;
    --modal-max-height: min(94vh, 100dvh);
    border-radius: 22px 22px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .bulk-upload-preview-meta {
    grid-template-columns: 1fr;
  }
  .upload-pin-fields,
  .upload-summary-grid,
  .managed-controls.upload-destination-controls {
    grid-template-columns: 1fr;
  }
  .upload-profile-slots {
    justify-content: center;
  }
  .detail-grid { grid-template-columns: 1fr; }
  .admin-user-detail-meta { grid-template-columns: 1fr; }
  .admin-users-grid { grid-template-columns: 1fr; }
  .edit-account-credentials,
  .edit-account-dates { grid-template-columns: 1fr; }
  .admin-users-filters,
  .admin-activity-filters { grid-template-columns: 1fr; }
  .inventory-filters,
  .inventory-create-form,
  .bulk-controls,
  .managed-controls,
  .family-fields,
  .managed-notes { grid-template-columns: 1fr; }
  .managed-head,
  .managed-actions,
  .comment-box { display: grid; }
  .platform-header { display: block; }
  .platform-header .badge { margin-top: 10px; }
  .searchbar { display: grid; }
}

.important-rules-teaser {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(56, 189, 248, .2);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(14, 116, 144, .1), rgba(18, 14, 29, .92));
}

.important-rules-teaser.is-highlight {
  animation: importantRulesHighlight 1.4s ease;
}

.important-rules-teaser-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.important-rules-teaser-copy p {
  margin: 0 0 6px;
  font-size: 13px;
}

.important-rules-teaser .important-rules-count {
  display: block;
  font-size: 12px;
}

.important-rules-teaser [data-open-important-rules-modal].is-active,
#importantRulesOpenButton.is-active {
  border-color: rgba(56, 189, 248, .45);
  color: #7dd3fc;
  background: rgba(14, 116, 144, .18);
}

@keyframes importantRulesHighlight {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
  35% { box-shadow: 0 0 0 3px rgba(56, 189, 248, .22); }
}

.important-rules-modal {
  z-index: 1335;
}

.template-manager-modal {
  z-index: 1420;
}

.account-create-modal,
.rest-create-modal {
  z-index: 1310;
}

.important-rules-modal .account-edit-dialog {
  --modal-width: min(980px, calc(100vw - 28px));
  --modal-max-height: min(94vh, 1080px);
}

.important-rules-modal-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 16px;
}

.important-rules-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
}

.important-rule-form-primary {
  flex: 0 0 auto;
  padding: 14px 16px;
  border: 1px solid rgba(56, 189, 248, .22);
  border-radius: 18px;
  background: rgba(14, 116, 144, .08);
}

.important-rule-form-head {
  margin-bottom: 12px;
}

.important-rule-form-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.important-rule-form-head p {
  margin: 0;
  font-size: 12px;
}

.important-rules-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.important-rules-list-section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.important-rules-list-title {
  margin: 0;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--subtle);
}

.important-rules-list {
  display: grid;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 120px;
  max-height: min(36vh, 360px);
  overflow: auto;
  padding-right: 4px;
}

.important-rule-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .14);
  background: rgba(15, 23, 42, .55);
}

.important-rule-card.is-disabled {
  opacity: .72;
}

.important-rule-card-main {
  min-width: 0;
}

.important-rule-card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.important-rule-card-main strong {
  margin-right: 0;
}

.important-rule-card-main p {
  margin: 8px 0 0;
  font-size: 12px;
}

.important-rule-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.important-rule-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  margin: 0;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .22);
  background: rgba(2, 6, 23, .45);
}

.important-rule-switch-label {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  min-width: 58px;
}

.important-rule-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.important-rule-switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #475569;
  transition: background .18s ease;
  flex: 0 0 auto;
}

.important-rule-switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f8fafc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  transition: transform .18s ease;
}

.important-rule-switch input:checked + .important-rule-switch-track {
  background: #16a34a;
}

.important-rule-switch input:checked + .important-rule-switch-track::after {
  transform: translateX(18px);
}

.important-rule-switch input:focus-visible + .important-rule-switch-track {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.important-rule-switch:has(input:disabled) {
  opacity: .55;
  cursor: wait;
}

.important-rule-card.is-enabled .important-rule-switch-label {
  color: #86efac;
}

.important-rule-card.is-disabled .important-rule-switch-label {
  color: #fbbf24;
}

.important-accounts-pagination {
  margin-top: 14px;
}

.important-pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .14);
  background: rgba(15, 23, 42, .45);
}

.important-pagination-meta {
  font-size: 13px;
  color: #cbd5e1;
}

.important-pagination-bar button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

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

.important-rule-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.important-rule-grid input,
.important-rule-grid select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background-color: #1d172d;
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  outline: none;
  font: inherit;
}

.important-rule-grid select {
  min-height: 42px;
}

.important-rule-checkbox {
  display: flex !important;
  align-items: center;
  gap: 8px;
  align-self: end;
}

.important-rule-checkbox input {
  width: auto;
}

.important-rule-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .important-rules-teaser {
    flex-direction: column;
    align-items: stretch;
  }

  .important-rule-grid {
    grid-template-columns: 1fr;
  }

  .important-rule-card {
    flex-direction: column;
  }
}

.sidebar a .nav-label {
  flex: 1;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  background: rgba(34, 211, 238, .18);
  border: 1px solid rgba(34, 211, 238, .45);
  color: #cffafe;
}

.nav-badge-danger {
  background: rgba(248, 113, 113, .18);
  border-color: rgba(248, 113, 113, .45);
  color: #fecaca;
}

.nav-badge-warn {
  background: rgba(251, 191, 36, .16);
  border-color: rgba(251, 191, 36, .42);
  color: #fde68a;
}

.sidebar-notify-toggle {
  flex: 1;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--subtle);
  border-radius: var(--radius);
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-notify-toggle.is-active {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  background: var(--brand-soft);
  color: var(--text);
}

.calendar-toolbar,
.calendar-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.calendar-toolbar-filters {
  margin-bottom: 14px;
}

.calendar-toolbar-filters label {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.calendar-toolbar-filters select {
  min-width: 180px;
  border: 1px solid var(--border);
  background: #1d172d;
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  font: inherit;
}

.calendar-month-label {
  margin-left: auto;
  font-size: 13px;
}

.win-calendar-panel .panel-title {
  margin-bottom: 8px;
}

.win-calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.due-calendar-board {
  margin-top: 4px;
}

.win-calendar-shell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px 20px 16px;
}

.win-calendar-header {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.win-calendar-selected-preview {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 600;
  line-height: 1.2;
}

.win-calendar-month-title {
  font-size: 14px;
  color: var(--subtle);
  text-transform: capitalize;
}

.win-calendar-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.win-calendar-alert {
  border: 1px solid rgba(248, 113, 113, .35);
  background: rgba(248, 113, 113, .08);
  color: #fecaca;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.win-calendar-alert.is-bot {
  border-color: rgba(251, 146, 60, .35);
  background: rgba(251, 146, 60, .1);
  color: #fed7aa;
}

.win-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 6px;
  padding: 0 4px;
}

.win-calendar-weekdays span {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--subtle);
  letter-spacing: .04em;
}

.win-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.win-calendar-cell {
  position: relative;
  min-height: clamp(72px, 9vw, 108px);
  border: none;
  border-radius: 14px;
  background: transparent;
  color: #f8fafc;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 6px 8px;
  font: inherit;
  transition: background .15s ease, transform .12s ease;
}

.win-calendar-cell:hover {
  background: rgba(139, 92, 246, .12);
}

.win-calendar-cell.is-other-month {
  color: rgba(148, 163, 184, .42);
}

.win-calendar-cell.is-other-month .win-calendar-cell-count {
  opacity: .55;
}

.win-calendar-cell-day {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 600;
  line-height: 1;
}

.win-calendar-cell.is-today .win-calendar-cell-day {
  box-shadow: inset 0 0 0 2px rgba(34, 211, 238, .75);
  color: #a5f3fc;
}

.win-calendar-cell.is-selected .win-calendar-cell-day {
  background: linear-gradient(180deg, #fb7185, #f97316);
  color: #fff;
  box-shadow: 0 8px 20px rgba(249, 115, 22, .35);
}

.win-calendar-cell-count {
  margin-top: 6px;
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(139, 92, 246, .28);
  color: #e9d5ff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
}

.win-calendar-cell.has-events .win-calendar-cell-count {
  background: rgba(34, 211, 238, .22);
  color: #a5f3fc;
}

.win-calendar-cell.is-selected .win-calendar-cell-count {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.win-calendar-hint {
  margin: 12px 4px 0;
  font-size: 12px;
}

.win-calendar-skeleton {
  min-height: 420px;
  border-radius: 22px;
  background: #1a1428;
  animation: skeletonPulse 1.2s ease-in-out infinite;
}

.win-calendar-day-panel {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #120e1d;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  max-height: min(720px, calc(100vh - 180px));
  position: sticky;
  top: 16px;
}

.win-calendar-day-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.win-calendar-day-panel-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.35;
  text-transform: capitalize;
}

.win-calendar-day-panel-close {
  min-width: 34px;
  padding: 4px 10px;
  font-size: 20px;
  line-height: 1;
}

.win-calendar-day-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.win-calendar-day-panel-list {
  display: grid;
  gap: 8px;
}

.win-calendar-day-panel-empty {
  margin: 0;
  padding: 20px 8px;
  text-align: center;
}

.win-calendar-day-panel-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.due-calendar-item.is-bot {
  border-color: rgba(248, 113, 113, .35);
}

.due-calendar-item.is-important {
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .25);
}

.due-calendar-item {
  display: grid;
  gap: 2px;
  text-align: left;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 12px;
  background: #1b1529;
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
}

.due-calendar-item:hover {
  border-color: rgba(34, 211, 238, .35);
}

.due-calendar-item-platform {
  font-size: 11px;
  font-weight: 700;
  color: #a5f3fc;
}

.due-calendar-item-email {
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .win-calendar-layout {
    grid-template-columns: 1fr;
  }

  .win-calendar-day-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 700px) {
  .win-calendar-cell {
    min-height: 58px;
    padding: 6px 2px;
  }

  .win-calendar-cell-day {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .win-calendar-cell-count {
    font-size: 10px;
    min-width: 20px;
    padding: 1px 5px;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.inventory-template-picker {
  grid-column: 1 / -1;
}

.managed-select-cell {
  width: 36px;
  text-align: center;
  vertical-align: middle;
}

.managed-select-cell input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent, #8b5cf6);
  cursor: pointer;
}

.managed-row.is-selected {
  background: rgba(139, 92, 246, 0.08);
}

.managed-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 16px;
  background: rgba(139, 92, 246, 0.08);
}

.managed-bulk-count {
  font-size: 13px;
}

.managed-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.managed-bulk-select {
  min-width: 160px;
  border: 1px solid var(--border);
  background: #1d172d;
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  font: inherit;
}

.upload-checklist-section {
  margin-top: 4px;
}

.upload-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.upload-checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.upload-checklist-item.is-ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.upload-checklist-item.is-fail {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.06);
}

.upload-checklist-icon {
  width: 18px;
  text-align: center;
  font-weight: 700;
}

.upload-checklist-hint {
  margin: 10px 0 0;
  font-size: 12px;
}

.rest-accounts-toolbar {
  display: grid;
  grid-template-columns: 2fr repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.rest-accounts-toolbar label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.rest-accounts-toolbar input,
.rest-accounts-toolbar select {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
}

.rest-accounts-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.rest-create-box {
  margin-bottom: 14px;
}

.rest-create-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.rest-create-form textarea {
  grid-column: 1 / -1;
}

.rest-create-actions {
  grid-column: 1 / -1;
}

.rest-accounts-table-wrap {
  margin-top: 8px;
}

.rest-accounts-table {
  table-layout: auto;
}

.rest-accounts-table th,
.rest-accounts-table td {
  vertical-align: top;
}

.rest-accounts-table .rest-account-cell {
  min-width: 220px;
}

.rest-accounts-table .rest-platform-cell {
  min-width: 180px;
}

.rest-accounts-table .rest-comments-cell {
  min-width: 280px;
  width: 32%;
}

.rest-accounts-table .rest-actions-cell {
  min-width: 220px;
}

.rest-cell-stack {
  display: grid;
  gap: 4px;
}

.rest-cell-primary {
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.rest-cell-secondary {
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.rest-cell-meta {
  font-size: 12px;
}

.rest-row-actions {
  max-width: 260px;
}

.rest-period-cell {
  min-width: 150px;
}

.rest-days-counter {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.rest-days-counter .rest-days-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  transition: color .35s ease;
}

.rest-days-counter .rest-days-total {
  font-size: 13px;
}

.rest-days-counter.rest-days-tone-safe .rest-days-value {
  color: #4ade80;
  text-shadow: 0 0 18px rgba(74, 222, 128, .22);
}

.rest-days-counter.rest-days-tone-warning .rest-days-value {
  color: #fbbf24;
  text-shadow: 0 0 18px rgba(251, 191, 36, .2);
}

.rest-days-counter.rest-days-tone-critical .rest-days-value {
  color: #f87171;
  text-shadow: 0 0 18px rgba(248, 113, 113, .24);
}

.rest-days-counter.rest-days-tone-ready .rest-days-value,
.rest-days-counter.is-ready .rest-days-value {
  color: #4ade80;
  text-shadow: 0 0 18px rgba(74, 222, 128, .28);
}

.rest-days-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
  margin-bottom: 8px;
}

.rest-days-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width .35s ease, background-color .35s ease;
}

.rest-days-progress.rest-days-tone-safe .rest-days-progress-fill {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.rest-days-progress.rest-days-tone-warning .rest-days-progress-fill {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.rest-days-progress.rest-days-tone-critical .rest-days-progress-fill {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.rest-days-progress.rest-days-tone-ready .rest-days-progress-fill {
  background: linear-gradient(90deg, #22c55e, #86efac);
}

.rest-comments-input {
  width: 100%;
  min-width: 180px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px 10px;
  font: inherit;
  resize: vertical;
}

.rest-comments-input-full {
  min-height: 88px;
  max-height: none;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  resize: vertical;
}

.rest-accounts-table tr.rest-row-recent {
  box-shadow: inset 4px 0 0 #a78bfa;
  background: rgba(167, 139, 250, .1);
}

.rest-accounts-table tr.rest-row-recent .rest-account-cell .rest-cell-primary,
.rest-accounts-table tr.rest-row-recent .rest-cell-primary .copyable-value {
  text-decoration: underline;
  text-decoration-color: #c4b5fd;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.rest-accounts-table tr.rest-row-has-dup-comments .rest-comments-cell .rest-comments-input {
  border-color: rgba(251, 191, 36, .55);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, .12);
}

.rest-comments-editor-wrap.has-duplicate-comments .rest-comments-input,
.rest-bulk-desc-editor-wrap.has-duplicate-comments textarea {
  border-color: rgba(251, 191, 36, .55);
}

.rest-comments-dup-preview {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(251, 191, 36, .08);
  border: 1px solid rgba(251, 191, 36, .22);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.rest-comments-dup-preview .rest-dup-token {
  text-decoration: underline;
  text-decoration-color: #fbbf24;
  text-decoration-thickness: 2px;
  background: rgba(251, 191, 36, .22);
  color: inherit;
  border-radius: 4px;
  padding: 0 2px;
}

.rest-comments-dup-alert {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(248, 113, 113, .24);
  font-size: 12px;
  line-height: 1.4;
}

.rest-comments-dup-alert strong {
  display: block;
  margin-bottom: 4px;
  color: #fecaca;
}

.rest-comments-dup-alert ul {
  margin: 0;
  padding-left: 18px;
}

.rest-comments-dup-alert li + li {
  margin-top: 4px;
}

.rest-dup-token-inline {
  text-decoration: underline;
  text-decoration-color: #fbbf24;
}

.rest-accounts-summary .rest-dup-summary.warn {
  color: #fbbf24;
  font-weight: 700;
}

.rest-bulk-desc-table tr.rest-bulk-desc-row-dup td {
  background: rgba(251, 191, 36, .05);
}

.rest-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rest-edit-form label:has(textarea),
.rest-edit-form label:has([readonly]) {
  grid-column: 1 / -1;
}

.rest-edit-modal .account-edit-dialog {
  --modal-width: min(760px, calc(100vw - 28px));
}

.rest-actions-cell .row-actions {
  flex-wrap: wrap;
}

.rest-accounts-table tr.is-rest-problem {
  background: rgba(251, 191, 36, .06);
}

.rest-accounts-table tr.is-rest-fallen {
  background: rgba(248, 113, 113, .08);
}

.rest-issue-note {
  margin-top: 6px;
  font-size: 12px;
  white-space: pre-wrap;
}

.rest-status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.rest-move-content label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.rest-move-content textarea,
.rest-move-content input {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
}

@media (max-width: 960px) {
  .rest-accounts-toolbar,
  .rest-create-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .managed-bulk-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .managed-bulk-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .managed-bulk-select {
    width: 100%;
  }
}

.account-timeline-modal .account-timeline-dialog {
  --modal-width: min(760px, calc(100vw - 28px));
  --modal-max-height: min(88vh, 920px);
}

.account-timeline-content {
  max-height: min(70vh, 760px);
  overflow: auto;
}

.account-timeline {
  display: grid;
  gap: 10px;
}

.account-timeline-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 14px;
}

.account-timeline-item.comment {
  border-left: 3px solid #38bdf8;
}

.account-timeline-item.field_change {
  border-left: 3px solid #fbbf24;
}

.account-timeline-item.created,
.account-timeline-item.moved_to_rest,
.account-timeline-item.moved_from_rest,
.account-timeline-item.moved_to_inventory,
.account-timeline-item.rest_finalized {
  border-left: 3px solid #4ade80;
}

.account-timeline-item.issue_updated {
  border-left: 3px solid #fb923c;
}

.account-timeline-item.deleted {
  border-left: 3px solid #f87171;
}

.account-timeline-item-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.timeline-kind-badge {
  margin-left: auto;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.timeline-summary {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.timeline-diff {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.timeline-diff-block span,
.timeline-diff > span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.timeline-diff pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
}

.timeline-diff.removed pre {
  border-color: rgba(248, 113, 113, .35);
}

.timeline-diff.added pre {
  border-color: rgba(74, 222, 128, .35);
}

.account-create-modal .account-edit-dialog,
.rest-create-modal .account-edit-dialog {
  --modal-width: 860px;
}

.account-create-modal .account-edit-content,
.rest-create-modal .account-edit-content {
  overflow: auto;
  overflow-x: hidden;
}

.account-create-form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-create-form .inventory-template-picker,
.account-create-form .inventory-template-toolbar,
.account-create-form textarea,
.account-create-form .account-create-status,
.account-create-form .account-create-footer,
.account-create-form .provider-autocomplete-field,
.account-create-form .account-create-tip,
.account-create-form .account-create-credentials {
  grid-column: 1 / -1;
}

.account-create-tip {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(99, 102, 241, .1);
  border: 1px solid rgba(129, 140, 248, .22);
  font-size: .9rem;
  line-height: 1.45;
}

.account-create-credentials {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, .55);
  border: 1px solid rgba(148, 163, 184, .18);
}

.account-create-credentials label {
  display: grid;
  gap: 6px;
}

.account-create-form label {
  display: grid;
  gap: 6px;
}

.account-create-form kbd,
.account-edit-header kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, .35);
  background: rgba(15, 23, 42, .75);
  font-size: .82em;
  font-family: inherit;
}

.account-create-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, .16);
}

.keep-adding-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: .95rem;
  font-weight: 600;
  color: #f8fafc;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.keep-adding-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 2px solid rgba(167, 139, 250, .75);
  border-radius: 6px;
  background: rgba(15, 23, 42, .9);
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  transition:
    background .15s ease,
    border-color .15s ease,
    box-shadow .15s ease;
}

.keep-adding-toggle input[type="checkbox"]::after {
  content: '';
  width: 5px;
  height: 9px;
  border-right: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: border-color .15s ease;
}

.keep-adding-toggle input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  border-color: #c4b5fd;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .18);
}

.keep-adding-toggle input[type="checkbox"]:checked::after {
  border-right-color: #fff;
  border-bottom-color: #fff;
}

.keep-adding-toggle input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .28);
}

.keep-adding-toggle span,
.keep-adding-toggle {
  color: #f8fafc;
}

.account-create-status:empty {
  display: none;
}

.provider-autocomplete-wrap,
.provider-autocomplete-field {
  position: relative;
}

.provider-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  max-height: 220px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 12px;
  background: #0f172a;
  box-shadow: 0 16px 36px rgba(2, 6, 23, .45);
}

.provider-suggestion-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
}

.provider-suggestion-item:hover,
.provider-suggestion-item:focus,
.provider-suggestion-item.is-active {
  background: rgba(99, 102, 241, .22);
  color: #f8fafc;
}

.provider-recent-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.provider-recent-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, .85);
}

.provider-recent-chip {
  border: 1px solid rgba(129, 140, 248, .35);
  background: rgba(99, 102, 241, .12);
  color: #e0e7ff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.provider-recent-chip:hover,
.provider-recent-chip:focus {
  background: rgba(99, 102, 241, .28);
  border-color: rgba(165, 180, 252, .65);
}

.inventory-template-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.inventory-template-field {
  flex: 1 1 260px;
  display: grid;
  gap: 6px;
  margin: 0;
}

.inventory-template-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.template-manager-modal .account-edit-dialog {
  --modal-width: 760px;
}

.template-manager-layout {
  display: grid;
  gap: 18px;
}

.template-manager-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.template-manager-section h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #e2e8f0;
}

.template-manager-list {
  display: grid;
  gap: 10px;
}

.template-manager-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 14px;
  background: rgba(15, 23, 42, .45);
}

.template-manager-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.template-move-button {
  min-width: 34px;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1;
}

.template-move-button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.template-quick-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.template-quick-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.template-manager-item .danger-text {
  color: #fca5a5;
}

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

.template-editor-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--subtle);
}

.template-editor-form input:not([type="color"]),
.template-editor-form select,
.template-editor-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background-color: #1d172d;
  color: var(--text);
  border-radius: 14px;
  padding: 11px 12px;
  outline: none;
  font: inherit;
  line-height: 1.35;
  min-height: 42px;
}

.template-editor-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 36px;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.template-editor-form textarea {
  min-height: 88px;
  height: auto;
  resize: vertical;
}

.template-editor-form input::placeholder,
.template-editor-form textarea::placeholder {
  color: rgba(148, 163, 184, .72);
}

.template-editor-form label,
.template-editor-form .template-editor-actions,
.template-editor-form textarea {
  grid-column: 1 / -1;
}

.template-editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, .16);
}

.template-back-button {
  margin-bottom: 8px;
}

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

  .template-manager-item {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 960px) {
  .rest-bulk-create-modal .rest-bulk-platform-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "platform plan"
      "days days"
      "provider provider";
  }

  .rest-bulk-create-modal .rest-bulk-accounts-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .rest-bulk-create-modal .rest-bulk-platform-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "platform"
      "plan"
      "days"
      "provider";
  }

  .rest-bulk-create-modal .account-edit-dialog,
  .rest-bulk-create-modal .account-edit-dialog.modal-size-lg,
  .rest-bulk-create-modal .account-edit-dialog.modal-size-xl,
  .rest-bulk-create-modal .account-edit-dialog.modal-size-full {
    width: 100%;
    max-width: 100%;
    --modal-width: 100%;
  }
}

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

  .account-create-credentials {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .custom-select-menu,
  .custom-select-trigger,
  .custom-select-option,
  .platform-group[open] .plan-grid,
  .inventory-create-box[open] > .inventory-create-form {
    animation: none !important;
    transition: none !important;
  }
}

.streamcodex-property-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.15);
  color: #fcd34d;
  white-space: nowrap;
  vertical-align: middle;
}

.streamcodex-property-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
}

.streamcodex-property-confirm-overlay[hidden] {
  display: none !important;
}

.streamcodex-property-confirm-dialog {
  width: min(100%, 460px);
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: #0f172a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.streamcodex-property-confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  background: rgba(212, 175, 55, 0.08);
}

.streamcodex-property-confirm-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #fcd34d;
}

.streamcodex-property-confirm-body {
  padding: 18px;
  color: #e2e8f0;
  display: grid;
  gap: 12px;
}

.streamcodex-property-confirm-body p {
  margin: 0;
  line-height: 1.5;
  white-space: pre-line;
}

.streamcodex-property-confirm-dismiss {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: #cbd5e1;
}

.streamcodex-property-confirm-dismiss input {
  margin-top: 3px;
}

.streamcodex-property-confirm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px 18px;
}

.netflix-extras-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 18px;
  margin-bottom: 14px;
}

.netflix-extras-toolbar label {
  display: grid;
  gap: 6px;
  min-width: min(100%, 280px);
  color: var(--subtle);
  font-size: 12px;
}

.netflix-extras-toolbar input,
#netflixInventorySearch {
  width: 100%;
  border: 1px solid var(--border);
  background-color: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
  color-scheme: dark;
  outline: none;
}

.netflix-extras-toolbar input::placeholder,
#netflixInventorySearch::placeholder {
  color: var(--subtle);
}

.netflix-search-hint {
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.4;
}

.netflix-link-field {
  position: relative;
}

.netflix-link-suggestions {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow-md);
}

.netflix-link-empty {
  margin: 0;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

.netflix-link-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.netflix-link-option span {
  color: var(--subtle);
  font-size: 12px;
}

.netflix-link-option:hover,
.netflix-link-option:focus {
  background: var(--surface-2);
}

.netflix-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.netflix-filter-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--subtle);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.netflix-filter-button.is-active {
  background: #e50914;
  border-color: #e50914;
  color: #fff;
}

.netflix-extras-summary {
  align-items: center;
}

.netflix-extras-board {
  display: grid;
  gap: 14px;
}

.netflix-account-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.netflix-account-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 12px;
}

.netflix-account-email {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.netflix-account-email strong {
  overflow-wrap: anywhere;
}

.netflix-account-email button,
.netflix-account-tools button,
.netflix-extra-actions button {
  border: 0;
  background: transparent;
  color: var(--subtle);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 8px;
}

.netflix-account-email button:hover,
.netflix-account-tools button:hover,
.netflix-extra-actions button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.netflix-account-head p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 4px 0 0;
  font-size: 12px;
}

.netflix-account-owner {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.netflix-account-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.netflix-slot-badge {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.netflix-slot-badge.is-free {
  color: #86efac;
  background: rgba(34, 197, 94, .12);
  border: 1px solid rgba(34, 197, 94, .28);
}

.netflix-slot-badge.is-full {
  color: var(--subtle);
  background: var(--surface);
  border: 1px solid var(--border);
}

.netflix-account-notes {
  margin: 0;
  padding: 8px 16px;
  background: rgba(0, 0, 0, .18);
  color: var(--subtle);
  font-size: 12px;
}

.netflix-extras-block {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
}

.netflix-extras-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}

.netflix-extras-block-head em {
  margin-left: 6px;
  color: var(--text);
  font-style: normal;
}

.netflix-extras-block-head .netflix-add-extra {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(229, 9, 20, .55);
  background: rgba(229, 9, 20, .14);
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px 6px 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
}

.netflix-extras-block-head .netflix-add-extra > span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e50914;
  color: #fff;
  font-size: 16px;
  line-height: 1;
}

.netflix-extras-block-head .netflix-add-extra:hover {
  background: #e50914;
  border-color: #e50914;
}

.netflix-extras-block-head .netflix-add-extra:disabled {
  opacity: .55;
  cursor: not-allowed;
  background: var(--surface);
  color: var(--subtle);
  border-color: var(--border);
}

.netflix-extras-block-head .netflix-add-extra:disabled > span {
  background: var(--border);
  color: var(--subtle);
}

.netflix-extra-grid {
  display: grid;
  gap: 8px;
}

.netflix-extra-empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--subtle);
  font-size: 13px;
}

.netflix-extra-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: background var(--motion-base) ease, border-color var(--motion-base) ease, box-shadow var(--motion-base) ease;
}

.netflix-extra-card:hover {
  background: #151d2e;
  border-color: rgba(139, 92, 246, .4);
  box-shadow: inset 3px 0 0 #8b5cf6;
}

.netflix-extra-card.is-expired {
  border-color: rgba(229, 9, 20, .45);
}

.netflix-extra-card.is-expired:hover {
  background: #1c1420;
  border-color: rgba(229, 9, 20, .7);
  box-shadow: inset 3px 0 0 #e50914;
}

.netflix-extra-main {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.netflix-extra-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.netflix-extra-title button {
  border: 0;
  background: transparent;
  color: var(--subtle);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 8px;
}

.netflix-extra-title button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.netflix-extra-email {
  color: var(--text);
}

.netflix-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.netflix-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #22c55e;
}

.netflix-progress-fill.is-soon {
  background: #f59e0b;
}

.netflix-progress-fill.is-today,
.netflix-progress-fill.is-expired {
  background: #e50914;
}

.netflix-extra-progress-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--subtle);
  font-size: 12px;
}

.netflix-extra-main strong,
.netflix-extra-main span {
  overflow-wrap: anywhere;
}

.netflix-extra-main > span,
.netflix-extra-meta,
.netflix-extra-notes,
.netflix-extra-main .muted {
  color: var(--subtle);
  font-size: 12px;
}

.netflix-extra-main > span.netflix-extra-email {
  color: var(--text);
  font-size: 13px;
}

.netflix-extra-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.netflix-extra-meta > span {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
}

.netflix-extra-cost {
  color: #86efac;
}

.netflix-days-chip.is-ok { color: #86efac; }
.netflix-days-chip.is-soon { color: #fbbf24; }
.netflix-days-chip.is-today,
.netflix-days-chip.is-expired { color: #fca5a5; }

.netflix-extra-notes,
.netflix-extra-notified,
.netflix-extra-main .muted {
  margin: 0;
}

.netflix-extra-notified {
  color: #86efac;
  font-size: 11px;
}

.netflix-extra-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  flex-shrink: 0;
}

.netflix-extra-actions .netflix-extra-action {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.netflix-extra-actions .netflix-extra-action:hover {
  background: var(--surface-2);
  border-color: rgba(139, 92, 246, .4);
  color: var(--text);
}

.netflix-extra-actions .netflix-extra-action.is-danger:hover {
  border-color: rgba(229, 9, 20, .55);
  color: #fca5a5;
}

.netflix-schedule-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.netflix-schedule-mode legend {
  padding: 0 6px;
  color: var(--subtle);
  font-size: 12px;
}

.netflix-schedule-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.netflix-due-preview {
  margin: 0;
  font-size: 12px;
}

.due-calendar-item.is-netflix-extra {
  border-color: rgba(229, 9, 20, .45);
}

.win-calendar-alert.is-netflix-extra {
  border-color: rgba(229, 9, 20, .45);
}

@media (max-width: 720px) {
  .netflix-account-head,
  .netflix-extra-card {
    flex-direction: column;
  }

  .netflix-account-tools,
  .netflix-extra-actions {
    flex-direction: row;
    justify-content: flex-start;
  }
}
