.dashboard h1 {
  font-size: 1.5rem;
}

/* Sub Accounts header */
.sa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.sa-header h1 {
  margin-bottom: 0;
}

/* Sub Accounts layout */
.sa-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.sa-table {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}

.sa-table.card {
  padding: 0;
}

.sa-table .data-table {
  margin: 0;
}

.sa-table .empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1.5rem;
}

/* Grouped prefix sections */
.sa-group {
  border-bottom: 1px solid var(--border);
}

.sa-group:last-child {
  border-bottom: none;
}

.sa-group-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}

.sa-group-header:hover {
  background: var(--primary-light);
}

.group-caret {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.15s;
  width: 12px;
  text-align: center;
}

.sa-group.open .group-caret {
  transform: rotate(90deg);
}

.group-prefix {
  font-weight: 700;
  font-family: monospace;
  font-size: 0.95rem;
  color: var(--primary);
}

.group-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
  margin-right: 0.75rem;
}

.btn-expire-all {
  font-size: 0.65rem;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  border: none;
  background: linear-gradient(180deg, #fca5a5 0%, #ef4444 50%, #dc2626 100%);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  position: relative; top: 0;
  box-shadow: 0 2px 0 #b91c1c, 0 3px 6px rgba(220,38,38,0.25);
  transition: all 0.1s ease;
}

.btn-expire-all:hover {
  top: 1px;
  box-shadow: 0 1px 0 #b91c1c, 0 2px 4px rgba(220,38,38,0.2);
}

.btn-expire-all:active {
  top: 2px;
  box-shadow: 0 0 0 #b91c1c, 0 1px 2px rgba(220,38,38,0.12);
}

.btn-expire-all:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  top: 0;
  box-shadow: 0 2px 0 #b91c1c, 0 3px 6px rgba(220,38,38,0.25);
}

.sa-group-body {
  padding: 0;
}

.sa-group-body .data-table {
  margin: 0;
}

.sa-group-body .data-table th {
  background: var(--surface);
  font-size: 0.7rem;
}

.sa-sidebar {
  width: 320px;
  min-width: 320px;
}

.sa-sidebar .card:last-child {
  margin-bottom: 0;
}

.create-form {
  margin-top: 0.5rem;
}

.create-form .form-group {
  margin-bottom: 0.75rem;
}

.create-form .btn {
  margin-top: 0.5rem;
}

/* Key list in creation result */
.key-list {
  column-count: 1;
}

.key-list .key-item {
  background: var(--primary-light);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
  font-family: monospace;
  font-size: 0.8rem;
  word-break: break-all;
  border: 1px solid #fed7aa;
}

.result-info {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* Quota card */
.quota-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.quota-header .stat-label {
  margin-top: 0;
  font-weight: 700;
  color: #1a1a2e;
}
.quota-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
}
.quota-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}
.quota-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  border-radius: 4px;
  transition: width 0.3s;
}
.quota-fill[style*="100%"] {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}
.quota-reset {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.quota-card {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #ffffff 0%, #fffaf0 50%, #fffbeb 100%);
  border: 1px solid #fde68a;
}

@media (max-width: 900px) {
  .sa-layout {
    flex-direction: column;
  }
  .sa-sidebar {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .form-row {
    flex-direction: column;
  }
}
