:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #0f3d5e;
  --error: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.login {
  display: grid;
  place-items: center;
}

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: #f3f4f6;
  align-items: start;
}

.card {
  width: min(420px, 92vw);
  background: var(--card);
  padding: 32px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.login-logo {
  display: block;
  width: min(220px, 70%);
  height: auto;
  margin: 0 auto 16px;
}

h1 {
  margin: 0 0 8px 0;
  font-size: 22px;
  letter-spacing: 0.2px;
}

p {
  margin: 0 0 20px 0;
  color: var(--muted);
}

label {
  display: block;
  font-size: 14px;
  margin: 0 0 6px 0;
}

input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  margin: 0 0 16px 0;
  font-size: 14px;
}

input[readonly],
textarea[readonly] {
  background: #f3f4f6;
  color: #4b5563;
}

textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  margin: 0 0 16px 0;
  font-size: 14px;
  resize: vertical;
}

select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  margin: 0 0 16px 0;
  font-size: 14px;
  background: #fff;
}

button {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.btn-small {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
}

.link-button {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  background: #e5e7eb;
  color: #111827;
  text-decoration: none;
  font-size: 13px;
}

.sidebar {
  background: #0b2c44;
  color: #e5e7eb;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  font-weight: 600;
  letter-spacing: 0.3px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  color: #e5e7eb;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.12);
}

.logout {
  margin-top: auto;
}

.secondary {
  background: #e5e7eb;
  color: #111827;
}

.content {
  padding: 28px 40px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 0 0 6px 0;
  font-size: 24px;
}

.panel {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  max-width: 1100px;
}

.panel-row {
  margin-bottom: 16px;
}

.form-back-link {
  margin-top: 12px;
}

.panel-row > label,
.panel-row > .readonly-section > .readonly-title {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 10px;
}

.autocomplete {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  max-height: 280px;
  overflow-y: auto;
  display: none;
  z-index: 5;
}

.autocomplete-list.open {
  display: block;
}

.autocomplete-item {
  padding: 10px 12px;
  cursor: pointer;
}

.autocomplete-item:hover {
  background: #f3f4f6;
}

.ac-main {
  font-size: 14px;
}

.ac-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.selected {
  background: #f8fafc;
}

.selected-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.selected-sub {
  color: #6b7280;
  font-size: 13px;
}

.selected-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-disabled {
  background: #9ca3af;
  cursor: default;
  pointer-events: none;
}

.placeholder {
  padding: 12px;
  border: 1px dashed #cbd5f5;
  border-radius: 10px;
  color: #6b7280;
  background: #f8fafc;
  font-size: 14px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
}

.table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
}

.pagination {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.pagination a,
.pagination span {
  padding: 6px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: #111827;
  background: #f3f4f6;
  font-size: 13px;
}

.pagination .current {
  background: #0f3d5e;
  color: #fff;
}

.msg {
  margin: 0 0 16px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #e8f0f7;
  color: var(--accent);
  font-size: 14px;
}

.msg.error {
  background: #fdecea;
  color: var(--error);
}

.admin-panel {
  border-top: 1px solid #e5e7eb;
  margin-top: 20px;
  padding-top: 20px;
}

.admin-panel h2 {
  margin: 0 0 10px 0;
  font-size: 18px;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    flex-direction: row;
    align-items: center;
  }
  .nav {
    flex-direction: row;
  }
  .logout {
    margin-top: 0;
    margin-left: auto;
  }
  .content {
    padding: 20px;
  }
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.readonly-section {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  background: #fafafa;
  margin-bottom: 12px;
}

.readonly-title {
  font-weight: 600;
  margin-bottom: 12px;
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
