/* Tokens Tab Styles - Enhanced Token Management */

.width-200 {
  width: 200px;
}

.full-width {
  width: 100%;
}

/* Toggle Switch Component */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--soft);
  transition: 0.3s;
  border-radius: 24px;
  border: 1px solid var(--muted);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text);
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--acc);
  border-color: var(--acc);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--acc);
}

input:checked + .slider:before {
  transform: translateX(26px);
  background-color: white;
}

/* Token Status Badges */
.token-status {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
}

.token-active {
  background: rgba(46, 204, 113, 0.2);
  color: var(--ok);
  border: 1px solid var(--ok);
}

.token-inactive {
  background: rgba(255, 193, 7, 0.2);
  color: var(--warn);
  border: 1px solid var(--warn);
}

.token-invalid {
  background: rgba(231, 76, 60, 0.2);
  color: var(--bad);
  border: 1px solid var(--bad);
}

/* Token Table Specific Styles */
.token-id {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 0.75rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-id.truncated {
  max-width: 80px;
}

.token-id.full {
  max-width: none;
  white-space: normal;
  word-break: break-all;
}

.device-info {
  font-size: 0.8rem;
  color: var(--muted);
}

.delivery-stats {
  font-size: 0.75rem;
  color: var(--muted);
}

.delivery-success {
  color: var(--ok);
  font-weight: 500;
}

.delivery-failed {
  color: var(--bad);
  font-weight: 500;
}

.last-seen {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Warning Styles */
.admin-warning {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid var(--warn);
  border-radius: 6px;
  padding: 12px;
  margin: 8px 0;
}

/* Cleanup Preview Table */
.cleanup-preview-table {
  max-height: 300px;
  overflow-y: auto;
}

.cleanup-action {
  font-weight: 500;
  color: var(--warn);
}

.cleanup-reason {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

/* Button Variants */
.btn.warn {
  background: var(--warn);
  color: white;
  border: 1px solid var(--warn);
}

.btn.warn:hover {
  background: #e67e22;
  border-color: #e67e22;
}

button.warn {
  background: var(--warn);
  color: white;
  border: 1px solid var(--warn);
}

button.warn:hover {
  background: #e67e22;
  border-color: #e67e22;
}

/* Grid Layout Enhancements */
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

/* Token Health Indicators */
.health-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
}

.health-good {
  background-color: var(--ok);
}

.health-warning {
  background-color: var(--warn);
}

.health-critical {
  background-color: var(--bad);
}

/* Delivery Analytics Charts Placeholder */
.delivery-chart {
  height: 200px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--soft);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-style: italic;
}

/* Enhanced Table Styles for Tokens */
.tokens-table {
  font-size: 0.875rem;
}

.tokens-table th {
  background: rgba(255, 255, 255, 0.02);
  position: sticky;
  top: 0;
  z-index: 1;
}

.tokens-table td {
  vertical-align: top;
  padding: 8px 12px;
}

.tokens-table .actions-column {
  width: 80px;
  text-align: center;
}

.token-action-btn {
  padding: 4px 8px;
  font-size: 0.75rem;
  margin: 0 2px;
}

/* Loading States */
.token-loading {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.token-loading::before {
  content: "🔄 ";
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Empty States */
.tokens-empty {
  text-align: center;
  padding: 40px;
  color: var(--muted);
  font-style: italic;
}

.tokens-empty::before {
  content: "📱 ";
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .token-id {
    max-width: 120px;
  }
  
  .filters .row {
    flex-direction: column;
    gap: 8px;
  }
  
  .filters .row > * {
    width: 100% !important;
  }
}