/* ============================================================
   AKMENŲ ARCHYVAS – Administravimo panelės stilius
   ============================================================ */

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

:root {
  --green: #1D9E75; --green-light: #E1F5EE; --green-dark: #0F6E56;
  --amber: #BA7517; --amber-light: #FAEEDA;
  --red:   #A32D2D; --red-light:   #FCEBEB;
  --blue:  #185FA5; --blue-light:  #E6F1FB;
  --gray-50: #f9f9f8; --gray-100: #f1f0ed; --gray-200: #e2e1dc;
  --gray-400: #9a9890; --gray-600: #6b6960; --gray-900: #1a1a18;
  --border: rgba(0,0,0,.1); --radius: 8px; --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body { height: 100%; font-family: var(--font); color: var(--gray-900); background: var(--gray-100); font-size: 14px; }

/* ── LAYOUT ──────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: white; border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 100; overflow-y: auto; }
.admin-main { margin-left: 220px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar-logo { display: flex; align-items: center; gap: 8px; padding: 18px 16px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--gray-900); }
.sidebar-logo span { font-size: 20px; }
.sidebar-nav { padding: 10px 0; flex: 1; }
.nav-section { padding: 4px 14px; font-size: 10px; font-weight: 600; color: var(--gray-400); letter-spacing: .06em; text-transform: uppercase; margin-top: 10px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 16px; font-size: 13px; color: var(--gray-600); text-decoration: none; cursor: pointer; transition: all .1s; border-left: 3px solid transparent; }
.nav-item:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-item.active { background: var(--green-light); color: var(--green); border-left-color: var(--green); font-weight: 500; }
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.sidebar-footer { padding: 14px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--gray-400); }
.sidebar-footer a { color: var(--blue); text-decoration: none; }

/* ── TOPBAR ──────────────────────────────────────────────── */
.admin-topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: white; border-bottom: 1px solid var(--border); }
.page-title { font-size: 17px; font-weight: 600; }
.topbar-actions { display: flex; gap: 8px; }

/* ── CONTENT ─────────────────────────────────────────────── */
.admin-content { padding: 24px; flex: 1; }

/* ── CARDS / BOXES ───────────────────────────────────────── */
.card { background: white; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 20px; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid var(--gray-200); background: white; color: var(--gray-900); text-decoration: none; transition: background .12s; }
.btn:hover { background: var(--gray-50); }
.btn-primary { background: var(--green); color: white; border-color: var(--green-dark); }
.btn-primary:hover { background: var(--green-dark); }
.btn-danger  { background: var(--red); color: white; border-color: #8b2020; }
.btn-danger:hover { background: #8b2020; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 500; color: var(--gray-600); }
.form-label .req { color: var(--red); }
.form-input, .form-select, .form-textarea {
  padding: 9px 11px; border: 1px solid var(--gray-200); border-radius: var(--radius);
  font-size: 13px; font-family: var(--font); color: var(--gray-900);
  background: white; outline: none; transition: border-color .15s; width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--green); }
.form-textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.form-hint { font-size: 11px; color: var(--gray-400); }

/* ── MAP PICKER ──────────────────────────────────────────── */
#map-picker { height: 280px; border-radius: var(--radius); border: 1px solid var(--gray-200); overflow: hidden; }
.coords-row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.coords-row .form-input { font-family: monospace; }
.coords-hint { font-size: 11px; color: var(--gray-400); }

/* ── PHOTO UPLOAD ────────────────────────────────────────── */
.photo-drop-zone { border: 2px dashed var(--gray-200); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--gray-400); cursor: pointer; transition: border-color .15s; }
.photo-drop-zone:hover, .photo-drop-zone.drag-over { border-color: var(--green); color: var(--green); }
.photo-drop-zone i { font-size: 28px; display: block; margin-bottom: 8px; }
.photo-drop-zone p { font-size: 13px; }
.photo-drop-zone small { font-size: 11px; }
.photo-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.photo-preview-item { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.photo-preview-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.photo-preview-actions { position: absolute; top: 4px; right: 4px; display: flex; gap: 4px; }
.photo-action-btn { width: 24px; height: 24px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; border: none; }
.photo-main-btn { background: rgba(0,0,0,.5); color: white; }
.photo-main-btn.is-main { background: var(--green); }
.photo-del-btn { background: rgba(163,45,45,.8); color: white; }
.photo-caption { font-size: 10px; padding: 3px 6px; background: white; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── SOURCES ─────────────────────────────────────────────── */
.source-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--gray-100); }
.source-row:last-child { border-bottom: none; }
.source-row .form-input { flex: 1; }
.source-del { color: var(--red); background: none; border: none; cursor: pointer; font-size: 16px; padding: 4px; }

/* ── TABLE ───────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 9px 14px; text-align: left; font-size: 11px; font-weight: 600; color: var(--gray-600); border-bottom: 1px solid var(--border); background: var(--gray-50); white-space: nowrap; }
.data-table td { padding: 9px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tr:hover td { background: var(--gray-50); }
.table-thumb { width: 34px; height: 34px; border-radius: 5px; object-fit: cover; background: var(--gray-100); display: flex; align-items: center; justify-content: center; color: var(--gray-400); }
.table-thumb img { width: 34px; height: 34px; border-radius: 5px; object-fit: cover; }

/* ── STATUS PILL ─────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.pill-neaplankyta { background: #f1f0ed; color: #6b6960; }
.pill-rastas      { background: #FAEEDA; color: #BA7517; }
.pill-nufoto      { background: #E1F5EE; color: #0F6E56; }
.pill-nerastas    { background: #FCEBEB; color: #A32D2D; }
.pill-reikia      { background: #EEEDFE; color: #534AB7; }

/* ── ALERTS ──────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: var(--green-light); color: var(--green-dark); border: 1px solid #9FE1CB; }
.alert-error   { background: var(--red-light);   color: var(--red);        border: 1px solid #F7C1C1; }
.alert-info    { background: var(--blue-light);  color: var(--blue);       border: 1px solid #B5D4F4; }

/* ── SEARCH ──────────────────────────────────────────────── */
.table-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.table-search { flex: 1; min-width: 200px; max-width: 360px; padding: 8px 12px 8px 36px; border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: 13px; outline: none; position: relative; }
.table-search:focus { border-color: var(--green); }
.search-wrap { position: relative; flex: 1; max-width: 360px; }
.search-wrap i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: 14px; }

/* ── PAGINATION ──────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; font-size: 12px; color: var(--gray-600); }
.pagination-btns { display: flex; gap: 6px; }
.pg-btn { padding: 5px 10px; border: 1px solid var(--gray-200); border-radius: 6px; cursor: pointer; background: white; font-size: 12px; }
.pg-btn:hover { background: var(--gray-50); }
.pg-btn:disabled { opacity: .4; cursor: default; }

/* ── LOGIN PAGE ──────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--gray-100); }
.login-box { background: white; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px 32px; width: 340px; }
.login-logo { text-align: center; font-size: 28px; margin-bottom: 8px; }
.login-title { text-align: center; font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.login-sub { text-align: center; font-size: 13px; color: var(--gray-400); margin-bottom: 24px; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
}
