:root{
  --color-primary: #2f6fed;
  --color-primary-dark: #1f4fc4;
  --color-bg: #f4f6fb;
  --color-surface: #ffffff;
  --color-border: #e2e6ee;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-danger: #dc3545;
  --color-success: #1e8e5a;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
}

body{
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-footer-spacer{
  height: 3.5rem;
  flex-shrink: 0;
}

.site-footer{
  margin-top: auto;
  flex-shrink: 0;
  height: 4rem;
  background: #dfe4ee;
  border-top: 1px solid #cfd6e4;
}

@media (min-width: 576px){
  .container{ max-width: 900px; }
}

/* --- Top bar --- */
.topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 1.5rem;
  margin-bottom: 2rem;
}

.topbar-brand{
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  font-size: 1.1rem;
  white-space: nowrap;
}

@media (max-width: 480px){
  .topbar-brand{
    font-size: 0.95rem;
  }
  .topbar-brand .topbar-brand-sep{
    display: none;
  }
}

.topbar-user{
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.topbar-logout{
  margin: 0;
}

.topbar-logout button,
.topbar-user a{
  color: var(--color-danger);
  text-decoration: none;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.topbar-logout button{
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.topbar-logout button:hover,
.topbar-user a:hover{
  background: var(--color-danger);
  color: #fff;
  text-decoration: none;
}

/* --- Generic page chrome --- */
.jumbotron.centered{
  background: transparent;
  padding-top: 0.5rem;
}

.crumbs{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.4rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.crumbs a{
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 0.1rem 0.3rem;
  margin: 0 -0.3rem;
  border-radius: 4px;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.crumbs a:hover{
  background: rgba(47, 111, 237, 0.08);
  color: var(--color-primary-dark);
  text-decoration: none;
}

.crumb-sep{
  opacity: 0.6;
}

.crumb-current{
  color: var(--color-text);
  font-weight: 600;
}

.page-title{
  font-size: 1.8rem;
  font-weight: 700;
  margin: 1rem 0 1.5rem;
}

/* --- Section cards used to group form fields --- */
.form-section{
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-section h4{
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--color-text);
}

.form-section .form-group{
  margin-bottom: 1rem;
}

.form-section .form-group label{
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 0;
  margin-bottom: 0.35rem;
  display: block;
}

.form-section input.form-control,
.form-section select.form-control{
  max-width: 480px;
}

.form-section textarea.form-control{
  max-width: 700px;
}

.image-upload-slot .form-control{
  max-width: none;
}

/* --- Add place form: required marks, hints, tags, sticky actions --- */
.req{
  color: var(--color-danger);
  font-weight: 700;
}

.field-hint{
  font-size: 0.8rem;
  margin-top: 0.3rem;
  color: var(--color-text-muted);
}

.field-hint:empty{
  display: none;
}

.field-hint.warn{
  color: var(--color-danger);
}

.address-field{
  position: relative;
}

.owner-search-field{
  position: relative;
}

.compact-actions{
  margin-top: 0.25rem;
}

.record-details{
  display: grid;
  grid-template-columns: minmax(9rem, 0.3fr) 1fr;
  gap: 0.55rem 1rem;
  margin: 0;
}

.record-details dt{
  color: var(--color-text-muted);
  font-weight: 600;
}

.record-details dd{
  margin: 0;
  overflow-wrap: anywhere;
}

.history-list{
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-list > li{
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.history-list > li:last-child{
  border-bottom: 0;
}

.history-head{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
}

.history-head span{
  color: var(--text-muted, #6b7280);
  font-size: 0.85rem;
}

.history-changes{
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.history-field{
  color: var(--text-muted, #6b7280);
}

.history-from{
  text-decoration: line-through;
  color: var(--text-muted, #6b7280);
}

.record-history{
  margin: 0;
  padding-left: 1.25rem;
}

.record-history li + li{
  margin-top: 0.45rem;
}

.archive-description{
  margin-top: 1.25rem;
  white-space: pre-wrap;
}

.address-suggestions{
  position: absolute;
  z-index: 20;
  top: calc(100% - 1.15rem);
  left: 5px;
  width: min(480px, calc(100% - 10px));
  max-height: 15rem;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
}

.address-suggestion{
  display: block;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.address-suggestion:last-child{
  border-bottom: 0;
}

.address-suggestion:hover,
.address-suggestion:focus{
  outline: 0;
  background: rgba(47, 111, 237, 0.1);
}

.address-suggestion strong,
.address-suggestion span{
  display: block;
}

.address-suggestion span{
  margin-top: 0.15rem;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.selected-venue{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
  color: var(--color-success);
  font-size: 0.86rem;
}

.selected-venue button{
  margin-left: 0.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-primary-dark);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.geocode-button{
  margin-top: 0.55rem;
}

.form-section .form-control.is-invalid,
.cs-button.is-invalid{
  border-color: var(--color-danger);
}

.tag-input{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  max-width: 700px;
  padding: 0.4rem 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: text;
}

.tag-input:focus-within{
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

.tag-chips{
  display: contents;
}

.tag-chip{
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.3rem 0.15rem 0.6rem;
  background: rgba(47, 111, 237, 0.1);
  color: var(--color-primary-dark);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.tag-chip button{
  border: 0;
  background: transparent;
  color: inherit;
  width: 1.2rem;
  height: 1.2rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
}

.tag-chip button:hover{
  background: rgba(47, 111, 237, 0.2);
}

.tag-field{
  flex: 1;
  min-width: 8rem;
  border: 0;
  outline: none;
  background: transparent;
  padding: 0.2rem 0.25rem;
  font-size: 0.95rem;
}

.form-actions{
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0.75rem 0;
  margin-top: 0.5rem;
  background: linear-gradient(to bottom, rgba(244, 246, 251, 0), var(--color-bg) 30%);
}

.form-actions-msg{
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.form-actions-msg.error{
  color: var(--color-danger);
  font-weight: 600;
}

.form-submit-status{
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.added-banner{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: var(--radius);
}

.added-actions{
  display: flex;
  gap: 0.5rem;
}

.image-upload-slot.dragover{
  border-color: var(--color-primary);
  background: rgba(47, 111, 237, 0.06);
}

/* --- Custom dropdown (replaces native selects in form sections) --- */
.cs-wrap{
  position: relative;
  max-width: 480px;
}

.cs-native{
  display: none !important;
}

.cs-button{
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
  background: var(--color-surface);
}

.cs-button::after{
  content: "";
  border: solid var(--color-text-muted);
  border-width: 0 2px 2px 0;
  padding: 3px;
  margin: -3px 2px 0 0.5rem;
  transform: rotate(45deg);
  flex-shrink: 0;
}

.cs-button.cs-placeholder{
  color: var(--color-text-muted);
}

.cs-list{
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
}

.cs-list[hidden]{
  display: none;
}

.cs-option{
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
}

.cs-option:hover,
.cs-option.active{
  background: rgba(47, 111, 237, 0.08);
  color: var(--color-primary-dark);
}

.cs-option.selected{
  font-weight: 600;
  color: var(--color-primary);
}

.cs-group{
  padding: 0.5rem 0.6rem 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  pointer-events: none;
}

/* --- Dashboard on the home screen --- */
.dashboard-welcome{
  margin-bottom: 2rem;
}

.dashboard-welcome h1{
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.dashboard-welcome p{
  color: var(--color-text-muted);
  margin: 0;
}

.dashboard-categories{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.category-card{
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.category-card-header{
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.category-card-header .icon{
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  background: rgba(47, 111, 237, 0.1);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.category-card-header h5{
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.category-links{
  display: flex;
  flex-direction: column;
}

.category-links a{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.6rem;
  margin: 0 -0.6rem;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--color-border);
  border-radius: 6px;
  transition: background-color 0.12s ease, color 0.12s ease, padding-left 0.12s ease;
}

.category-links a:last-child{
  border-bottom: none;
}

.category-links a:hover{
  background: rgba(47, 111, 237, 0.08);
  color: var(--color-primary-dark);
  text-decoration: none;
  padding-left: 0.85rem;
}

.category-links a:hover i.fa-chevron-right{
  color: var(--color-primary-dark);
}

.category-links a i.fa-chevron-right{
  font-size: 0.7rem;
  color: var(--color-text-muted);
  transition: color 0.12s ease;
}

.category-links a.danger{
  color: var(--color-danger);
}

.category-links a.danger:hover{
  background: rgba(220, 53, 69, 0.08);
  color: var(--color-danger);
}

.category-links a.danger:hover i.fa-chevron-right{
  color: var(--color-danger);
}

/* --- Image upload widgets --- */
.image-upload-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.image-upload-slot{
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem;
  background: #fafbfd;
}

.image-upload-slot .slot-label{
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.image-upload-slot img.slot-preview{
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  background: #eef0f4;
}

.img-upload-input{
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker-row{
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.file-picker{
  display: inline-block;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.3rem 0.7rem;
  border: 1px solid #767676;
  border-radius: 3px;
  background: #f7f7f7;
  color: #111;
  cursor: pointer;
}

.file-picker:hover,
.file-picker:focus{
  background: #e9edf3;
}

.file-name{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.remove-image-button{
  margin-top: 0.45rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-danger);
  font-size: 0.82rem;
  cursor: pointer;
}

.remove-image-button:hover{
  text-decoration: underline;
}

.image-upload-slot .slot-status{
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: block;
  margin-top: 0.35rem;
}

.image-upload-slot .slot-status.success{
  color: var(--color-success);
}

.image-upload-slot .slot-status.error{
  color: var(--color-danger);
}

/* --- Login screen --- */
.login-page{
  min-height: calc(100vh - 2rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-card{
  width: 100%;
  max-width: 380px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.login-card h1{
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.15rem;
}

.login-card .login-subtitle{
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.login-card .form-group{
  margin-bottom: 1rem;
}

.login-card label{
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.login-card button[type="submit"]{
  width: 100%;
}

.login-error{
  margin-top: 1rem;
  color: var(--color-danger);
  text-align: center;
  font-size: 0.9rem;
}

.login-error:empty{
  display: none;
}

/* --- Legacy / secondary pages sharing the header markup --- */
.container .display-3{
  font-size: 1.6rem;
  font-weight: 700;
  margin: 1rem 0 1.25rem;
}


.container input[type="text"]:not(.form-control),
.container input[type="email"]:not(.form-control),
.container input[type="password"]:not(.form-control),
.container input[type="date"]:not(.form-control),
.container input[type="number"]:not(.form-control),
.container textarea:not(.form-control),
.container select:not(.form-control){
  display: block;
  width: 100%;
  max-width: 480px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.95rem;
}

.container input[type="text"]:not(.form-control):focus,
.container input[type="email"]:not(.form-control):focus,
.container input[type="password"]:not(.form-control):focus,
.container input[type="date"]:not(.form-control):focus,
.container input[type="number"]:not(.form-control):focus,
.container textarea:not(.form-control):focus,
.container select:not(.form-control):focus{
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

.container label{
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  display: inline-block;
  margin-top: 0.5rem;
}

.container hr{
  border-color: var(--color-border);
  margin: 1.25rem 0;
}

/* --- Place chooser --- */
.page-heading-row{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-heading-row .page-title{
  margin-bottom: 0.25rem;
}

.page-subtitle{
  margin: 0;
  color: var(--color-text-muted);
}

.place-filters{
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.place-search-wrap{
  position: relative;
  flex: 1 1 270px;
}

.place-search-wrap i{
  position: absolute;
  top: 50%;
  left: 0.8rem;
  color: var(--color-text-muted);
  transform: translateY(-50%);
}

.place-search-wrap .form-control{
  max-width: none;
  padding-left: 2.25rem;
}

.place-filter-selects{
  display: flex;
  flex: 2 1 430px;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.place-filter-selects .form-control{
  width: auto;
  min-width: 165px;
  max-width: 220px;
}

.place-results-meta{
  margin: 1rem 0 0.75rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.place-results{
  display: grid;
  gap: 0.8rem;
}

.place-result-card{
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.place-result-image{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 88px;
  flex: 0 0 104px;
  overflow: hidden;
  border-radius: 8px;
  background: #edf1f7;
  color: #99a4b8;
  font-size: 1.7rem;
}

.place-result-image img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.place-result-title-row{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.place-result-title-row h2{
  margin: 0;
  color: var(--color-text);
  font-size: 1.05rem;
  font-weight: 700;
}

.place-result-address,
.place-result-meta{
  margin: 0.3rem 0 0;
}

.place-result-address{
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.place-result-address i{
  color: var(--color-primary);
}

.event-result-date{
  margin: 0.3rem 0 0;
  color: var(--color-primary-dark);
  font-size: 0.9rem;
  font-weight: 600;
}


.place-result-meta{
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.place-category-badge{
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(47, 111, 237, 0.1);
  color: var(--color-primary-dark);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.place-result-actions{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.place-result-actions form{
  margin: 0;
}

/* --- Content reports (moderation queue) --- */
.report-status-tabs{
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.report-status-tab{
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.report-status-tab span{
  margin-left: 0.3rem;
  opacity: 0.75;
}

.report-status-tab:hover{
  background: rgba(47, 111, 237, 0.1);
  color: var(--color-primary-dark);
  text-decoration: none;
}

.report-status-tab.current{
  background: var(--color-primary);
  color: #fff;
}

.report-status-tab.current span{
  opacity: 0.9;
}

.report-target-type{
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.report-status-badge.report-status-new{
  background: rgba(220, 53, 69, 0.12);
  color: var(--color-danger);
}

.report-status-badge.report-status-in_progress{
  background: rgba(230, 162, 29, 0.15);
  color: #a16207;
}

.report-status-badge.report-status-resolved{
  background: rgba(30, 142, 90, 0.12);
  color: var(--color-success);
}

.report-status-badge.report-status-rejected{
  background: var(--color-bg);
  color: var(--color-text-muted);
}

.report-comment-snapshot{
  margin-top: 0.6rem;
  padding: 0.65rem 0.85rem;
  background: var(--color-bg);
  border-radius: 8px;
  border-left: 3px solid var(--color-border);
}

.report-comment-author{
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.report-comment-text{
  margin: 0.25rem 0 0;
  font-size: 0.92rem;
  color: var(--color-text);
  white-space: pre-wrap;
}

.report-status-form{
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.report-status-form .form-control{
  max-width: 160px;
}

.place-more-actions{
  position: relative;
}

.place-more-actions summary{
  list-style: none;
  padding: 0.31rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 0.2rem;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  cursor: pointer;
}

.place-more-actions summary::-webkit-details-marker{
  display: none;
}

.place-more-actions[open] summary{
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.place-more-actions-menu{
  position: absolute;
  z-index: 30;
  right: 0;
  min-width: 225px;
  padding: 0.35rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.14);
}

.place-more-actions-menu button{
  display: block;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--color-text);
  text-align: left;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.place-more-actions-menu button:hover,
.place-more-actions-menu button:focus{
  outline: 0;
  background: rgba(47, 111, 237, 0.08);
  color: var(--color-primary-dark);
}

.place-pagination{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.place-pagination-pages{
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.place-pagination-pages a,
.place-pagination-pages span{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 5px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.place-pagination-pages a:hover,
.place-pagination-pages a.current{
  background: rgba(47, 111, 237, 0.1);
  color: var(--color-primary-dark);
  font-weight: 700;
}

.empty-state{
  padding: 3rem 1.25rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text-muted);
  text-align: center;
}

.empty-state > i{
  margin-bottom: 0.75rem;
  color: var(--color-primary);
  font-size: 2rem;
}

.empty-state h2{
  color: var(--color-text);
  font-size: 1.1rem;
  font-weight: 700;
}

.delete-record-card{
  max-width: 700px;
  margin: 2rem auto;
}

.delete-record-icon{
  margin: 0 0 0.75rem;
  color: var(--color-danger);
  font-size: 2rem;
}

.delete-record-summary{
  display: grid;
  gap: 0.5rem;
  margin: 1.25rem 0;
  padding: 1rem;
  border-radius: 6px;
  background: rgba(220, 53, 69, 0.06);
}

.delete-record-summary div{
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0.75rem;
}

.delete-record-summary dt{
  color: var(--color-text-muted);
  font-weight: 600;
}

.delete-record-summary dd{
  margin: 0;
  overflow-wrap: anywhere;
}

.delete-record-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.feature-retired-card{
  max-width: 640px;
  margin: 3rem auto;
  text-align: center;
}

.feature-retired-icon{
  margin: 0 0 0.75rem;
  color: var(--color-primary);
  font-size: 2rem;
}

/* --- Analytics dashboard --- */
.analytics-filter .form-group{
  margin: 0;
}

.analytics-filter label{
  display: block;
  margin: 0 0 0.25rem;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.analytics-filter .form-control{
  min-width: 160px;
}

.analytics-metrics{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.analytics-metric-card{
  padding: 1.15rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.analytics-metric-card span,
.analytics-metric-card small{
  display: block;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.analytics-metric-card strong{
  display: block;
  margin: 0.25rem 0;
  color: var(--color-primary-dark);
  font-size: 2rem;
  line-height: 1;
}

.analytics-chart-section h2,
.analytics-top-grid h2,
.analytics-page .form-section > h2{
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.analytics-chart{
  display: flex;
  align-items: end;
  gap: 0.3rem;
  min-height: 210px;
  padding-top: 1rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--color-border);
}

.analytics-bar-wrap{
  position: relative;
  display: flex;
  flex: 1 0 28px;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  min-width: 28px;
  height: 190px;
}

.analytics-bar{
  width: min(28px, 80%);
  height: var(--bar-height);
  min-height: 2px;
  border-radius: 5px 5px 0 0;
  background: var(--color-primary);
  transition: background-color 0.12s ease;
}

.analytics-bar-wrap:hover .analytics-bar{
  background: var(--color-primary-dark);
}

.analytics-bar-value{
  position: absolute;
  bottom: calc(var(--bar-height) + 0.2rem);
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.analytics-bar-label{
  position: absolute;
  bottom: -1.35rem;
  color: var(--color-text-muted);
  font-size: 0.65rem;
  white-space: nowrap;
  transform: rotate(-45deg);
  transform-origin: top left;
}

.analytics-top-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.analytics-top-list{
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: popular;
}

.analytics-top-list li{
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border);
}

.analytics-top-list li::before{
  counter-increment: popular;
  content: counter(popular);
  color: var(--color-text-muted);
  font-weight: 700;
}

.analytics-top-list li span{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-top-list li strong{
  color: var(--color-primary-dark);
}

@media (max-width: 575.98px){
  .page-heading-row{
    flex-direction: column;
  }

  .page-heading-row .btn{
    width: 100%;
  }

  .place-filter-selects{
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .place-filter-selects .form-control,
  .place-filter-selects .btn{
    width: 100%;
    max-width: none;
  }

  .place-result-card{
    gap: 0.75rem;
  }

  .place-result-image{
    width: 58px;
    height: 58px;
    flex-basis: 58px;
  }

  .place-result-title-row{
    display: block;
  }

  .place-category-badge{
    display: inline-block;
    margin-top: 0.45rem;
  }

  .place-result-actions .btn,
  .place-more-actions{
    flex: 1 1 100%;
  }

  .place-result-actions .btn,
  .place-more-actions summary{
    width: 100%;
    text-align: center;
  }

  .place-more-actions-menu{
    right: auto;
    left: 0;
    width: 100%;
  }

  .place-pagination{
    flex-wrap: wrap;
  }

  .delete-record-summary div{
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .analytics-metrics,
  .analytics-top-grid{
    grid-template-columns: 1fr;
  }
}

.comment-filter-bar{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.comment-card[hidden]{
  display: none;
}

.login-notice{
  margin: 1rem 0 0;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: var(--color-surface-alt, #eef4ff);
  color: var(--color-text, #1f2937);
  font-size: 0.9rem;
}

.session-banner{
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 1080;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: #1f2937;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.topbar-user a.topbar-account{
  color: var(--color-text-muted);
  font-weight: 500;
}

.topbar-user a.topbar-account:hover{
  background: var(--color-surface-alt, #eef2f7);
  color: var(--color-text, #1f2937);
}

.qr-code{
  display: block;
  margin: 0.75rem 0;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: #fff;
}

.two-factor-secret{
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}

.two-factor-form{
  max-width: 360px;
  margin-top: 1.25rem;
}

.recovery-codes{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.recovery-codes code{
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: var(--color-surface-alt, #eef2f7);
  font-size: 1rem;
}
