/* ============================================
   Desert Standards — Dashboard Demo
   ============================================ */

:root {
  --ds-primary: #3D2B1F;
  --ds-primary-light: #4A3728;
  --ds-accent: #D4842A;
  --ds-accent-hover: #BF7424;
  --ds-green: #4A6B35;
  --ds-red: #B43C2D;
  --ds-orange: #C8822A;
  --ds-bg: #F5F2ED;
  --ds-card: #ffffff;
  --ds-text: #3D2B1F;
  --ds-muted: #7A6B5D;
  --ds-border: #E8E2D9;
  --ds-sidebar-w: 240px;
  --ds-topbar-h: 60px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--ds-bg);
  color: var(--ds-text);
  margin: 0;
  overflow-x: hidden;
}

/* ---- SIDEBAR ---- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--ds-sidebar-w);
  height: 100vh;
  background: var(--ds-primary);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  height: 40px;
  width: auto;
}

.sb-name {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1.5px;
  line-height: 1.1;
}

.sb-sub {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--ds-accent);
  letter-spacing: 2.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.04);
}

.sidebar-link.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-left-color: var(--ds-accent);
}

.sidebar-link i {
  width: 20px;
  text-align: center;
  font-size: 0.95rem;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ds-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.user-name {
  display: block;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}

.user-role {
  display: block;
  color: rgba(255,255,255,0.45);
  font-size: 0.7rem;
}

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: var(--ds-sidebar-w);
  min-height: 100vh;
}

/* ---- TOP BAR ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--ds-topbar-h);
  background: var(--ds-card);
  border-bottom: 1px solid var(--ds-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--ds-text);
  cursor: pointer;
}

.topbar-search {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.topbar-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ds-muted);
  font-size: 0.85rem;
}

.topbar-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--ds-border);
  border-radius: 6px;
  font-size: 0.85rem;
  background: var(--ds-bg);
  color: var(--ds-text);
  transition: border-color 0.2s;
}

.topbar-search input:focus {
  outline: none;
  border-color: var(--ds-accent);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.topbar-date {
  color: var(--ds-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.topbar-notifications {
  position: relative;
  cursor: pointer;
  padding: 8px;
  color: var(--ds-muted);
  transition: color 0.2s;
}

.topbar-notifications:hover { color: var(--ds-text); }

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ds-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-back-site {
  background: var(--ds-primary);
  color: #fff !important;
  font-size: 0.8rem;
  white-space: nowrap;
}

.btn-back-site:hover {
  background: var(--ds-primary-light);
}

/* ---- PAGE CONTENT ---- */
.page-content {
  padding: 24px;
}

.page-header {
  margin-bottom: 20px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ds-text);
  margin-bottom: 2px;
}

.page-subtitle {
  color: var(--ds-muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* ---- STAT CARDS ---- */
.stat-card {
  background: var(--ds-card);
  border-radius: 10px;
  border: 1px solid var(--ds-border);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.stat-card:hover {
  box-shadow: 0 4px 16px rgba(61,43,31,0.08);
}

.stat-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--ds-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-change {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 2px;
}

.stat-change.positive { color: var(--ds-green); }
.stat-change.neutral { color: var(--ds-muted); }

/* ---- CARDS ---- */
.dash-card {
  border: 1px solid var(--ds-border);
  border-radius: 10px;
  box-shadow: none;
}

.dash-card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--ds-border);
  padding: 14px 20px;
}

.dash-card .card-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.dash-card .card-body {
  padding: 20px;
}

.dash-card .card-footer {
  background: transparent;
  border-top: 1px solid var(--ds-border);
  padding: 12px 20px;
}

/* ---- FILTER PILLS ---- */
.filter-pills {
  display: flex;
  gap: 4px;
}

.pill {
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--ds-border);
  background: transparent;
  color: var(--ds-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.pill:hover {
  border-color: var(--ds-accent);
  color: var(--ds-accent);
}

.pill.active {
  background: var(--ds-accent);
  border-color: var(--ds-accent);
  color: #fff;
}

/* ---- TABLE ---- */
.table {
  font-size: 0.85rem;
}

.table thead th {
  background: #FAF8F5;
  border-bottom: 1px solid var(--ds-border);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ds-muted);
  padding: 10px 16px;
  white-space: nowrap;
}

.table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  border-bottom: 1px solid #F0ECE6;
}

.table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

.table tbody tr:hover {
  background: #FAF8F5;
}

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

th.sortable:hover {
  color: var(--ds-accent);
}

th.sortable i {
  font-size: 0.6rem;
  margin-left: 4px;
  opacity: 0.5;
}

/* Status badges */
.badge-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-block;
}

.badge-cited {
  background: rgba(180,60,45,0.1);
  color: var(--ds-red);
}

.badge-warning {
  background: rgba(200,130,40,0.1);
  color: var(--ds-orange);
}

.badge-resolved {
  background: rgba(74,107,53,0.1);
  color: var(--ds-green);
}

.badge-repeat {
  background: rgba(180,60,45,0.1);
  color: var(--ds-red);
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 10px;
}

.view-btn {
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--ds-border);
  background: transparent;
  color: var(--ds-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn:hover {
  border-color: var(--ds-accent);
  color: var(--ds-accent);
}

/* ---- BAR CHART ---- */
.bar-row {
  margin-bottom: 14px;
}

.bar-label {
  font-size: 0.8rem;
  color: var(--ds-text);
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.bar-label span {
  color: var(--ds-muted);
  font-size: 0.75rem;
}

.bar-track {
  height: 8px;
  background: #F0ECE6;
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

/* ---- SCHEDULE ---- */
.schedule-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  position: relative;
}

.schedule-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 28px;
  bottom: -10px;
  width: 2px;
  background: var(--ds-border);
}

.schedule-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.schedule-info {
  flex: 1;
}

.schedule-time {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ds-text);
}

.schedule-property {
  font-size: 0.8rem;
  color: var(--ds-muted);
}

.schedule-officer {
  font-size: 0.75rem;
  color: var(--ds-muted);
}

.schedule-status {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ds-green);
}

/* ---- PATROL MAP ---- */
.patrol-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #F0ECE6;
  font-size: 0.85rem;
}

.patrol-stat-label { color: var(--ds-muted); }
.patrol-stat-value { font-weight: 600; }

.officer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.officer-row:not(:last-child) {
  border-bottom: 1px solid #F0ECE6;
}

.officer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.officer-name {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
}

.officer-status {
  display: block;
  font-size: 0.75rem;
  color: var(--ds-muted);
}

.officer-status.active { color: var(--ds-green); }
.officer-status i { font-size: 0.5rem; margin-right: 4px; }

/* ---- PROPERTIES ---- */
.property-card {
  border: 1px solid var(--ds-border);
  border-radius: 10px;
  padding: 24px;
  background: var(--ds-card);
  transition: box-shadow 0.2s;
}

.property-card:hover {
  box-shadow: 0 4px 16px rgba(61,43,31,0.08);
}

.property-card h5 {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}

.property-meta {
  font-size: 0.8rem;
  color: var(--ds-muted);
  margin-bottom: 16px;
}

.property-stats {
  display: flex;
  gap: 16px;
}

.property-stat {
  text-align: center;
  flex: 1;
  padding: 8px;
  background: var(--ds-bg);
  border-radius: 6px;
}

.property-stat-val {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
}

.property-stat-lbl {
  display: block;
  font-size: 0.65rem;
  color: var(--ds-muted);
  text-transform: uppercase;
}

/* ---- REPORTS ---- */
.report-card {
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}

.report-card:hover {
  box-shadow: 0 4px 16px rgba(61,43,31,0.08);
  transform: translateY(-2px);
}

.report-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(212,132,42,0.1);
  color: var(--ds-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto 12px;
}

/* ---- CAMERAS ---- */
.camera-clip {
  border: 1px solid var(--ds-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--ds-card);
  transition: box-shadow 0.2s;
  cursor: pointer;
}

.camera-clip:hover {
  box-shadow: 0 4px 16px rgba(61,43,31,0.08);
}

.camera-thumb {
  height: 160px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.camera-thumb i {
  font-size: 2.5rem;
  color: rgba(255,255,255,0.3);
}

.camera-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
}

.camera-axon {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(212,132,42,0.9);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
}

.camera-meta {
  padding: 12px;
}

.camera-meta h6 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.camera-meta p {
  font-size: 0.75rem;
  color: var(--ds-muted);
  margin: 0;
}

/* ---- MODAL ---- */
.modal-content {
  border: none;
  border-radius: 12px;
}

.modal-header {
  border-bottom: 1px solid var(--ds-border);
  padding: 16px 24px;
}

.modal-body { padding: 24px; }

.modal-footer {
  border-top: 1px solid var(--ds-border);
  padding: 12px 24px;
}

.detail-row {
  display: flex;
  padding: 8px 0;
  border-bottom: 1px solid #F0ECE6;
  font-size: 0.9rem;
}

.detail-label {
  width: 140px;
  color: var(--ds-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.detail-value {
  font-weight: 500;
}

.detail-photo {
  width: 100%;
  height: 200px;
  background: #f0ece6;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ds-muted);
  font-size: 0.85rem;
  margin-top: 16px;
}

.detail-photo i {
  font-size: 2rem;
  margin-right: 10px;
  color: var(--ds-accent);
}

/* ---- NOTIFICATIONS ---- */
.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--ds-border);
}

.notif-item.unread {
  background: rgba(212,132,42,0.03);
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-text {
  font-size: 0.85rem;
  margin-bottom: 2px;
}

.notif-time {
  font-size: 0.75rem;
  color: var(--ds-muted);
}

/* ---- BUTTONS ---- */
.btn-accent {
  background: var(--ds-accent);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.btn-accent:hover {
  background: var(--ds-accent-hover);
  color: #fff;
}

/* ---- DEMO BANNER ---- */
.demo-banner {
  position: fixed;
  bottom: 0;
  left: var(--ds-sidebar-w);
  right: 0;
  background: var(--ds-primary);
  color: rgba(255,255,255,0.85);
  padding: 10px 24px;
  font-size: 0.85rem;
  z-index: 1050;
  display: flex;
  align-items: center;
}

.demo-banner-link {
  color: var(--ds-accent);
  text-decoration: none;
  font-weight: 600;
  margin-left: 8px;
}

.demo-banner-link:hover { text-decoration: underline; color: var(--ds-accent); }

.demo-banner-close {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
}

/* ---- PAGINATION ---- */
.page-link {
  color: var(--ds-text);
  border-color: var(--ds-border);
  font-size: 0.8rem;
}

.page-item.active .page-link {
  background: var(--ds-accent);
  border-color: var(--ds-accent);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .demo-banner {
    left: 0;
  }

  .topbar-date { display: none; }
}

@media (max-width: 576px) {
  .page-content { padding: 16px; }
  .stat-value { font-size: 1.4rem; }
  .topbar-search { display: none; }
}
