/* Admin Panel Styles - Banreservas */

:root {
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --secondary: #0891b2;
  --success: #059669;
  --success-dark: #047857;
  --warning: #d97706;
  --warning-dark: #b45309;
  --error: #dc2626;
  --error-dark: #b91c1c;
  --surface: #f9fafb;
  --surface-alt: #f3f4f6;
  --border: #e5e7eb;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--surface);
  height: 100%;
}

body.admin-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.admin-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 20px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 13px;
  opacity: 0.9;
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* Container */
.admin-container {
  flex: 1;
  display: flex;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  gap: 20px;
  padding: 20px;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-section {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-section:last-child {
  border-bottom: none;
}

.sidebar-section h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.session-item {
  padding: 12px;
  background: var(--surface-alt);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  font-size: 12px;
}

.session-item:hover {
  background: var(--border);
  transform: translateX(4px);
}

.session-item.active {
  background: var(--primary);
  color: white;
  border-left-color: white;
}

.session-id {
  font-family: monospace;
  font-size: 10px;
  opacity: 0.8;
}

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

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: var(--surface-alt);
  border-radius: 4px;
  font-size: 12px;
}

.stat-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

/* Main Content */
.main-content {
  flex: 1;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-content.with-content {
  display: block;
  padding: 24px;
}

/* Control Panel */
.control-panel {
  width: 100%;
  max-width: 600px;
  padding: 24px;
}

.control-panel.hidden {
  display: none;
}

.control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.control-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.btn-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-close:hover {
  background: var(--surface-alt);
  color: var(--text);
}

/* Sections */
.user-data-section,
.actions-section,
.error-message-section {
  margin-bottom: 24px;
}

.user-data-section h3,
.actions-section h3,
.error-message-section h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.user-data-display {
  background: var(--surface-alt);
  border-radius: 6px;
  padding: 12px;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.6;
  max-height: 200px;
  overflow-y: auto;
}

.user-data-display p {
  margin: 4px 0;
  word-break: break-all;
}

.action-group {
  margin-bottom: 16px;
}

.action-group h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.action-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-group h4 {
  width: 100%;
  margin-bottom: 8px;
}

/* Form Elements */
.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  background: white;
  color: var(--text);
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Buttons */
.btn-action,
.btn-primary,
.btn-secondary,
.btn-settings,
.btn-refresh {
  padding: 10px 16px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.btn-action {
  flex: 1;
  min-width: 100px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-login,
.btn-success,
.btn-warning,
.btn-error,
.btn-settings,
.btn-refresh {
  color: white;
}

.btn-login {
  background: var(--primary);
}

.btn-login:hover {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--success);
}

.btn-success:hover {
  background: var(--success-dark);
}

.btn-warning {
  background: var(--warning);
}

.btn-warning:hover {
  background: var(--warning-dark);
}

.btn-error {
  background: var(--error);
}

.btn-error:hover {
  background: var(--error-dark);
}

.btn-settings,
.btn-refresh {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-settings:hover,
.btn-refresh:hover {
  background: rgba(255, 255, 255, 0.3);
}

.btn-action:active,
.btn-primary:active,
.btn-login:active,
.btn-success:active,
.btn-warning:active,
.btn-error:active {
  transform: translateY(0);
}

/* Empty States */
.empty-state {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
}

.empty-state-main {
  text-align: center;
  padding: 60px 20px;
}

.empty-illustration {
  margin-bottom: 20px;
}

.empty-state-main h2 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state-main p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none !important;
}

.modal:not(.hidden) {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 400px;
  max-height: 90vh;
  overflow: auto;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 18px;
  margin: 0;
}

.modal-body {
  padding: 20px;
}

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

.modal-footer button {
  flex: 0 1 auto;
}

/* Responsive */
@media (max-width: 1024px) {
  .admin-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    max-height: 200px;
  }

  .main-content {
    min-height: 400px;
  }
}

@media (max-width: 640px) {
  .header-content {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .admin-container {
    padding: 12px;
    gap: 12px;
  }

  .control-panel {
    padding: 16px;
  }

  .action-group {
    flex-direction: column;
  }

  .btn-action {
    width: 100%;
  }
}
