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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #333;
  padding: 20px;
}

header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

header h1 {
  font-size: 1.6rem;
  color: #1a1a2e;
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dry-badge {
  background: #e74c3c;
  color: #fff;
}

.hidden {
  display: none !important;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: #1a73e8;
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: #1557b0;
}

.btn-success {
  background: #27ae60;
  color: #fff;
}
.btn-success:hover:not(:disabled) {
  background: #1e8449;
}

.btn-secondary {
  background: #95a5a6;
  color: #fff;
}
.btn-secondary:hover {
  background: #7f8c8d;
}

.btn-danger {
  background: #e74c3c;
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: #c0392b;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

th, td {
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

th.sortable:hover {
  background: #2c3e50;
}

.sort-arrow {
  font-size: 0.7rem;
  margin-left: 2px;
}

th {
  background: #1a1a2e;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
}

tr:nth-child(even) {
  background: #f8f9fa;
}

tr:hover {
  background: #eaf0ff;
}

td a {
  color: #1a73e8;
  text-decoration: none;
}
td a:hover {
  text-decoration: underline;
}

.actions {
  display: flex;
  gap: 6px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: 10px;
  padding: 28px 32px;
  width: 90%;
  max-width: 460px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.modal h2 {
  margin-bottom: 18px;
  font-size: 1.25rem;
}

#hotelForm label {
  display: block;
  margin-bottom: 14px;
  font-weight: 500;
  font-size: 0.9rem;
}

#hotelForm input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.95rem;
}

#hotelForm input:focus {
  border-color: #1a73e8;
  outline: none;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.modal-wide {
  max-width: 720px;
}

#templateForm label {
  display: block;
  margin-bottom: 14px;
  font-weight: 500;
  font-size: 0.9rem;
}

#templateForm input,
#templateForm textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.95rem;
  font-family: inherit;
}

#templateForm textarea {
  resize: vertical;
}

#templateForm input:focus,
#templateForm textarea:focus {
  border-color: #1a73e8;
  outline: none;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.hint {
  display: block;
  color: #888;
  font-size: 0.8rem;
  font-weight: 400;
  margin-top: 2px;
}

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

/* Login Screen */
.login-screen {
  position: fixed;
  inset: 0;
  background: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-box {
  background: #fff;
  border-radius: 10px;
  padding: 36px 32px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.login-box h1 {
  font-size: 1.4rem;
  color: #1a1a2e;
  margin-bottom: 4px;
  text-align: center;
}

.login-subtitle {
  font-size: 0.85rem;
  color: #888;
  text-align: center;
  margin-bottom: 20px;
}

#loginForm label {
  display: block;
  margin-bottom: 14px;
  font-weight: 500;
  font-size: 0.9rem;
}

#loginForm input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.95rem;
}

#loginForm input:focus {
  border-color: #1a73e8;
  outline: none;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.btn-block {
  width: 100%;
  margin-top: 6px;
}

.login-error {
  color: #e74c3c;
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 10px;
}

.user-badge {
  background: #1a73e8;
  color: #fff;
  font-size: 0.75rem;
}

.confirm-modal {
  max-width: 380px;
  text-align: center;
}

.confirm-modal p {
  font-size: 1rem;
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  background: #1a1a2e;
  color: #fff;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  max-width: 90vw;
  white-space: pre-line;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.3s ease;
}

.toast.error {
  background: #c0392b;
}

.toast.success {
  background: #27ae60;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 600px) {
  body {
    padding: 12px;
  }
  th, td {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
  .btn {
    padding: 8px 14px;
    font-size: 0.85rem;
  }
}
