* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #0f0f0f;
  color: #e0e0e0;
  min-height: 100vh;
}

.accent { color: #f5a623; }

/* Header */
.header {
  background: #1a1a1a;
  border-bottom: 3px solid #f5a623;
  padding: 15px 30px;
  display: flex;
  align-items: center;
  gap: 15px;
}
.header-logo { height: 50px; }
.header-text h1 { font-size: 22px; color: #fff; }
.header-text .subtitle { font-size: 12px; color: #888; letter-spacing: 1px; text-transform: uppercase; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 15px; }
.header-right .user-email { color: #888; font-size: 13px; }
.header-right .btn-logout {
  padding: 6px 16px;
  background: #333;
  border: 1px solid #555;
  color: #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.header-right .btn-logout:hover { background: #444; }

/* Login */
.login-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
}
.login-box {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 40px;
  width: 380px;
  text-align: center;
}
.login-logo { height: 80px; margin-bottom: 20px; }
.login-box h2 { color: #fff; margin-bottom: 5px; font-size: 20px; }
.login-subtitle { color: #888; font-size: 13px; margin-bottom: 25px; }
.login-box input {
  width: 100%;
  padding: 12px 16px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}
.login-box input:focus { border-color: #f5a623; }
.error-msg { color: #dc3545; font-size: 13px; margin-top: 10px; min-height: 20px; }

/* Buttons */
.btn { padding: 10px 20px; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-primary { background: #f5a623; color: #000; }
.btn-primary:hover { background: #ffb83d; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-secondary { background: #333; color: #ccc; border: 1px solid #555; }
.btn-secondary:hover { background: #444; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #c82333; }
.btn-success { background: #2d8659; color: #fff; }
.btn-success:hover { background: #25724c; }

/* Dashboard */
.dashboard-screen { padding: 0; }
.container { max-width: 1300px; margin: 30px auto; padding: 0 20px; }

/* Release bar */
.release-bar {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 14px 20px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.release-bar .release-info { display: flex; align-items: center; gap: 15px; font-size: 13px; }
.release-bar .release-label { color: #888; text-transform: uppercase; letter-spacing: 1px; font-size: 11px; }
.release-bar .release-version { color: #f5a623; font-weight: 700; }
.release-bar .release-date { color: #666; }

/* Summary */
.summary-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}
.summary-card {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 18px 20px;
}
.summary-card .label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 1px; }
.summary-card .value { font-size: 28px; font-weight: 700; color: #fff; margin-top: 5px; }
.summary-card .value.green { color: #2d8659; }
.summary-card .value.yellow { color: #f5a623; }
.summary-card .value.red { color: #dc3545; }

/* Table */
.table-wrap {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
}
.sites-table {
  width: 100%;
  border-collapse: collapse;
}
.sites-table th {
  background: #252525;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #333;
}
.sites-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #2a2a2a;
  font-size: 14px;
}
.sites-table tbody tr { cursor: pointer; transition: background 0.15s; }
.sites-table tbody tr:hover { background: #252525; }
.sites-table .loading { text-align: center; color: #666; padding: 40px; font-style: italic; cursor: default; }
.sites-table .pending-row { opacity: 0.6; }

/* Status indicators */
.status-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}
.status-dot.healthy { background: #2d8659; box-shadow: 0 0 6px rgba(45,134,89,0.5); }
.status-dot.warning { background: #f5a623; box-shadow: 0 0 6px rgba(245,166,35,0.5); }
.status-dot.error { background: #dc3545; box-shadow: 0 0 6px rgba(220,53,69,0.5); }
.status-dot.offline { background: #666; }
.status-dot.pending_config { background: #6366f1; box-shadow: 0 0 6px rgba(99,102,241,0.5); }

.dns-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}
.dns-badge.ok { background: rgba(45,134,89,0.2); color: #2d8659; }
.dns-badge.fail { background: rgba(220,53,69,0.2); color: #dc3545; }
.dns-badge.na { background: rgba(100,100,100,0.2); color: #888; }

.version-badge { font-family: 'Consolas', monospace; font-size: 12px; color: #888; }
.version-badge.outdated { color: #f5a623; }

.ip-text { font-family: 'Consolas', monospace; font-size: 13px; }
.time-ago { color: #888; font-size: 13px; }
.machine-name { color: #aaa; font-size: 13px; }

/* Modal */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}
.modal-content {
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 12px;
  padding: 30px;
  width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}
.modal-content.modal-wide { width: 700px; }
.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
}
.modal-close:hover { color: #fff; }

/* Modal tabs */
.modal-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid #333;
}
.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  color: #888;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.tab-btn:hover { color: #ccc; }
.tab-btn.active { color: #f5a623; border-bottom-color: #f5a623; }

/* Detail sections */
.detail-section { margin-bottom: 20px; }
.detail-section h3 { color: #f5a623; font-size: 14px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #333; }
.detail-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.detail-row .label { color: #888; }
.detail-row .value { color: #fff; font-weight: 600; }
.detail-row .value.mono { font-family: 'Consolas', monospace; }

.recipients-list { list-style: none; }
.recipients-list li { padding: 4px 0; font-size: 13px; color: #aaa; }
.recipients-list li::before { content: "\2709  "; }

/* Config form in modal */
.config-form { }
.config-form .form-section { margin-bottom: 18px; }
.config-form .form-section h4 {
  color: #f5a623;
  font-size: 13px;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #333;
}
.config-form .form-row { display: flex; gap: 12px; margin-bottom: 10px; }
.config-form .form-field { flex: 1; }
.config-form .form-field label { display: block; font-size: 12px; color: #888; margin-bottom: 4px; }
.config-form .form-field input,
.config-form .form-field select {
  width: 100%;
  padding: 8px 12px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 5px;
  color: #fff;
  font-size: 13px;
  outline: none;
}
.config-form .form-field input:focus { border-color: #f5a623; }
.config-form .form-actions { display: flex; gap: 10px; margin-top: 15px; }
.config-form .form-hint { font-size: 11px; color: #666; margin-top: 3px; }
.config-form .status-msg { font-size: 13px; margin-top: 10px; min-height: 20px; }
.config-form .status-msg.ok { color: #2d8659; }
.config-form .status-msg.err { color: #dc3545; }

/* Recipient tags */
.recipient-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.recipient-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #333;
  border-radius: 14px;
  font-size: 12px;
  color: #ccc;
}
.recipient-tag .remove-tag {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.recipient-tag .remove-tag:hover { color: #dc3545; }
.recipient-tag.permanent { background: rgba(245,166,35,0.15); color: #f5a623; }

/* Release modal */
.release-form .form-field { margin-bottom: 12px; }
.release-form .form-field label { display: block; font-size: 12px; color: #888; margin-bottom: 4px; }
.release-form .form-field input {
  width: 100%;
  padding: 8px 12px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 5px;
  color: #fff;
  font-size: 13px;
  outline: none;
}
.release-form .form-field input:focus { border-color: #f5a623; }

/* File input */
.file-input {
  width: 100%;
  padding: 8px 12px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 5px;
  color: #ccc;
  font-size: 13px;
  cursor: pointer;
}
.file-input::file-selector-button {
  background: #444;
  border: none;
  color: #fff;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 10px;
}
.file-input::file-selector-button:hover { background: #555; }

/* Upload progress bar */
#rel-upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
}
.progress-bar-wrap {
  flex: 1;
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: #f5a623;
  border-radius: 4px;
  transition: width 0.3s;
}
.progress-text { font-size: 12px; color: #888; min-width: 35px; }

/* Gear / settings button */
.btn-icon {
  background: none;
  border: 1px solid #444;
  color: #ccc;
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.btn-icon:hover { background: #333; color: #f5a623; }

/* Credentials table */
.cred-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cred-table th { text-align: left; padding: 6px 10px; color: #888; font-weight: 600; border-bottom: 1px solid #333; font-size: 11px; text-transform: uppercase; }
.cred-table td { padding: 8px 10px; border-bottom: 1px solid #2a2a2a; color: #ccc; }

/* Config dropdown select */
.config-form select {
  width: 100%;
  padding: 8px 12px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 5px;
  color: #fff;
  font-size: 13px;
  outline: none;
  appearance: auto;
}
.config-form select:focus { border-color: #f5a623; }

/* ---- Responsive / mobile ---- */
.mobile-only { display: none; }
.desktop-only { display: block; }

.sites-cards {
  display: none;
  flex-direction: column;
  gap: 10px;
}
.site-card {
  display: block;
  width: 100%;
  text-align: left;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 14px;
  color: inherit;
  cursor: pointer;
  font: inherit;
}
.site-card:hover, .site-card:active { border-color: #f5a623; background: #252525; }
.site-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.site-card-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 15px;
}
.site-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #aaa;
  margin-top: 4px;
}
.site-card-meta.muted { color: #666; }

@media (max-width: 900px) {
  .header {
    padding: 12px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .header-logo { height: 36px; }
  .header-text h1 { font-size: 18px; }
  .header-text .subtitle { font-size: 10px; }
  .header-right {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
  }
  .header-right .user-email {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }

  .container { margin: 16px auto; padding: 0 12px; }

  .login-box {
    width: calc(100% - 24px);
    max-width: 380px;
    padding: 28px 20px;
  }
  .login-logo { height: 64px; }

  .summary-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }
  .summary-card { padding: 14px; }
  .summary-card .value { font-size: 22px; }

  .release-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 14px;
  }
  .release-bar .release-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .release-bar .btn { width: 100%; }

  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }
  .sites-cards.mobile-only { display: flex !important; }

  .modal {
    align-items: flex-end;
    padding: 0;
  }
  .modal-content,
  .modal-content.modal-wide {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    padding: 20px 16px 28px;
    margin: 0;
  }
  .modal-tabs { overflow-x: auto; }
  .tab-btn { padding: 10px 14px; white-space: nowrap; }

  .detail-row {
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
  }
  .config-form .form-row {
    flex-direction: column;
    gap: 10px;
  }
  .config-form .form-actions {
    flex-direction: column;
  }
  .config-form .form-actions .btn { width: 100%; }

  .cred-table { font-size: 12px; }
  .cred-table th, .cred-table td { padding: 6px 4px; }
}

@media (max-width: 480px) {
  .summary-bar { grid-template-columns: 1fr 1fr; }
  .header-text .subtitle { display: none; }
  .btn-sm { padding: 8px 12px; }
}
