* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

.root {}

:root {
  --bg: #f6f8fb;
  --text: #111;
  --muted: #333;
  --card: #fff;
  --border: #e2e8f0;
  --input: #cbd5e1;
  --primary: #1f4e7a;
  --primary-hover: #163b5c;
  --thead-bg: #1f4e7a;
  --thead-text: #fff;
  --row-alt: #f9fafb;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --good: #16a34a;
  --bad: #dc2626;
  --warn: #ca8a04;
  --edit: #f59e0b;
  --edit-hover: #d97706
}

.dark {
  --bg: #0f172a;
  --text: #e5e7eb;
  --muted: #cbd5e1;
  --card: #0b1220;
  --border: #1f2937;
  --input: #334155;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --thead-bg: #0b3a6a;
  --thead-text: #e5e7eb;
  --row-alt: #0e1628;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --good: #22c55e;
  --bad: #f87171;
  --warn: #f59e0b;
  --edit: #f59e0b;
  --edit-hover: #d97706
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  background: var(--bg);
  color: var(--text)
}

.brand-bar {
  background: var(--thead-bg);
  color: var(--thead-text);
  padding: 10px 16px;
  font-weight: 800;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  justify-content: center
}

.container {
  max-width: 960px;
  margin: 40px auto;
  padding: 0 16px
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px
}

h1 {
  margin: 0;
  font-size: 24px
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(15, 50, 90, .08)
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px
}

label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--muted);
  position: relative
}

input[type=text],
input[type=search],
input[type=password],
input[type=number] {
  padding: 10px;
  border: 1px solid var(--input);
  background: var(--card);
  color: var(--text);
  border-radius: 6px;
  font-size: 14px;
  width: 100%
}

input[type=text]:focus,
input[type=search]:focus,
input[type=password]:focus,
input[type=number]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 78, 122, .2)
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px
}

button {
  appearance: none;
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer
}

button:hover {
  background: var(--primary-hover)
}

button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 78, 122, .25)
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text)
}

.ghost:hover {
  background: var(--row-alt)
}

.eye {
  position: absolute;
  right: 8px;
  bottom: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: 0 !important;
  color: var(--muted);
  cursor: pointer
}

.eye:hover {
  color: var(--text)
}

.eye svg {
  width: 18px;
  height: 18px
}

label input[type=password] {
  padding-right: 36px
}

#settingsBtn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center
}

#settingsBtn svg {
  width: 20px;
  height: 20px;
  transition: transform .2s ease
}

#settingsBtn:hover svg {
  transform: rotate(20deg)
}

.ghost.edit {
  background: var(--edit);
  border-color: var(--edit);
  color: #111
}

.ghost.edit:hover {
  background: var(--edit-hover)
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.actions-icons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50
}

.modal.show {
  display: flex
}

.modal-box {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  max-width: 700px;
  width: 100%;
  padding: 16px
}

.modal-title {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 8px
}

.modal-message {
  color: var(--muted);
  margin-bottom: 12px
}

.strength {
  font-size: 12px;
  color: var(--muted);
  align-self: flex-start
}

.strength.bad {
  color: var(--bad)
}

.strength.warn {
  color: var(--warn)
}

.strength.good {
  color: var(--good)
}

.modal .grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px
}

@media (max-width:560px) {
  .modal .grid {
    grid-template-columns: 1fr
  }
}

.toolbar {
  margin: 16px 0
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden
}

.table thead th {
  background: var(--thead-bg);
  color: var(--thead-text);
  text-align: left;
  padding: 10px;
  font-weight: 600
}

.table tbody td {
  border-top: 1px solid var(--border);
  padding: 10px
}

.table tbody tr:nth-child(even) {
  background: var(--row-alt)
}

.del {
  background: var(--danger)
}

.del:hover {
  background: var(--danger-hover)
}

#status {
  margin-top: 8px;
  font-size: 13px
}

#status.good {
  color: var(--good)
}

#status.bad {
  color: var(--bad)
}

#status.warn {
  color: var(--warn)
}

#tStatus {
  margin-top: 6px;
  font-size: 12px
}

#tStatus.good {
  color: var(--good)
}

#tStatus.bad {
  color: var(--bad)
}

#tStatus.warn {
  color: var(--warn)
}

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

  .actions {
    flex-wrap: wrap
  }

  .container {
    margin: 16px auto;
    padding: 0 12px
  }

  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch
  }

  .table thead th,
  .table tbody td {
    white-space: nowrap;
    padding: 8px
  }
}

@media (max-width:1024px) {
  .grid {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media (max-width:560px) {
  h1 {
    font-size: 20px
  }
}

.login .container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto
}

.login .header {
  justify-content: center;
  margin-bottom: 16px
}

.login h1 {
  text-align: center;
  color: var(--primary)
}

.login #authForm {
  max-width: 380px;
  width: 100%
}

.login .grid {
  grid-template-columns: 1fr
}

.login input[type=text],
.login input[type=password] {
  padding: 8px
}

.login .toggle {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  text-align: center
}

.login .toggle button {
  background: transparent;
  border: 0;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  font-weight: 600
}

.login .separator {
  margin: 12px 0;
  height: 1px;
  background: var(--border);
  border: 0
}

.login .forgot {
  font-size: 13px;
  text-align: center;
  color: var(--muted)
}

.login .forgot button {
  background: transparent;
  border: 0;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  font-weight: 600;
  text-decoration: underline
}

.login .forgot button:hover {
  color: var(--primary-hover)
}

.login .toggle button {
  text-decoration: underline
}

.login .toggle button:hover {
  color: var(--primary-hover)
}

.brand-bar {
  background: var(--thead-bg);
  color: var(--thead-text);
  padding: 10px 16px;
  font-weight: 800;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  justify-content: center
}