/* MariaDB module — owned by M5. */

.db-card + .db-card { margin-top: 16px; }

.db-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.db-head p { margin-top: 3px; }
.db-meta {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-top: 2px;
}

.db-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(9, 13, 19, 0.35);
}
.db-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 13px;
}
.db-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 9px 12px;
  white-space: nowrap;
}
.db-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.db-table th:last-child { text-align: right; }
.db-table tbody tr:last-child td { border-bottom: 0; }
.db-table tbody tr:hover td { background: rgba(70, 212, 192, 0.035); }
.db-name {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  word-break: break-all;
}
.db-tag { margin-left: 10px; }
.db-size {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.db-empty {
  color: var(--muted);
  text-align: center;
  padding: 30px 12px;
}
.db-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.db-actions .btn { padding: 6px 10px; font-size: 12px; }

.db-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.db-form .field {
  flex: 1 1 170px;
  min-width: 150px;
}
.db-form .input { padding: 8px 10px; }
.db-form .btn { margin-bottom: 1px; }

.db-notice {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 13px;
  margin-bottom: 14px;
}
.db-notice.ok {
  color: var(--ok);
  border-color: rgba(99, 214, 143, 0.35);
  background: rgba(99, 214, 143, 0.07);
}
.db-notice.err {
  color: #ffb3b0;
  border-color: rgba(239, 106, 102, 0.4);
  background: rgba(239, 106, 102, 0.08);
}
.db-notice.warn {
  color: var(--warn);
  border-color: rgba(240, 182, 75, 0.35);
  background: rgba(240, 182, 75, 0.07);
}
.db-notice[hidden] { display: none; }

dialog.modal.db-modal { width: min(560px, 94vw); }
dialog.modal.db-grants-modal { width: min(640px, 95vw); }

.db-modal .modal-body h2 { margin-bottom: 2px; }
.db-modal .modal-body .hint { margin-top: -4px; }

.db-password {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.03em;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 13px 14px;
  word-break: break-all;
  user-select: all;
  color: var(--accent);
}

.db-select { padding: 9px 10px; }
.db-checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px 12px;
  padding-top: 2px;
}
.db-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text);
  user-select: none;
}
.db-check input { accent-color: var(--accent); }
.db-label { font-size: 12px; color: var(--muted); }

.db-grants {
  margin: 0;
  padding: 11px 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
  color: var(--muted);
}

.db-modal-status {
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
}
.db-modal-status.ok {
  color: var(--ok);
  border-color: rgba(99, 214, 143, 0.35);
  background: rgba(99, 214, 143, 0.07);
}
.db-modal-status.err {
  color: #ffb3b0;
  border-color: rgba(239, 106, 102, 0.4);
  background: rgba(239, 106, 102, 0.08);
}
.db-modal-status.info {
  color: var(--muted);
  background: var(--bg-soft);
}
.db-modal-status[hidden] { display: none; }

.db-copy-src {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

@media (max-width: 700px) {
  .db-page-head { align-items: stretch; flex-direction: column; gap: 10px; }
  .db-page-head .btn { align-self: flex-start; }
  .db-head { flex-direction: column; gap: 4px; }
  .db-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-actions { justify-content: flex-start; }
  .db-table td, .db-table th { padding: 9px 10px; }
  .db-form .field { flex: 1 1 100%; }
  .db-form .btn { width: 100%; }
}
