:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-2: #f8fbfd;
  --border: #d9e2ec;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #008ecf;
  --accent-2: #006fa3;
  --accent-soft: #e8f5fb;
  --danger: #dc2626;
  --sidebar-muted: #94a3b8;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: white;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: bold;
}

.brand-title {
  font-size: 17px;
  font-weight: bold;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--sidebar-muted);
  margin-top: 2px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.08em;
  color: var(--sidebar-muted);
  text-transform: uppercase;
  padding: 0 8px;
  margin-top: 4px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item,
.subnav-item {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: white;
  background: transparent;
  border: 0;
  border-radius: 12px;
  transition: 0.18s ease;
  margin: 0;
  text-decoration: none;
}

.nav-item {
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
}

.nav-item:hover,
.subnav-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  background: rgba(0, 142, 207, 0.22);
  color: #e0f5ff;
  box-shadow: inset 0 0 0 1px rgba(0, 142, 207, 0.26);
}

.subnav-wrap {
  display: grid;
  gap: 6px;
  margin-left: 10px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.subnav-item {
  padding: 10px 12px;
  font-size: 13px;
  color: #dbeafe;
}

.subnav-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--sidebar-muted);
  font-size: 13px;
  line-height: 1.45;
}

.sidebar-footer button {
  width: 100%;
}

.main-shell {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(244, 247, 251, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-title {
  font-size: 22px;
  font-weight: bold;
  margin: 0;
}

.topbar-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.content {
  padding: 24px;
  display: grid;
  gap: 18px;
  min-width: 0;
}

.photos-page {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.page-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.left-column,
.stack {
  display: grid;
  gap: 18px;
  align-content: start;
}

.map-column {
  min-width: 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.section-subtitle,
.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.meta {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.toolbar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.toolbar-grid.single {
  grid-template-columns: 1fr;
}

.filter-mode-block {
  margin-top: 14px;
}

.filter-mode-label {
  display: block;
  margin-bottom: 8px;
}

.filter-mode-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-mode-side-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.filter-mode-current {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.map-wrap {
  position: sticky;
  top: 96px;
  z-index: 1;
  height: calc(100vh - 130px);
  min-height: 520px;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: white;
  box-shadow: var(--shadow);
}

#map {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

#dropzone {
  margin-top: 10px;
  border: 2px dashed #a7ddf4;
  border-radius: 14px;
  padding: 22px 14px;
  text-align: center;
  background: var(--accent-soft);
  transition: 0.18s ease;
  color: var(--accent-2);
}

.dropzone-clickable {
  cursor: pointer;
}

#dropzone.dragover {
  border-color: var(--accent);
  background: #d8f0fa;
}

button,
input[type="file"],
input[type="text"],
input[type="password"],
select {
  width: 100%;
  margin-top: 10px;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
}

input[type="text"],
input[type="password"],
select {
  border: 1px solid var(--border);
  background: white;
}

button {
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: white;
  font-weight: 600;
}

button.secondary {
  background: #475569;
}

button.light {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}

button.danger {
  background: var(--danger);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

#status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  white-space: pre-line;
}

.photo-list {
  display: grid;
  gap: 10px;
  max-height: 50vh;
  overflow: auto;
  padding-right: 4px;
}

.photo-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  gap: 8px;
  background: #fff;
  transition: 0.18s ease;
}

.photo-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.photo-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.photo-title {
  font-weight: bold;
  font-size: 14px;
}

.photo-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.banner {
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.4;
}

.admin-panel {
  display: grid;
  gap: 18px;
  max-width: 1200px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: white;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

th {
  background: #f8fafc;
  font-size: 13px;
  font-weight: 600;
}

.table-wrap table th:nth-child(1),
.table-wrap table td:nth-child(1) {
  width: 50%;
}

.table-wrap table th:nth-child(2),
.table-wrap table td:nth-child(2) {
  width: 25%;
}

.table-wrap table th:nth-child(3),
.table-wrap table td:nth-child(3) {
  width: 25%;
}

.rights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.rights-box {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: var(--panel-2);
}

.checkbox-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text);
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-actions button {
  width: auto;
  margin-top: 0;
}

.login-card {
  max-width: 520px;
}

.notice-box {
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 18px;
  color: var(--muted);
}

.preview-full-link {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: bold;
}

.page-footer-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0 0;
}

@media (max-width: 1200px) {
  .page-grid {
    grid-template-columns: 1fr;
  }

  .map-wrap {
    position: relative;
    top: 0;
    height: 60vh;
    min-height: 420px;
  }

  .rights-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .topbar {
    position: sticky;
    top: 0;
  }
}

.table-thumb {
  width: 90px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  border: 1px solid #e5e7eb;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 16px;
  width: 320px;
  display: grid;
  gap: 10px;
}

.bulk-actions{display:flex;gap:10px}
	  
	  
	  .edit-photo-map {
  height: 620px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  margin: 0;
}

.edit-photo-map-note {
  margin-top: 10px;
  margin-bottom: 0;
  font-size: 13px;
  color: #6b7280;
} 
	  
.photo-popup {
  min-width: 220px;
  max-width: 260px;
}

.photo-popup-image {
  width: 220px;
  display: block;
  border-radius: 8px;
  margin-bottom: 8px;
}

.photo-popup-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.photo-popup-meta {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 2px;
}

.photo-popup-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.popup-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  box-sizing: border-box;
}

.popup-action-btn-primary {
  background: #2563eb;
  color: #ffffff !important;
}  

.popup-action-btn-secondary {
  background: #10b981;
  color: #ffffff;
}

.popup-action-btn-disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  border-color: #d1d5db;
} 