/* ==========================================================================
   The Distinguished Fool - V6
   Retro-styled CSS preserving the original ~2001-era site aesthetic.
   ========================================================================== */

/* ---------- Reset and Base ---------- */

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

body {
  background-color: #ffffff;
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 11px;
  color: #000000;
}

a {
  color: #0000cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:visited {
  color: #551a8b;
}

/* ---------- Container ---------- */

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px;
}

/* ---------- Header ---------- */

.header {
  text-align: center;
  padding: 10px 0;
  border-bottom: 1px solid #cccccc;
  margin-bottom: 4px;
}

.header-title {
  padding: 4px 0;
}

.header-logo {
  max-height: 60px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.header-subtitle {
  font-size: 10px;
  color: #666666;
  margin-top: 2px;
}

/* ---------- Navigation Bar ---------- */

.navbar {
  text-align: center;
  padding: 6px 0;
  border-bottom: 1px solid #cccccc;
  margin-bottom: 10px;
  font-size: 11px;
}

.navbar a {
  color: #0000cc;
  text-decoration: none;
  padding: 0 4px;
}

.navbar a:hover {
  text-decoration: underline;
}

.navbar a.active {
  font-weight: bold;
  color: #000000;
}

.nav-sep {
  color: #999999;
  font-size: 10px;
}

/* ---------- Flash Messages ---------- */

.flash-messages {
  margin: 8px 0;
}

.flash {
  padding: 6px 10px;
  margin-bottom: 6px;
  border: 1px solid;
  font-size: 11px;
}

.flash-success {
  color: #155724;
  background-color: #d4edda;
  border-color: #28a745;
}

.flash-error {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #dc3545;
}

.flash-info {
  color: #004085;
  background-color: #cce5ff;
  border-color: #0d6efd;
}

.flash-warning {
  color: #856404;
  background-color: #fff3cd;
  border-color: #ffc107;
}

/* ---------- Content ---------- */

.content {
  padding: 10px 0;
  min-height: 300px;
}

/* ---------- Footer ---------- */

.footer {
  text-align: center;
  padding: 8px 0;
  margin-top: 20px;
  border-top: 1px solid #cccccc;
  font-size: 10px;
  color: #999999;
}

/* ---------- Forms ---------- */

.form-section {
  margin-bottom: 20px;
}

.form-section h2 {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 8px;
  border-bottom: 1px solid #eeeeee;
  padding-bottom: 4px;
}

.form-group {
  margin-bottom: 8px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: bold;
  margin-bottom: 2px;
  color: #333333;
}

.form-group input[type="text"],
.form-group input[type="password"] {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 11px;
  padding: 3px 4px;
  border: 1px solid #999999;
  width: 200px;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
  border-color: #0000cc;
  outline: none;
}

.form-actions {
  margin-top: 10px;
}

.form-actions input[type="submit"],
.form-actions button {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 11px;
  padding: 3px 12px;
  border: 1px solid #999999;
  background-color: #eeeeee;
  cursor: pointer;
}

.form-actions input[type="submit"]:hover,
.form-actions button:hover {
  background-color: #dddddd;
}

/* ---------- Form Errors ---------- */

.field-errors {
  color: #721c24;
  font-size: 10px;
  margin-top: 2px;
}

.field-errors ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ---------- Auth Page Layout ---------- */

.auth-forms {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.auth-forms .form-section {
  flex: 1;
  min-width: 240px;
}

.auth-divider {
  font-size: 10px;
  color: #999999;
  text-align: center;
  margin: 10px 0;
}

/* ---------- Tables ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 11px;
}

table th {
  background-color: #f5f5f5;
  border: 1px solid #cccccc;
  padding: 6px;
  text-align: left;
  font-weight: bold;
}

table td {
  border: 1px solid #eeeeee;
  padding: 6px;
}

table tbody tr:nth-child(even) {
  background-color: #fafafa;
}

table tbody tr:hover {
  background-color: #f0f0f0;
}

.users-table,
.links-table,
.admin-table,
.audit-table {
  width: 100%;
}

.link-date {
  white-space: nowrap;
  font-size: 10px;
}

.link-username,
.user-username,
.admin-username {
  font-weight: bold;
}

/* ── Slack-style message layout ─────────────────────────────────── */

.message-list {
  padding: 8px 0;
}

.message-group {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e8e8e8;
}

.message-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.message-row {
  display: flex;
  align-items: flex-start;
  padding: 2px 12px;
}

.message-row:hover {
  background-color: #f8f8f8;
}

.message-row-first {
  padding-top: 8px;
}

.message-timestamp {
  width: 80px;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  padding-top: 2px;
  font-size: 11px;
  color: #888888;
  line-height: 1.4;
}

a.message-timestamp {
  text-decoration: none;
  color: inherit;
}

a.message-timestamp:hover {
  text-decoration: underline;
}

.timestamp-date {
  font-weight: 600;
  color: #666666;
}

.timestamp-time {
  font-weight: 400;
}

.message-avatar {
  width: 36px;
  min-width: 36px;
  height: 36px;
  margin-right: 10px;
  flex-shrink: 0;
}

.avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
}

.avatar-default {
  width: 36px;
  height: 36px;
}

.message-avatar-spacer {
  width: 36px;
  min-width: 36px;
  margin-right: 10px;
  flex-shrink: 0;
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message-username {
  font-weight: 700;
  font-size: 14px;
  color: #000000;
  text-decoration: none;
}

.message-username:hover {
  text-decoration: underline;
}

.message-username:visited {
  color: #000000;
}

.message-text {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  color: #1a1a1a;
  padding-top: 1px;
}

.message-text a {
  color: #0000cc;
}

.message-image-preview {
  margin-top: 4px;
}

.message-image-preview img {
  max-width: 400px;
  max-height: 300px;
  border-radius: 4px;
  border: 1px solid #dddddd;
}

.message-row-followup .message-timestamp {
  padding-top: 4px;
}

.message-highlight {
  background-color: #fff3cd;
  border-left: 3px solid #ffc107;
  padding-left: 5px;
}

.search-highlight {
  background-color: #fff3cd;
  padding: 1px 2px;
  border-radius: 2px;
}

/* ── End Slack-style message layout ─────────────────────────────── */

.link-url {
  max-width: 500px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-right {
  text-align: right;
}

/* ---------- Sort ---------- */

.sort-link {
  color: inherit;
  text-decoration: none;
}

.sort-link:hover {
  text-decoration: underline;
}

.sort-link.active {
  font-weight: bold;
}

.sort-arrow {
  font-size: 0.8em;
  margin-left: 4px;
}

/* ---------- Pagination ---------- */

.pagination-controls {
  text-align: center;
  margin: 15px 0;
  padding: 10px 0;
}

.btn-pagination,
.btn-pagination-disabled {
  padding: 4px 8px;
  margin: 0 4px;
  font-size: 11px;
  border: 1px solid #999999;
  background-color: #eeeeee;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-pagination {
  color: #0000cc;
}

.btn-pagination:hover {
  background-color: #dddddd;
  text-decoration: underline;
}

.btn-pagination-disabled {
  color: #999999;
  cursor: default;
  background-color: #f5f5f5;
}

.pagination-pages {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 8px;
}

.pagination-page {
  padding: 4px 8px;
  margin: 0;
  font-size: 11px;
  border: 1px solid #999999;
  background-color: #eeeeee;
  color: #0000cc;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  min-width: 24px;
  text-align: center;
}

.pagination-page:hover {
  background-color: #dddddd;
  text-decoration: underline;
}

.pagination-page.current {
  background-color: #000000;
  color: #ffffff;
  font-weight: bold;
  cursor: default;
  border-color: #000000;
}

.pagination-page.current:hover {
  background-color: #000000;
  text-decoration: none;
}

.pagination-ellipsis {
  color: #999999;
  padding: 0 4px;
  font-size: 11px;
}

.pagination-info {
  margin: 0 10px;
  font-size: 11px;
}

/* ---------- Logs ---------- */

.logs-container {
  padding: 10px 0;
}

.logs-controls {
  margin: 10px 0;
  padding: 8px;
  background-color: #f9f9f9;
  border: 1px solid #eeeeee;
}

.logs-info {
  margin-bottom: 8px;
  font-size: 11px;
  color: #666666;
}

.logs-pagination {
  font-size: 11px;
}

.logs-pagination select {
  font-size: 11px;
  padding: 2px 4px;
  border: 1px solid #999999;
}

.inline-form {
  display: inline;
}

.search-link {
  text-align: center;
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #eeeeee;
}

/* ---------- Users/Profiles ---------- */

.users-container,
.profile-container,
.edit-profile-container {
  padding: 10px 0;
}

.users-info,
.links-info,
.admin-info {
  margin-bottom: 10px;
  font-size: 11px;
  color: #666666;
}

.profile-header {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eeeeee;
}

.profile-header h2 {
  margin: 0 0 5px 0;
  font-size: 18px;
}

.profile-content {
  display: flex;
  gap: 20px;
}

.profile-sidebar {
  flex: 0 0 420px;
}

.profile-main {
  flex: 1;
  min-width: 0;
}

.photo-image {
  width: 400px;
  height: 400px;
  object-fit: cover;
  border: 1px solid #cccccc;
  margin-bottom: 10px;
}

.photo-placeholder {
  width: 400px;
  height: 400px;
  background-color: #f5f5f5;
  border: 1px solid #cccccc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999999;
  font-size: 10px;
  text-align: center;
  margin-bottom: 10px;
}

.profile-actions {
  text-align: center;
}

.btn-profile-action {
  display: inline-block;
  padding: 4px 8px;
  margin-top: 5px;
  background-color: #eeeeee;
  border: 1px solid #999999;
  color: #0000cc;
  text-decoration: none;
  font-size: 11px;
  cursor: pointer;
}

.btn-profile-action:hover {
  background-color: #dddddd;
  text-decoration: underline;
}

.profile-section {
  margin-bottom: 15px;
  padding: 10px;
  background-color: #f9f9f9;
  border: 1px solid #eeeeee;
}

.profile-section h3 {
  font-size: 13px;
  margin: 0 0 8px 0;
  border-bottom: 1px solid #eeeeee;
  padding-bottom: 4px;
}

.profile-stats {
  width: 100%;
  border: none;
  margin: 0;
}

.profile-stats tr {
  border: none;
  background: none;
}

.profile-stats td {
  border: none;
  padding: 4px 0;
}

.stat-label {
  font-weight: bold;
  color: #333333;
  width: 50%;
}

.stat-value {
  text-align: right;
  color: #0000cc;
}

.profile-aliases {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eeeeee;
  font-size: 11px;
}

.profile-aliases h3 {
  font-size: 12px;
  margin: 0 0 4px 0;
}

.profile-aliases p {
  color: #666666;
  margin: 0;
}

.profile-links {
  text-align: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eeeeee;
  font-size: 11px;
}

.profile-links a {
  color: #0000cc;
  margin: 0 5px;
}

/* ---------- Search ---------- */

.search-container {
  padding: 10px 0;
}

/* ---------- Search Tabs ---------- */

.search-tabs {
  display: flex;
  border-bottom: 1px solid #cccccc;
  margin-bottom: 0;
}

.search-tab {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 11px;
  padding: 6px 12px;
  border: 1px solid #cccccc;
  border-bottom: none;
  background-color: #f5f5f5;
  cursor: pointer;
  margin-right: 2px;
  margin-bottom: -1px;
}

.search-tab:hover {
  background-color: #eeeeee;
}

.search-tab.active {
  background-color: #ffffff;
  font-weight: bold;
  border-bottom: 1px solid #ffffff;
}

.search-tab-panel {
  display: none;
}

.search-tab-panel.active {
  display: block;
  padding-top: 15px;
}

.typeahead-wrapper {
  position: relative;
  display: inline-block;
}

.typeahead-wrapper .typeahead-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
}

.search-form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
}

.search-form-row .form-group {
  flex: 1;
  min-width: 0;
}

.date-preset-group {
  display: flex;
  gap: 20px;
  margin-bottom: 10px;
  align-items: flex-end;
}

.date-preset-group .form-group {
  flex: 1;
  min-width: 0;
}

input[type="date"].form-input {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 11px;
  padding: 4px;
  border: 1px solid #999999;
}

input[type="date"].form-input:focus {
  border-color: #0000cc;
  outline: none;
}

input[type="date"].form-input:disabled {
  background-color: #e0e0e0;
  color: #999999;
  cursor: not-allowed;
}

select.form-input {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 11px;
  padding: 4px;
  border: 1px solid #999999;
}

select.form-input:focus {
  border-color: #0000cc;
  outline: none;
}

.form-textarea {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 11px;
  padding: 4px;
  border: 1px solid #999999;
  width: 100%;
  max-width: 400px;
}

.form-textarea:focus {
  border-color: #0000cc;
  outline: none;
}

.search-results {
  margin-top: 20px;
}

.search-results h3 {
  font-size: 13px;
  border-bottom: 1px solid #eeeeee;
  padding-bottom: 4px;
}

/* ---------- Search AI Tab ---------- */

.search-tab.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  color: #999999;
}

.search-tab.disabled:hover {
  background-color: #f5f5f5;
}

.btn-ai-search {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 11px;
  padding: 3px 12px;
  border: 1px solid #999999;
  background-color: #eeeeee;
  cursor: pointer;
}

.btn-ai-search:hover {
  background-color: #dddddd;
}

.ai-loading-spinner {
  text-align: center;
  padding: 20px;
  color: #666666;
  font-size: 11px;
}

.ai-error-message {
  border: 1px solid #dc3545;
  background-color: #f8d7da;
  color: #721c24;
  padding: 10px;
  margin-top: 10px;
  font-size: 11px;
}

.ai-results {
  margin-top: 15px;
}

.ai-results h3 {
  font-size: 13px;
  border-bottom: 1px solid #eeeeee;
  padding-bottom: 4px;
}

/* ---------- RAG Answer and Sources ---------- */

.rag-answer {
  font-size: 13px;
  line-height: 1.6;
  color: #1a1a1a;
  padding: 12px;
  background-color: #f9f9f9;
  border: 1px solid #eeeeee;
  margin-bottom: 15px;
  white-space: pre-wrap;
  word-break: break-word;
}

.rag-sources-heading {
  font-size: 12px;
  font-weight: bold;
  color: #333333;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #eeeeee;
}

.rag-source-card {
  display: block;
  padding: 8px 10px;
  margin-bottom: 6px;
  background-color: #ffffff;
  border: 1px solid #cccccc;
  text-decoration: none;
  color: inherit;
  font-size: 11px;
}

.rag-source-card:hover {
  background-color: #f0f0f0;
  border-color: #999999;
  text-decoration: none;
}

.rag-source-card:visited {
  color: inherit;
}

.rag-source-date {
  font-weight: bold;
  color: #0000cc;
}

.rag-source-users {
  color: #666666;
  margin-left: 8px;
}

.rag-source-count {
  color: #999999;
  margin-left: 8px;
}

.form-range {
  width: 200px;
  vertical-align: middle;
}

.log-entry-detail {
  padding: 15px;
  background-color: #f9f9f9;
  border: 1px solid #eeeeee;
  margin: 15px 0;
}

.log-entry-header {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eeeeee;
  font-size: 11px;
}

.log-entry-timestamp {
  color: #666666;
  font-weight: bold;
}

.log-entry-sep {
  color: #999999;
  margin: 0 5px;
}

.log-entry-message {
  margin: 15px 0;
  padding: 10px;
  background-color: #ffffff;
  border: 1px solid #cccccc;
  word-break: break-word;
  line-height: 1.4;
}

.log-entry-metadata {
  margin-top: 10px;
  font-size: 11px;
}

.log-entry-keywords,
.log-entry-swearwords {
  margin: 5px 0;
  padding: 5px;
  background-color: #f5f5f5;
}

.log-entry-actions {
  text-align: center;
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #eeeeee;
}

/* ---------- User Search ---------- */

.user-search-form {
  margin-bottom: 10px;
  position: relative;
}

.user-search-input {
  padding: 4px 8px;
  font-size: 11px;
  font-family: Verdana, sans-serif;
  border: 1px solid #999;
  width: 200px;
}

.btn-search {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid #999999;
  background-color: #eeeeee;
  cursor: pointer;
}

.btn-search:hover {
  background-color: #dddddd;
}

.search-dropdown {
  display: none;
  position: absolute;
  background: #fff;
  border: 1px solid #999;
  width: 200px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
}

.search-dropdown-item {
  padding: 4px 8px;
  font-size: 11px;
  font-family: Verdana, sans-serif;
  cursor: pointer;
}

.search-dropdown-item:hover {
  background: #eeeeee;
}

.search-filter-active {
  font-size: 11px;
  margin-bottom: 8px;
  color: #666;
}

.search-clear-link {
  color: #663399;
  margin-left: 8px;
}

/* ---------- Links ---------- */

.links-container {
  padding: 10px 0;
}

.links-search-bar {
  margin-bottom: 1rem;
}

.links-search-bar input {
  width: 100%;
  max-width: 400px;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-color, #ccc);
  border-radius: 4px;
  font-size: 0.9rem;
}

.links-section-heading {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

/* ---------- Admin ---------- */

.admin-container {
  padding: 10px 0;
}

.admin-stats {
  display: flex;
  gap: 20px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 150px;
  padding: 15px;
  background-color: #f5f5f5;
  border: 1px solid #cccccc;
  text-align: center;
}

.stat-card .stat-label {
  font-size: 11px;
  color: #666666;
  margin-bottom: 5px;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #0000cc;
}

.admin-menu {
  margin-top: 20px;
}

.admin-menu h3 {
  font-size: 13px;
  border-bottom: 1px solid #eeeeee;
  padding-bottom: 4px;
  margin-bottom: 10px;
}

.admin-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-action-link {
  display: block;
  padding: 10px;
  background-color: #f9f9f9;
  border: 1px solid #eeeeee;
  color: inherit;
  text-decoration: none;
}

.admin-action-link:hover {
  background-color: #f0f0f0;
  border-color: #999999;
}

.admin-action-link strong {
  display: block;
  color: #0000cc;
  margin-bottom: 3px;
}

.admin-action-desc {
  font-size: 10px;
  color: #666666;
}

.status-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  background-color: #f5f5f5;
  border: 1px solid #cccccc;
}

.status-badge.admin {
  background-color: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}

.status-badge.disabled {
  background-color: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

.admin-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.btn-admin-action {
  padding: 3px 6px;
  font-size: 10px;
  border: 1px solid #999999;
  background-color: #eeeeee;
  cursor: pointer;
}

.btn-admin-action:hover {
  background-color: #dddddd;
}

.btn-cancel {
  padding: 3px 12px;
  margin-left: 10px;
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 11px;
  border: 1px solid #999999;
  background-color: #eeeeee;
  cursor: pointer;
  color: #0000cc;
  text-decoration: none;
}

.btn-cancel:hover {
  background-color: #dddddd;
  text-decoration: underline;
}

/* Consolidation page */

.suggestion-match {
  font-weight: bold;
}

.suggestion-reason {
  color: #888;
  font-size: 0.9em;
}

.btn-dismiss {
  background-color: #666;
  color: #fff;
}

.btn-dismiss:hover {
  background-color: #888;
}

.manual-link-form {
  margin-top: 1em;
  padding: 1em;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.manual-link-form form {
  display: flex;
  align-items: center;
  gap: 0.5em;
  flex-wrap: wrap;
}

/* ---------- Calendar ---------- */

.calendar-container {
  padding: 10px 0;
}

.calendar-nav {
  text-align: center;
  margin-bottom: 10px;
  font-size: 13px;
}

.calendar-nav-link {
  color: #0000cc;
  text-decoration: none;
  padding: 0 10px;
}

.calendar-nav-link:hover {
  text-decoration: underline;
}

.calendar-nav-title {
  font-weight: bold;
  font-size: 14px;
  padding: 0 10px;
}

.calendar-nav-form {
  display: inline-block;
  vertical-align: middle;
}

.calendar-nav-select {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 11px;
  padding: 2px 4px;
  border: 1px solid #999999;
  margin: 0 2px;
}

.calendar-nav-btn {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid #999999;
  background-color: #eeeeee;
  cursor: pointer;
  margin-left: 4px;
}

.calendar-nav-btn:hover {
  background-color: #dddddd;
}

.calendar-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.calendar-table th {
  background-color: #f5f5f5;
  border: 1px solid #cccccc;
  padding: 6px;
  text-align: center;
  font-weight: bold;
  font-size: 11px;
}

.calendar-day {
  border: 1px solid #cccccc;
  padding: 8px;
  text-align: center;
  vertical-align: top;
  height: 60px;
  font-size: 11px;
}

.calendar-day-empty {
  background-color: #f9f9f9;
}

.calendar-day-active {
  background-color: #ffffff;
}

.calendar-day-active a {
  color: #0000cc;
  font-weight: bold;
  text-decoration: none;
  font-size: 13px;
}

.calendar-day-active a:hover {
  text-decoration: underline;
}

.calendar-day-inactive {
  color: #999999;
  background-color: #f9f9f9;
}

.calendar-count {
  display: block;
  font-size: 10px;
  color: #666666;
  margin-top: 2px;
}

.calendar-back-link {
  text-align: center;
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #eeeeee;
}

/* ---------- Browse Controls ---------- */

.browse-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.browse-controls-left,
.browse-controls-right {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.browse-controls-left label,
.browse-controls-right label {
  font-weight: bold;
  margin-right: 4px;
}

.browse-controls-left input[type="date"] {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 11px;
  padding: 2px 4px;
  border: 1px solid #999999;
}

.btn-date-go {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid #999999;
  background-color: #eeeeee;
  cursor: pointer;
  margin-left: 4px;
}

.btn-date-go:hover {
  background-color: #dddddd;
}

.calendar-link,
.show-all-link {
  margin-left: 10px;
  color: #0000cc;
  text-decoration: none;
}

.calendar-link:hover,
.show-all-link:hover {
  text-decoration: underline;
}

.date-heading {
  font-size: 13px;
  font-weight: bold;
  margin: 8px 0;
  padding: 6px 8px;
  background-color: #f5f5f5;
  border: 1px solid #cccccc;
}

/* ---------- Utility ---------- */

.text-center {
  text-align: center;
}

.text-small {
  font-size: 10px;
}

.text-muted {
  color: #999999;
}

/* ---------- Dark Theme ---------- */

[data-theme="dark"] {
  background-color: #1a1a2e;
  color: #e0e0e0;
}

[data-theme="dark"] a {
  color: #6eb5ff;
}

[data-theme="dark"] a:visited {
  color: #b088f9;
}

[data-theme="dark"] table {
  border-color: #333;
}

[data-theme="dark"] th {
  background-color: #16213e;
  color: #e0e0e0;
}

[data-theme="dark"] td {
  border-color: #333;
}

[data-theme="dark"] .nav-container,
[data-theme="dark"] nav,
[data-theme="dark"] .navbar {
  background-color: #16213e;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background-color: #2a2a4a;
  color: #e0e0e0;
  border-color: #444;
}

[data-theme="dark"] .footer {
  background-color: #16213e;
  color: #888;
}

[data-theme="dark"] .flash-success {
  background-color: #1a3a1a;
  color: #90ee90;
}

[data-theme="dark"] .flash-error {
  background-color: #3a1a1a;
  color: #ff9090;
}

[data-theme="dark"] .search-highlight {
  background-color: #664d03;
  color: #fff3cd;
}

/* ---------- Search Spinner Overlay ---------- */

.search-spinner-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.search-spinner-overlay.active {
  display: flex;
}

.search-spinner-overlay .spinner-content {
  background: #ffffff;
  padding: 20px 30px;
  border-radius: 4px;
  text-align: center;
  font-size: 12px;
  color: #333333;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.search-spinner-overlay .spinner-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #dddddd;
  border-top-color: #333333;
  border-radius: 50%;
  animation: search-spin 0.8s linear infinite;
  margin-bottom: 8px;
}

@keyframes search-spin {
  to { transform: rotate(360deg); }
}
