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

:root {
  --surface: rgba(255, 255, 255, 0.8);
  --border: rgba(0, 0, 0, 0.09);
  --border-dark: rgba(0, 0, 0, 0.16);

  --text-primary: #111111;
  --text-secondary: #555555;
  --text-muted: #999999;

  --font-sans: system-ui, sans-serif;
  --font-mono: 'Courier New', monospace;

  --radius: 6px;
}

html {
  font-size: 14px;
}

/* ── Body + background image ──────────────────────────────────────────────── */
body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 16px 80px;
  position: relative;
  overflow-x: hidden;
  color: var(--text-primary);
  font-family: var(--font-sans);

  /* Image directly on body so there's no opacity fight */
  background-color: #c8c8c8;
  background-image: url('/public/assets/unnamed.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Dark tint over the photo so content stays readable */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(200, 200, 200, 0.6);
  z-index: 0;
  pointer-events: none;
}

/* ── App Shell ────────────────────────────────────────────────────────────── */
#app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 820px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.14);
}

/* ── Header ───────────────────────────────────────────────────────────────── */
#header {
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.55);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.header-logo {
  height: 22px;
  width: 22px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--border-dark);
  display: block;
}

.header-name {
  color: var(--text-primary);
  font-weight: 600;
}
.header-sep {
  color: var(--text-muted);
}
.header-page {
  color: var(--text-secondary);
}

/* ── Content ──────────────────────────────────────────────────────────────── */
#content {
  padding: 28px 28px 36px;
}

/* ── Menu List ────────────────────────────────────────────────────────────── */
ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

li {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.5);
  transition:
    border-color 0.12s,
    background 0.12s;
}

li:hover {
  border-color: var(--border-dark);
  background: rgba(255, 255, 255, 0.75);
}

li a {
  display: block;
  padding: 13px 16px;
  color: var(--text-secondary);
  font-size: 13.5px;
  text-decoration: none;
  transition: color 0.12s;
}

li a:hover {
  color: var(--text-primary);
}

/* ── Table ────────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 9px 14px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.02);
}

td {
  padding: 11px 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}
tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}
tbody tr:hover td {
  color: var(--text-primary);
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
form {
  display: flex;
  flex-direction: column;
  max-width: 420px;
}

label {
  display: block;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'] {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-dark);
  color: var(--text-primary);
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  outline: none;
  transition:
    border-color 0.12s,
    background 0.12s;
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type='text']:focus,
input[type='email']:focus,
input[type='password']:focus,
input[type='number']:focus {
  border-color: #aaaaaa;
  background: #fff;
}

input[type='hidden'] {
  display: none;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.12s,
    border-color 0.12s;
  white-space: nowrap;
}

button:hover,
.btn:hover {
  background: rgba(255, 255, 255, 0.95);
}
button:active,
.btn:active {
  background: #eeeeee;
}

button[type='submit'],
.btn-create {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

button[type='submit']:hover,
.btn-create:hover {
  background: #333333;
  border-color: #333333;
}

.btn-create {
  margin-bottom: 16px;
}

.btn-update {
  padding: 4px 10px;
  font-size: 11.5px;
}

.btn-delete {
  padding: 4px 10px;
  font-size: 11.5px;
  color: #cc0000;
  border-color: rgba(204, 0, 0, 0.25);
  background: transparent;
}

.btn-delete:hover {
  background: rgba(204, 0, 0, 0.06);
  border-color: #cc0000;
}

.btn-secondary {
  color: var(--text-secondary);
}

/* ── Inline form in table ─────────────────────────────────────────────────── */
td form {
  display: inline;
  max-width: unset;
  flex-direction: unset;
}

/* ── Result / pre ─────────────────────────────────────────────────────────── */
h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}

pre {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 20px;
}

/* ── Misc ─────────────────────────────────────────────────────────────────── */
a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--text-secondary);
}
td[colspan] {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-dark);
  border-radius: 3px;
}

/* ── Login Card ───────────────────────────────────────────────────────────── */
.login-card {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.14);
}

.login-header {
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  background: rgba(255, 255, 255, 0.55);
}

.login-icon {
  font-size: 28px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1;
}

.login-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-header p {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-card form {
  padding: 24px 28px 28px;
  max-width: unset;
}

.login-card form input[type='text'],
.login-card form input[type='password'] {
  margin-bottom: 16px;
}

.btn-full {
  width: 100%;
  margin-top: 4px;
  padding: 10px 16px;
  font-size: 13px;
}

/* ── Result / Modal Card ──────────────────────────────────────────────────── */
.result-card {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 28px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.result-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 18px;
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-primary);
}

.result-icon--success {
  border-color: rgba(0, 0, 0, 0.12);
  color: #111;
}

.result-icon--error {
  border-color: rgba(204, 0, 0, 0.2);
  color: #cc0000;
  background: rgba(204, 0, 0, 0.04);
}

.result-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.result-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Key-value meta rows */
.result-meta {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  text-align: left;
}

.result-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.result-meta-row:last-child {
  border-bottom: none;
}

.result-meta-row span:first-child {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.result-meta-row span:last-child {
  color: var(--text-primary);
  font-weight: 500;
  text-transform: capitalize;
}

/* Error list */
.result-errors {
  width: 100%;
  text-align: left;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.result-errors li {
  font-size: 12.5px;
  color: #cc0000;
  background: rgba(204, 0, 0, 0.04);
  border: 1px solid rgba(204, 0, 0, 0.15);
  border-radius: var(--radius);
  padding: 8px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.result-errors li::before {
  content: '!';
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Modal Overlay ────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-box {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

@keyframes modal-slide-up {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-primary);
}

.modal-icon--success {
  border-color: rgba(0, 150, 80, 0.2);
  color: #009650;
  background: rgba(0, 150, 80, 0.06);
}

.modal-icon--error {
  border-color: rgba(204, 0, 0, 0.2);
  color: #cc0000;
  background: rgba(204, 0, 0, 0.04);
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.modal-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.modal-meta {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  text-align: left;
}

.modal-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.modal-meta-row:last-child {
  border-bottom: none;
}

.modal-meta-row span:first-child {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.modal-meta-row span:last-child {
  color: var(--text-primary);
  font-weight: 500;
  text-transform: capitalize;
}

.modal-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-icon--warn {
  border-color: rgba(180, 120, 0, 0.2);
  color: #b47800;
  background: rgba(180, 120, 0, 0.05);
}

.modal-icon--neutral {
  border-color: var(--border-dark);
  color: var(--text-muted);
}

.btn-danger {
  background: #cc0000;
  color: #ffffff;
  border-color: #cc0000;
}

.btn-danger:hover {
  background: #aa0000;
  border-color: #aa0000;
}

.form__user-action {
  margin-left: auto;
}

.header-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: unset;
  flex-direction: row;
}

.header-welcome {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.btn-logout {
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(204, 0, 0, 0.35);
  background: transparent;
  color: #cc0000;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.12s,
    border-color 0.12s,
    color 0.12s;
}

.btn-logout:hover {
  background: rgba(204, 0, 0, 0.06);
  border-color: #cc0000;
  color: #aa0000;
}
