:root {
  --color-bg: #0f172a;
  --color-surface: #111827;
  --color-accent: #2563eb;
  --color-accent-light: rgba(37, 99, 235, 0.15);
  --color-text: #0f172a;
  --color-muted: #6b7280;
  --color-panel: #ffffff;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.12);
  --transition: 0.25s ease;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: linear-gradient(160deg, #f8fafc, #e2e8f0);
  color: var(--color-text);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
}
.topbar-branding {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.topbar-clock {
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.85);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}
.topbar-username {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(226, 232, 240, 0.85);
}
.btn-logout {
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
}
.brand {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  font-size: 1.35rem;
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.menu-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.35);
}
.layout {
  display: flex;
  min-height: calc(100vh - 74px);
}
.auth-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1e293b, #0f172a);
}
.auth-container {
  width: min(420px, 92vw);
  padding: 2rem 1.25rem;
}
.auth-panel {
  padding: 2.5rem 2.25rem;
  text-align: center;
}
.auth-panel h1 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  color: var(--color-bg);
}
.auth-panel p {
  margin: 0 0 1.75rem;
  color: var(--color-muted);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.auth-form .form-field {
  text-align: left;
}
.auth-form .btn {
  width: 100%;
}
.auth-flashes {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.auth-flashes .flash {
  margin: 0;
}
.sidebar {
  width: 260px;
  padding: 1.5rem 1.25rem;
  background: rgba(17, 24, 39, 0.9);
  color: #e2e8f0;
  backdrop-filter: blur(18px);
  box-shadow: inset -1px 0 0 rgba(148, 163, 184, 0.1);
  z-index: 101;
}
.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.nav-heading {
  padding: 0 0.65rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--color-muted);
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.nav-group .nav-heading {
  padding-left: 0.65rem;
}
.nav-subheading {
  display: block;
  padding: 0 0.9rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.85);
}
.nav-item-servers {
  gap: 0.35rem;
}
.sidebar .nav-sublist {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.nav-sublist-inline {
  padding-left: 1.25rem;
}
.nav-sublist-inline .nav-sublink {
  padding-left: 0.85rem;
  font-size: 0.84rem;
}
.nav-item-servers .nav-sublist {
  padding-left: 1.2rem;
}
.nav-note {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.75);
}
.field-help {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.85);
}
.contact-display {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f2937;
}
.contact-inline-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.contact-inline-form input[type="text"] {
  flex: 1;
  min-width: 180px;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.9);
  font-size: 0.85rem;
  transition: border var(--transition), box-shadow var(--transition);
}
.contact-inline-form input[type="text"]:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.65);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.link-copy {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
}
.copy-input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
}
.btn-copy {
  white-space: nowrap;
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
}
.nav-sublink {
  padding: 0.45rem 0.75rem 0.45rem 1rem;
  font-size: 0.88rem;
}
.nav-sublink:hover,
.nav-sublink:focus {
  transform: translateX(2px);
}
.nav-sublink.active {
  transform: translateX(0);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  transition: background var(--transition), color var(--transition),
    transform var(--transition);
}
.nav-link.active {
  background: var(--color-accent);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.35);
}
.nav-link:hover,
.nav-link:focus {
  outline: none;
  background: var(--color-accent-light);
  color: #ffffff;
  transform: translateX(4px);
}
.nav-link.active:hover,
.nav-link.active:focus {
  background: var(--color-accent);
  transform: translateX(2px);
}
.nav-link .nav-icon {
  width: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  opacity: 0.85;
}
.nav-divider {
  margin: 0.9rem 0;
  border-top: 1px dashed rgba(148, 163, 184, 0.25);
  list-style: none;
  height: 1px;
}
.nav-version {
  margin-top: auto;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.6);
  text-align: center;
  border-top: 1px dashed rgba(148, 163, 184, 0.25);
}
.nav-sublink .nav-icon {
  font-size: 0.65rem;
  opacity: 0.65;
}
.nav-version {
  margin-top: auto;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.6);
  text-align: center;
  border-top: 1px dashed rgba(148, 163, 184, 0.25);
}
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 3.25rem 4rem 4rem;
  width: 100%;
  max-width: none;
  margin: 0;
}
.panel,
.flash-stack {
  background: var(--color-panel);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: transform var(--transition), box-shadow var(--transition);
  width: 100%;
}
.panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}
.panel-dashboard {
  background: #ffffff;
  color: var(--color-text);
  padding: 2rem 2.25rem;
  gap: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 25px 50px -25px rgba(15, 23, 42, 0.25);
}
.panel-dashboard h2 {
  color: var(--color-bg);
  font-size: 1.4rem;
  letter-spacing: 0.01em;
}
.panel-dashboard p {
  color: var(--color-muted);
  font-size: 0.96rem;
}
.panel-dashboard.panel-dashboard-admin {
  gap: 2rem;
}
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}
.summary-card {
  background: linear-gradient(135deg, #2e3350 0%, #1c1f2b 100%);
  border-radius: 18px;
  padding: 1.2rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.28);
  color: #e8edff;
}
.summary-card--accent {
  position: relative;
  overflow: hidden;
}
.summary-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.summary-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbeafe;
}
.summary-card-label {
  font-size: 0.82rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.86);
  font-weight: 700;
}
.summary-card-value {
  font-size: 2.7rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.dashboard-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(71, 85, 105, 0.95);
}
.servers-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.resellers-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.2fr);
  gap: 1.5rem;
  align-items: stretch;
}
.servers-column,
.expirations-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.expirations-column .widget {
  flex: 1;
}
.dashboard-section-servers .servers-grid {
  flex: 1;
}
@media (max-width: 1200px) {
  .dashboard-split {
    grid-template-columns: 1fr;
  }
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.widget {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.65), rgba(241, 245, 249, 0.9));
  border-radius: var(--radius-md);
  padding: 1.35rem 1.25rem;
  box-shadow: 0 18px 35px -20px rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.widget:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 44px -18px rgba(30, 41, 59, 0.4);
}
.widget-status.is-online {
  background: linear-gradient(150deg, rgba(187, 247, 208, 0.85), rgba(220, 252, 231, 0.75));
  border-color: rgba(74, 222, 128, 0.4);
}
.widget-status.is-offline {
  background: linear-gradient(150deg, rgba(254, 226, 226, 0.9), rgba(254, 243, 242, 0.8));
  border-color: rgba(248, 113, 113, 0.35);
}
.widget-status.is-unknown {
  background: linear-gradient(150deg, rgba(219, 234, 254, 0.85), rgba(224, 231, 255, 0.7));
  border-color: rgba(96, 165, 250, 0.35);
}
.widget-status.is-unassigned {
  background: linear-gradient(150deg, rgba(226, 232, 240, 0.85), rgba(248, 250, 252, 0.75));
  border-color: rgba(148, 163, 184, 0.35);
}
.widget h3 {
  margin: 0;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(100, 116, 139, 0.9);
}
.widget-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.widget-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: #0f172a;
}
.widget-note {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.75);
}
.widget-stat {
  margin: 0;
  font-size: 0.92rem;
  color: #0f172a;
  font-weight: 600;
}
.widget-stat span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(100, 116, 139, 0.85);
  margin-right: 0.35rem;
}
.widget-warning {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #b45309;
}
.widget-orphans {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.25);
}
.widget-orphans ul {
  margin: 0;
  padding-left: 1.1rem;
  color: #92400e;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.widget-meta {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(71, 85, 105, 0.9);
  font-weight: 500;
}
.widget-status .status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: rgba(71, 85, 105, 0.85);
  width: fit-content;
  text-transform: uppercase;
}
.widget-status.is-online .status-indicator {
  background: rgba(34, 197, 94, 0.16);
  color: #15803d;
}
.widget-status.is-offline .status-indicator {
  background: rgba(248, 113, 113, 0.2);
  color: #b91c1c;
}
.widget-status.is-unassigned .status-indicator {
  background: rgba(148, 163, 184, 0.18);
  color: rgba(71, 85, 105, 0.85);
}
.widget-status.is-unknown .status-indicator {
  background: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(71, 85, 105, 0.9);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.2);
}
.widget-status.is-online .status-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(134, 239, 172, 0.35);
}
.widget-status.is-offline .status-dot {
  background: #dc2626;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.2);
}
.widget-status.is-unassigned .status-dot {
  background: rgba(100, 116, 139, 0.9);
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.3);
}
.widget-status.is-unknown .status-dot {
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.28);
}
.widget-counts strong {
  display: inline-block;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(148, 163, 184, 0.85);
  margin-right: 0.4rem;
}
.widget-counts p {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}
.widget-expirations ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.widget-expirations li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: rgba(219, 234, 254, 0.7);
  color: #1e3a8a;
}
.widget-expirations li.is-overdue {
  background: rgba(254, 226, 226, 0.75);
  color: #b91c1c;
}
.widget-expirations li.is-urgent {
  background: rgba(254, 226, 226, 0.75);
  color: #b91c1c;
}
.exp-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.exp-name {
  font-weight: 600;
  font-size: 0.95rem;
}
.exp-email,
.exp-notes {
  font-size: 0.85rem;
  font-weight: 500;
}
.exp-email {
  color: #1e40af;
}
.exp-notes {
  color: #0369a1;
}
.exp-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: rgba(71, 85, 105, 0.85);
}
.exp-countdown {
  font-size: 0.85rem;
  font-weight: 600;
  color: inherit;
}
.exp-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1f2937;
}
.exp-remaining {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  margin-top: 0.25rem;
}
.widget-expirations p {
  margin: 0;
  color: rgba(71, 85, 105, 0.85);
  font-size: 0.9rem;
}
.panel-dashboard + .panel {
  margin-top: 1rem;
}

.panel h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--color-bg);
}
.panel p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}
.panel-summary .summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.summary-item {
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.summary-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}
.summary-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-bg);
}
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.panel-subtitle {
  margin-top: 0.35rem;
  font-size: 0.9rem;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.form-field label {
  font-size: 0.85rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-field input {
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #f8fafc;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-field input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}
.form-field textarea {
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #f8fafc;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 80px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}
.form-field-notes {
  grid-column: 1 / -1;
}
.field-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--color-muted);
}
.sort-button {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
}
.sort-button::after {
  content: "↕";
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.35);
}
.sort-button.sorted-asc::after {
  content: "↑";
  color: var(--color-accent);
}
.sort-button.sorted-desc::after {
  content: "↓";
  color: var(--color-accent);
}
.extend-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.extend-form select {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #ffffff;
  font-size: 0.9rem;
  cursor: pointer;
}
.extend-form select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.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;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
    background var(--transition), color var(--transition);
  text-decoration: none;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28);
}
.btn-primary:hover {
  box-shadow: 0 15px 32px rgba(37, 99, 235, 0.38);
}
.btn-secondary {
  background: rgba(148, 163, 184, 0.18);
  color: var(--color-bg);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35);
}
.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.28);
}
.btn-danger {
  background: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.35);
}
.btn-danger:hover {
  background: rgba(248, 113, 113, 0.3);
}
.flash-stack {
  flex-direction: column;
  gap: 0.75rem;
}
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}
.flash-success {
  background: rgba(34, 197, 94, 0.15);
  color: #166534;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.35);
}
.flash-error {
  background: rgba(248, 113, 113, 0.15);
  color: #991b1b;
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.35);
}
.flash-info {
  background: rgba(59, 130, 246, 0.15);
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
}
.table-wrapper {
  overflow-x: auto;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.8rem;
}
.panel-resellers .reseller-invites-row td {
  background: rgba(148, 163, 184, 0.08);
  padding: 1.5rem;
  border: none;
}
.panel-resellers .invites-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.panel-resellers .invites-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--color-bg);
}
.panel-resellers .invites-header p {
  margin: 0.25rem 0 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}
.panel-resellers .nested-table-wrapper {
  margin-top: 0.5rem;
}
.panel-resellers .nested-table-wrapper .server-table {
  min-width: 640px;
}
.empty-state-inline {
  margin: 0;
  font-size: 0.95rem;
}
.table-controls {
  display: none;
  margin-bottom: 1rem;
}
.table-controls select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-text);
  font-weight: 600;
}
.server-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.server-table th,
.server-table td {
  padding: 0.85rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.server-table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}
.users-table .user-row.expired {
  background: rgba(248, 113, 113, 0.08);
}
.users-table .user-row.expired:hover {
  background: rgba(248, 113, 113, 0.12);
}
.users-table tbody tr:nth-child(even):not(.expired) {
  background: rgba(148, 163, 184, 0.06);
}
.users-table tbody tr:nth-child(odd):not(.expired) {
  background: rgba(148, 163, 184, 0.02);
}
.users-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.08);
}

}
}
}
}
}
}
}
}

.users-table th {
  white-space: nowrap;
}
.users-table td {
  white-space: normal;
  word-break: break-word;
}
.users-table .date-value {
  display: block;
  font-weight: 600;
}
.countdown {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--color-muted);
}
.server-table tbody tr:hover {
  background: rgba(148, 163, 184, 0.08);
}
.server-table .mono {
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.85rem;
  word-break: break-all;
}
.action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.action-group form {
  margin: 0;
}
.inline-confirm {
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  background: rgba(248, 113, 113, 0.12);
}
.inline-confirm.open {
  display: flex;
}
.inline-confirm span {
  font-weight: 600;
  color: #991b1b;
}
.inline-confirm form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.inline-confirm textarea {
  width: 100%;
  min-height: 48px;
  resize: vertical;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.35);
  font-family: inherit;
}
.inline-confirm button {
  align-self: flex-start;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.chip-online {
  background: rgba(34, 197, 94, 0.18);
  color: #15803d;
}
.chip-offline {
  background: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
}
.chip-pending {
  background: rgba(148, 163, 184, 0.18);
  color: #334155;
}
.status-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
  color: var(--color-muted);
  font-size: 0.78rem;
}
.empty-state {
  margin: 0;
  color: var(--color-muted);
}
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  width: 100%;
}
.status-card {
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 1px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}
.status-card.online {
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 15px 32px rgba(34, 197, 94, 0.15);
}
.status-card.offline {
  border-color: rgba(248, 113, 113, 0.35);
  box-shadow: 0 15px 32px rgba(248, 113, 113, 0.12);
}
.status-card.pending {
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 15px 32px rgba(148, 163, 184, 0.12);
}
.status-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.status-card h3 {
  margin: 0;
  font-size: 1.05rem;
}
.status-dot {
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-dot-online {
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
}
.status-dot-offline {
  background: rgba(248, 113, 113, 0.16);
  color: #b91c1c;
}
.status-dot-pending {
  background: rgba(148, 163, 184, 0.2);
  color: #1f2937;
}
.status-details {
  display: grid;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}
.status-details dt {
  font-weight: 600;
  color: var(--color-bg);
}
.status-details dd {
  margin: 0.15rem 0 0;
}
.status-note {
  display: block;
  margin-top: 0.25rem;
  color: var(--color-muted);
  font-size: 0.75rem;
}
.status-message {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-muted);
}
@media (max-width: 960px) {
  .layout {
    position: relative;
  }
  .menu-toggle {
    display: inline-flex;
  }
@media (max-width: 960px) {
  .layout {
    position: relative;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .sidebar {
    position: fixed;
    top: 74px;
    left: 0;
    height: calc(100vh - 74px);
    width: min(260px, 75%);
    transform: translateX(-100%);
    transition: transform var(--transition), box-shadow var(--transition);
    box-shadow: 12px 0 30px rgba(15, 23, 42, 0.3);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .content {
    padding: 1.5rem;
  }
  .panel-summary .summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
  .status-card {
    padding: 1rem;
  }
}
@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .panel-summary .summary-grid {
    grid-template-columns: 1fr;
  }
  .action-group {
    flex-direction: column;
    align-items: stretch;
  }
  .table-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  .server-table {
    display: block;
    width: 100%;
  }
  .server-table thead {
    display: none;
  }
  .server-table tr,
  .server-table tbody {
    display: block;
    width: 100%;
  }
  .server-table tr {
    background: rgba(148, 163, 184, 0.08);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }
  .server-table td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: none;
    padding: 0;
    font-size: 0.95rem;
    gap: 0.25rem;
  }
  .server-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
  }
  .server-table td[data-label="Nombre"] {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text);
  }
  .server-table td[data-label="Nombre"]::before {
    display: none;
  }
  .server-table td[data-label="Acciones"] .action-group {
    width: 100%;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .server-table td[data-label="Acciones"] {
    padding-top: 0.5rem;
  }
  .server-table td[data-label="Acciones"] .action-group > * {
    width: auto;
  }
  .server-table td[data-label="Acciones"] .action-group form {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }
  .server-table td[data-label="Acciones"] .action-group form select {
    width: 100%;
    max-width: 120px;
  }
  .server-table td[data-label="Acciones"] .action-group .btn {
    width: auto;
    align-self: flex-start;
    flex-shrink: 0;
  }
  .server-table td[data-label="Nombre"],
  .server-table td[data-label="Fecha alta"],
  .server-table td[data-label="Estado"],
  .server-table td[data-label="Observaciones"],
  .server-table td[data-label="Código de invitación"] {
    display: none !important;
  }
  .user-row.expanded td[data-label="Nombre"],
  .user-row.expanded td[data-label="Fecha alta"],
  .user-row.expanded td[data-label="Estado"],
  .user-row.expanded td[data-label="Observaciones"],
  .user-row.expanded td[data-label="Código de invitación"] {
    display: flex !important;
  }
}
@media (max-width: 520px) {
  .topbar {
    padding: 0.9rem 1rem;
  }
  .content {
    padding: 1.25rem 1rem 2.5rem;
  }
  .flash-stack {
    padding: 1rem;
  }
}
.users-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.08);
}
