.acct-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  padding-top: 74px;
  min-height: 100vh;
  background: linear-gradient(170deg, var(--bg-primary), var(--bg-secondary));
}

.acct-sidebar {
  border-right: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 74px;
  height: calc(100vh - 74px);
  overflow-y: auto;
  padding: 22px 16px;
}

.acct-sidebar-section + .acct-sidebar-section {
  margin-top: 18px;
}

.acct-sidebar-label {
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 0 8px;
}

.acct-nav-link {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 14px;
  margin-bottom: 4px;
}

.acct-nav-link:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.acct-nav-link--active {
  border-color: rgba(59,130,246,0.35);
  background: rgba(59,130,246,0.14);
  color: var(--accent-cyan);
  font-weight: 600;
}

.acct-quota-card {
  margin-top: 20px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px;
  background: var(--bg-card-hover);
}

.acct-quota-label {
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.acct-quota-track {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  margin: 9px 0 7px;
  overflow: hidden;
}

.acct-quota-fill {
  height: 100%;
  width: 0;
  background: var(--gradient-accent);
}

.acct-quota-text {
  font-size: 12px;
  color: var(--text-secondary);
}

.acct-quota-text strong {
  color: var(--text-primary);
}

.acct-quota-reset {
  font-size: 11px;
  color: var(--text-muted);
}

.acct-plan-chip {
  margin-top: 14px;
  border-radius: 10px;
  border: 1px solid;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.acct-plan-chip span {
  font-size: 13px;
  font-weight: 700;
}

.acct-plan-chip small,
.acct-plan-chip a {
  margin-left: auto;
  font-size: 11px;
}

.acct-plan-chip--pro {
  border-color: rgba(59,130,246,0.34);
  background: rgba(59,130,246,0.14);
  color: var(--accent-cyan);
}

.acct-plan-chip--agency {
  border-color: rgba(124,58,237,0.34);
  background: rgba(124,58,237,0.14);
  color: var(--accent-purple);
}

.acct-plan-chip--free {
  border-color: rgba(245,158,11,0.34);
  background: rgba(245,158,11,0.12);
  color: var(--accent-amber);
}

.acct-plan-chip--free a {
  color: var(--accent-cyan);
}

.acct-main {
  padding: 30px 34px;
  max-width: 1080px;
}

.acct-section {
  display: none;
}

.acct-section--active {
  display: block;
  animation: fadeInUp 0.18s ease;
}

.acct-title {
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.acct-subtitle {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.acct-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.acct-stats-grid--affiliate {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.acct-stat-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: var(--bg-card-hover);
}

.acct-stat-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.acct-stat-label {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.acct-stat-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.acct-stat-sub a {
  color: var(--accent-cyan);
}

.acct-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-card-hover);
  padding: 20px;
  margin-bottom: 14px;
}

.acct-card h2 {
  font-size: 19px;
  margin-bottom: 12px;
}

.acct-card p {
  color: var(--text-secondary);
  font-size: 14px;
}

.acct-card--danger {
  border-color: rgba(244,63,94,0.34);
}

.acct-plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.acct-card-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 16px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg-card);
}

.acct-card-meta p {
  margin: 0;
}

.acct-chip-label {
  font-size: 10px;
  text-transform: uppercase;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.acct-plan-header h2 {
  font-size: 32px;
  margin: 0;
}

.acct-plan-expiry {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.acct-plan-expiry strong {
  color: var(--text-primary);
}

.acct-plan-expiry span {
  margin-left: 6px;
  color: var(--accent-cyan);
  font-family: "JetBrains Mono", monospace;
}

.acct-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.acct-table th,
.acct-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
}

.acct-table th {
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 10px;
  color: var(--text-muted);
}

.acct-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.acct-field-grid label,
.acct-field-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
}

.acct-field-grid input,
.acct-field-stack input,
.acct-field-stack select,
.acct-field-stack textarea,
.acct-inline input,
#ticketMessage {
  border: 1px solid var(--border-light);
  background: var(--bg-card-hover);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 10px 12px;
  outline: none;
  font-size: 14px;
  font-family: "DM Sans", sans-serif;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

.acct-field-stack select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.acct-select-rich {
  padding-right: 44px;
  border-color: rgba(59,130,246,0.24);
  background:
    linear-gradient(180deg, rgba(59,130,246,0.08), rgba(59,130,246,0.03)),
    linear-gradient(45deg, transparent 50%, var(--accent-cyan) 50%),
    linear-gradient(135deg, var(--accent-cyan) 50%, transparent 50%),
    var(--bg-card-hover);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: auto, 7px 7px, 7px 7px, auto;
  background-position: 0 0, calc(100% - 18px) calc(50% - 2px), calc(100% - 13px) calc(50% - 2px), 0 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.acct-select-rich:hover,
.acct-select-rich:focus {
  border-color: rgba(59,130,246,0.38);
  background:
    linear-gradient(180deg, rgba(59,130,246,0.12), rgba(59,130,246,0.05)),
    linear-gradient(45deg, transparent 50%, var(--accent-cyan) 50%),
    linear-gradient(135deg, var(--accent-cyan) 50%, transparent 50%),
    var(--bg-card-hover);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-size: auto, 7px 7px, 7px 7px, auto;
  background-position: 0 0, calc(100% - 18px) calc(50% - 2px), calc(100% - 13px) calc(50% - 2px), 0 0;
}

.acct-select-rich:focus {
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

#ticketMessage {
  resize: vertical;
}

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

.acct-inline input {
  flex: 1;
}

.acct-connected {
  font-size: 14px;
  color: var(--accent-emerald);
}

.acct-muted {
  margin-bottom: 12px;
}

.acct-inline-link {
  text-decoration: none;
}

.acct-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.acct-ticket-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg-card-hover);
  max-height: 260px;
  overflow: auto;
}

.acct-ticket-list li {
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
}

.acct-ticket-list li:last-child {
  border-bottom: none;
}

.acct-ticket-subject {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.acct-ticket-title {
  font-weight: 600;
}

.acct-ticket-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.acct-ticket-status {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(59,130,246,0.18);
  color: var(--accent-blue);
  white-space: nowrap;
}

.acct-ticket-empty {
  font-size: 13px;
  color: var(--text-muted);
}

.acct-ticket-open {
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
}

.acct-ticket-open:hover {
  border-color: rgba(59,130,246,0.34);
  color: var(--accent-cyan);
}

.acct-ticket-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.acct-ticket-thread {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg-card-hover);
  max-height: 300px;
  overflow: auto;
}

.acct-ticket-thread li {
  border-bottom: 1px solid var(--border-light);
  padding: 12px;
}

.acct-ticket-thread li:last-child {
  border-bottom: none;
}

.acct-ticket-msg-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.acct-ticket-msg-body {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.acct-muted--success {
  color: var(--accent-emerald);
}

.acct-muted--error {
  color: var(--accent-rose);
}

.btn-gradient,
.btn-secondary-light,
.btn-danger,
.acct-logout-btn {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
}

.btn-gradient {
  border: none;
  background: var(--gradient-accent);
  color: #fff;
}

.btn-secondary-light,
.acct-logout-btn {
  border: 1px solid var(--border-light);
  background: var(--bg-card-hover);
  color: var(--text-secondary);
}

.acct-logout-btn:hover {
  border-color: rgba(244,63,94,0.34);
  color: var(--accent-rose);
}

.btn-danger {
  border: 1px solid rgba(244,63,94,0.34);
  background: rgba(244,63,94,0.14);
  color: var(--accent-rose);
}

@media (max-width: 1080px) {
  .acct-layout {
    grid-template-columns: 1fr;
  }

  .acct-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 860px) {
  .acct-main {
    padding: 26px 16px;
  }

  .acct-stats-grid,
  .acct-stats-grid--affiliate,
  .acct-field-grid,
  .acct-card-meta {
    grid-template-columns: 1fr;
  }

  .acct-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links a:not(.nav-cta),
  .nav-links .nav-dropdown,
  .acct-logout-btn {
    display: none;
  }
}
