/* GooShield Manager — Admin UI styles */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #f5f6fa;
  color: #1d2327;
  line-height: 1.5;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: #1d2327;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
}

.sidebar-brand {
  padding: 20px;
  border-bottom: 1px solid #3c434a;
}

.sidebar-brand h1 {
  font-size: 20px;
  color: #2271b1;
}

.sidebar-brand small {
  color: #8c8f94;
}

.sidebar nav {
  flex: 1;
  padding: 12px 0;
}

.sidebar nav a {
  display: block;
  padding: 10px 20px;
  color: #c3c4c7;
  text-decoration: none;
  transition: background 0.2s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: #2c3338;
  color: #fff;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid #3c434a;
  font-size: 13px;
  color: #8c8f94;
}

.sidebar-footer .logout {
  color: #2271b1;
  margin-left: 8px;
  text-decoration: none;
}

/* Content */
.content {
  flex: 1;
  margin-left: 220px;
  padding: 32px;
  max-width: 1400px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 24px;
}

.actions {
  display: flex;
  gap: 8px;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  padding: 20px;
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #646970;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
}

.text-success { color: #00a32a; }
.text-danger { color: #d63638; }
.text-muted { color: #8c8f94; }

/* Cards */
.card {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 24px;
}

.card h2 {
  font-size: 16px;
  margin-bottom: 16px;
  color: #1d2327;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  overflow: hidden;
}

th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #dcdcde;
  font-size: 14px;
}

th {
  background: #f0f0f1;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #646970;
}

tr:hover {
  background: #f6f7f7;
}

.row-active {
  background: #fff8e5;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-primary { background: #2271b1; color: #fff; }
.badge-active { background: #00a32a; color: #fff; }
.badge-standby { background: #dcdcde; color: #1d2327; }
.badge-disabled { background: #f0f0f1; color: #8c8f94; }
.badge-dead { background: #d63638; color: #fff; }
.badge-success { background: #00a32a; color: #fff; }
.badge-danger { background: #d63638; color: #fff; }

/* Health */
.health-ok { color: #00a32a; font-weight: 600; }
.health-fail { color: #d63638; font-weight: 600; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  background: #fff;
  color: #1d2327;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.btn:hover {
  background: #f0f0f1;
}

.btn-primary {
  background: #2271b1;
  border-color: #2271b1;
  color: #fff;
}

.btn-primary:hover {
  background: #135e96;
}

.btn-danger {
  background: #d63638;
  border-color: #d63638;
  color: #fff;
}

.btn-danger:hover {
  background: #b32d2e;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

.btn-block {
  display: block;
  width: 100%;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-success {
  background: #edfaef;
  border: 1px solid #00a32a;
  color: #005c12;
}

.alert-danger {
  background: #fcf0f1;
  border: 1px solid #d63638;
  color: #8a2424;
}

/* 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-content {
  background: #fff;
  border-radius: 6px;
  padding: 24px 32px;
  width: 520px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin-bottom: 16px;
}

.modal-content label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  margin-top: 12px;
  color: #646970;
}

.modal-content input,
.modal-content select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  font-size: 14px;
}

.modal-content input:focus,
.modal-content select:focus {
  outline: none;
  border-color: #2271b1;
}

.modal-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #dcdcde;
  display: flex;
  gap: 8px;
}

/* Actions cell */
.actions-cell {
  white-space: nowrap;
}

.actions-cell .btn {
  margin: 1px 2px;
}

/* Login page */
.login-page {
  background: #1d2327;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-box {
  background: #fff;
  border-radius: 8px;
  padding: 40px;
  width: 360px;
  max-width: 90vw;
}

.login-box h1 {
  text-align: center;
  margin-bottom: 24px;
  color: #2271b1;
}

.login-box label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  margin-top: 12px;
  color: #646970;
}

.login-box input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  font-size: 14px;
}

.login-box input:focus {
  outline: none;
  border-color: #2271b1;
}

.login-box .btn-block {
  margin-top: 20px;
  padding: 12px;
  font-size: 15px;
}

/* Code */
code {
  background: #f0f0f1;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
}

/* ==========================================================================
   Provider credentials page
   ========================================================================== */
.cred-page { max-width: 900px; }

.cred-intro {
  margin-bottom: 24px;
  padding: 14px 18px;
  background: #eef5fb;
  border: 1px solid #cfe3f4;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: #1a4b78;
}

.cred-intro code {
  background: rgba(255, 255, 255, .75);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.cred-section {
  border: 1px solid #e3e6eb;
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 18px;
  background: #fff;
}

.cred-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #1d2327;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f1;
}

.cred-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}

.cred-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cred-field--full { grid-column: 1 / -1; }

.cred-field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #646970;
}

.cred-field input,
.cred-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e3e6eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #1d2327;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.cred-field input:focus,
.cred-field select:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 3px rgba(34, 113, 177, .15);
}

.cred-field input::placeholder { color: #a7aaad; }

.cred-hint {
  font-size: 12px;
  color: #8c8f94;
  margin-top: 4px;
}

.cred-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid #f0f0f1;
}

.cred-actions .btn { padding: 9px 18px; font-size: 14px; }

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