/* COBOL Admin — Retro TUI Theme */
/* Inspired by TuiCSS / 80s terminal aesthetic */

@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

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

body {
  font-family: 'VT323', 'Lucida Console', monospace;
  font-size: 18px;
  display: flex;
  min-height: 100vh;
  background: #0000a8;
  color: #fff;
}


/* Sidebar */
nav {
  width: 220px;
  background: #00a8a8;
  color: #000;
  padding: 0;
  flex-shrink: 0;
  border-right: 2px solid #fff;
}

nav h2 {
  font-size: 20px;
  font-weight: normal;
  padding: 8px 12px;
  margin: 0;
  background: #a8a8a8;
  color: #000;
  border-bottom: 2px solid #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
}

nav h2 a {
  color: #000;
  text-decoration: none;
}

nav a {
  display: block;
  color: #000;
  text-decoration: none;
  padding: 4px 12px;
  font-size: 18px;
  text-transform: uppercase;
}

nav a:hover {
  background: #ff0;
  color: #000;
}

/* Main content */
main {
  flex: 1;
  padding: 16px 24px;
  background: #0000a8;
}

h1 {
  color: #ff0;
  margin-bottom: 12px;
  font-weight: normal;
  font-size: 28px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

p {
  color: #a8a8a8;
  line-height: 1.4;
}

a {
  color: #0ff;
}

a:hover {
  color: #ff0;
}

/* Error messages */
.error {
  color: #ff0;
  background: #a80000;
  padding: 8px 12px;
  border: 2px solid #ff0;
}

/* List page toolbar */
.list-toolbar {
  margin-bottom: 12px;
  color: #a8a8a8;
}

.list-toolbar .total {
  margin-left: 16px;
  color: #0ff;
}

/* Per-page selector */
.perpage-selector a {
  padding: 2px 6px;
  text-decoration: none;
  color: #0ff;
}

.perpage-selector a:hover {
  color: #ff0;
}

.perpage-selector .active {
  font-weight: normal;
  padding: 2px 6px;
  color: #ff0;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid #a8a8a8;
}

th {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 2px solid #a8a8a8;
  color: #ff0;
  background: #00008b;
  text-transform: uppercase;
  font-weight: normal;
}

td {
  padding: 0;
  border-bottom: 1px solid #333399;
}

td a {
  display: block;
  padding: 4px 8px;
  color: #fff;
  text-decoration: none;
}

tbody tr:hover {
  background: #000080;
  cursor: pointer;
}

tbody tr:hover td a {
  color: #0ff;
}

/* Reference links (foreign keys) */
td a.ref-link {
  color: #0ff;
  text-decoration: underline;
}

td a.ref-link:hover {
  color: #ff0;
  background: transparent;
}

/* Show page */
.show-table {
  max-width: 600px;
  margin-top: 12px;
}

.show-table th {
  width: 150px;
  color: #0ff;
  font-weight: normal;
  background: transparent;
}

.show-table td {
  padding: 4px 8px;
  word-break: break-word;
}

.show-table td a {
  color: #0ff;
  text-decoration: underline;
  display: inline;
  padding: 0;
}

.show-table td a:hover {
  color: #ff0;
}

/* Back link */
main p a {
  color: #0ff;
}

main p a:hover {
  color: #ff0;
}

/* Show/Edit header */
.show-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.show-header h1 {
  margin-bottom: 4px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 6px 16px;
  background: #00a800;
  color: #000;
  border: 2px outset #a8a8a8;
  text-decoration: none;
  font-family: 'VT323', 'Lucida Console', monospace;
  font-size: 18px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn:hover {
  background: #00ff00;
  color: #000;
}

.btn:active {
  border-style: inset;
}

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

.btn-danger:hover {
  background: #ff0000;
  color: #fff;
}

/* Delete confirmation */
.delete-confirm p {
  margin: 12px 0;
  color: #ff0;
}

/* Edit form */
.edit-form {
  max-width: 600px;
  margin-top: 12px;
}

.form-field {
  margin-bottom: 12px;
}

.form-field label {
  display: block;
  font-size: 16px;
  color: #0ff;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.form-field input {
  width: 100%;
  padding: 6px 8px;
  border: 2px inset #a8a8a8;
  font-family: 'VT323', 'Lucida Console', monospace;
  font-size: 18px;
  background: #000;
  color: #0f0;
}

.form-field input:focus {
  outline: none;
  border-color: #0ff;
  color: #0ff;
}

.form-field input:disabled {
  background: #1a1a2e;
  color: #a8a8a8;
  border-color: #333;
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.form-actions a:not(.btn) {
  color: #0ff;
  text-decoration: none;
}

.form-actions a:not(.btn):hover {
  color: #ff0;
}

/* Pagination */
.pagination {
  margin-top: 12px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.pagination a {
  padding: 4px 10px;
  border: 2px outset #a8a8a8;
  text-decoration: none;
  color: #0ff;
  background: #00008b;
}

.pagination a:hover {
  background: #000080;
  color: #ff0;
}

.pagination .current {
  padding: 4px 10px;
  background: #00a8a8;
  color: #000;
  border: 2px outset #a8a8a8;
}

.pagination .disabled {
  padding: 4px 10px;
  border: 2px solid #333;
  color: #555;
}

.pagination .ellipsis {
  padding: 4px;
  color: #a8a8a8;
}
