/* Shared authenticated-site theme. login.php intentionally does not use this file. */
:root,
[data-theme="light"] {
  color-scheme: light;
  --nap-primary: #0065ff;
  --nap-primary-hover: #0054d6;
  --nap-text: #1f2937;
  --nap-muted: #6b7280;
  --nap-border: #e5e7eb;
  --nap-surface: #ffffff;
  --nap-surface-soft: #f8fbff;
  --nap-blue-soft: #eff6ff;
  --nap-radius: 14px;
  --nap-shadow: 0 8px 28px rgba(15, 23, 42, .08);
}

html,
body {
  color-scheme: light !important;
  color: var(--nap-text);
}

body {
  background-color: #eef4fb !important;
}

/* Shared top navigation */
.top-nav {
  background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 52%, #eaf8ff 100%) !important;
  border-color: #dbe7f5 !important;
}

/* Keep the 768px application shell visually consistent */
.container.max-w-\[768px\] {
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 0 34px rgba(15, 23, 42, .10);
}

/* DaisyUI can follow OS dark mode unless explicitly normalized. */
.input,
.select,
.textarea,
.file-input,
.input-bordered,
.select-bordered,
.textarea-bordered,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
select,
textarea {
  background-color: #fff !important;
  color: #1f2937 !important;
  border-color: #d7e0ea !important;
  caret-color: #0065ff;
}

.input::placeholder,
.textarea::placeholder,
input::placeholder,
textarea::placeholder {
  color: #9ca3af !important;
  opacity: 1;
}

.input:focus,
.select:focus,
.textarea:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none !important;
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .14) !important;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: #1f2937 !important;
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  transition: background-color 9999s ease-out 0s;
}

/* Shared surfaces */
.card,
.modal-box,
.dropdown-content,
.menu,
.table,
.collapse,
.stats,
.stat,
.tabs,
.bg-base-100,
.bg-base-200 {
  color: #1f2937;
}

.card,
.modal-box,
.dropdown-content,
.collapse,
.stats,
.stat {
  background-color: #fff !important;
  border-color: var(--nap-border) !important;
}

.modal-box {
  box-shadow: 0 24px 70px rgba(15, 23, 42, .18) !important;
}

/* Tables in admin/history should never inherit a dark DaisyUI surface. */
.table,
table {
  background-color: #fff;
  color: #1f2937;
}

.table :where(th, td),
table :where(th, td) {
  border-color: #edf0f4;
}

.table thead,
table thead {
  background-color: #f8fafc;
  color: #475569;
}

.table tbody tr:hover,
table tbody tr:hover {
  background-color: #f8fbff;
}

/* Shared search blocks */
.admin-search-form .input,
.admin-search-form input,
form input[type="search"] {
  min-height: 44px;
  border-radius: 12px !important;
  background: #fff !important;
  color: #111827 !important;
}

/* Buttons stay readable across pages. */
.btn-primary {
  background-color: var(--nap-primary) !important;
  border-color: var(--nap-primary) !important;
  color: #fff !important;
}

.btn-primary:hover {
  background-color: var(--nap-primary-hover) !important;
  border-color: var(--nap-primary-hover) !important;
}

.btn-ghost {
  color: #475569;
}

/* Common bottom navigation */
.bottom-nav,
.fixed.bottom-0 {
  color-scheme: light;
}

.bottom-nav {
  background: rgba(255, 255, 255, .98) !important;
  border-color: #e5e7eb !important;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, .07);
}

/* Native browser elements */
option {
  background: #fff;
  color: #1f2937;
}

dialog,
.modal,
.modal-backdrop,
[role="dialog"] {
  color-scheme: light;
}

select:disabled,
input:disabled,
textarea:disabled {
  background-color: #f3f4f6 !important;
  color: #6b7280 !important;
  opacity: 1 !important;
}

hr {
  border-color: #e5e7eb;
}

/* SweetAlert is used in several authenticated pages. */
.swal2-popup,
.swal2-title,
.swal2-html-container,
.swal2-input,
.swal2-select,
.swal2-textarea {
  color-scheme: light !important;
}

.swal2-popup {
  background: #fff !important;
  color: #1f2937 !important;
}

.swal2-input,
.swal2-select,
.swal2-textarea {
  background: #fff !important;
  color: #1f2937 !important;
  border-color: #d7e0ea !important;
}

@media (max-width: 640px) {
  .container.max-w-\[768px\] {
    box-shadow: none;
  }
}
