/* =====================================================
   Vishwakarma GNG — Admin panel styling
   Reuses the main site palette (navy + amber)
   ===================================================== */
:root {
  --navy:      #0D1B2A;
  --navy-mid:  #1B2B3D;
  --navy-light:#253B52;
  --amber:     #F5A623;
  --amber-dark:#D4891A;
  --green:     #27AE60;
  --red:       #E74C3C;
  --white:     #FFFFFF;
  --off-white: #F8F5F0;
  --grey-light:#F0EDE8;
  --grey-mid:  #BDB5AA;
  --text:      #1C1510;
  --radius:    12px;
  --font-head: 'Archivo Black', sans-serif;
  --font-body: 'Hind', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--off-white);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--amber-dark); text-decoration: none; }

/* ---------- LOGIN ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  padding: 24px;
}
.login-card {
  background: var(--white);
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,0.35);
  padding: 40px 32px;
}
.login-brand {
  text-align: center;
  margin-bottom: 28px;
}
.login-brand .logo-icon { font-size: 2.4rem; color: var(--amber); }
.login-brand h1 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  color: var(--navy);
  margin-top: 8px;
  letter-spacing: 0.04em;
}
.login-brand p { color: var(--grey-mid); font-size: 0.85rem; margin-top: 4px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--navy-mid);
}
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--grey-light);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}
.field input:focus { outline: none; border-color: var(--amber); }

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--amber);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn-primary:hover { background: var(--amber-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.error-box {
  display: none;
  background: rgba(231,76,60,0.1);
  color: var(--red);
  border: 1px solid rgba(231,76,60,0.3);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.back-link { display: block; text-align: center; margin-top: 18px; font-size: 0.82rem; }

/* ---------- GALLERY ---------- */
.admin-header {
  background: var(--navy);
  color: var(--white);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-header .brand {
  font-family: var(--font-head);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}
.admin-header .brand .logo-icon { color: var(--amber); margin-right: 6px; }
.admin-header .right { display: flex; align-items: center; gap: 16px; }
.admin-header .whoami { font-size: 0.82rem; color: var(--grey-mid); }
.btn-logout {
  background: transparent;
  border: 1.5px solid var(--amber);
  color: var(--amber);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.btn-logout:hover { background: var(--amber); color: var(--navy); }

.admin-main { max-width: 1100px; margin: 0 auto; padding: 32px 24px 64px; }
.admin-main h2 {
  font-family: var(--font-head);
  font-size: 1.4rem;
  color: var(--navy);
  margin-bottom: 6px;
}
.admin-main .subtitle { color: var(--grey-mid); margin-bottom: 24px; font-size: 0.9rem; }

.status-bar {
  display: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.status-bar.success { background: rgba(39,174,96,0.12); color: var(--green); border: 1px solid rgba(39,174,96,0.3); }
.status-bar.error   { background: rgba(231,76,60,0.1); color: var(--red); border: 1px solid rgba(231,76,60,0.3); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.tile {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(13,27,42,0.08);
  display: flex;
  flex-direction: column;
}
.tile-preview {
  height: 170px;
  background: var(--navy-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile-preview img { width: 100%; height: 100%; object-fit: cover; }
.tile-noimg { color: var(--grey-mid); font-size: 0.85rem; }
.tile.empty .tile-preview { background: repeating-linear-gradient(45deg, #eee, #eee 10px, #f6f6f6 10px, #f6f6f6 20px); }

.tile-meta { padding: 14px 16px 8px; }
.tile-meta h3 { font-size: 1rem; color: var(--navy); }
.tile-cat {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber-dark);
  background: rgba(245,166,35,0.12);
  padding: 2px 8px;
  border-radius: 20px;
}
.tile-controls {
  padding: 12px 16px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}
.tile-controls input[type=file] { font-size: 0.72rem; flex: 1; min-width: 0; }
.btn-upload {
  background: var(--amber);
  color: var(--navy);
  border: none;
  padding: 8px 12px;
  border-radius: 7px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-upload:hover { background: var(--amber-dark); }
.btn-upload:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-delete {
  background: transparent;
  border: 1.5px solid var(--red);
  color: var(--red);
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.btn-delete:hover { background: var(--red); color: var(--white); }

/* ---------- ADMIN TABS ---------- */
.admin-tabs {
  display: flex;
  gap: 6px;
  background: var(--navy-mid);
  padding: 0 28px;
}
.admin-tab {
  color: var(--grey-mid);
  padding: 14px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
}
.admin-tab:hover { color: var(--white); }
.admin-tab.active { color: var(--amber); border-bottom-color: var(--amber); }

/* ---------- GALLERY MANAGER (galleries.html) ---------- */
.gal-block {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  margin-bottom: 22px;
  box-shadow: 0 4px 16px rgba(13,27,42,0.06);
}
.gal-block-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.gal-block-head h3 { font-size: 1.1rem; color: var(--navy); }
.gal-count {
  font-size: 0.72rem;
  color: var(--amber-dark);
  background: rgba(245,166,35,0.12);
  padding: 2px 10px;
  border-radius: 20px;
}
.gal-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.gal-empty { color: var(--grey-mid); font-style: italic; font-size: 0.88rem; }
.gal-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--navy-light);
  border: 1px solid var(--grey-light);
}
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gal-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(231,76,60,0.92);
  color: #fff;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gal-del:hover { background: var(--red); }
.gal-add { display: flex; align-items: center; gap: 10px; border-top: 1px dashed var(--grey-light); padding-top: 14px; }
.gal-add input[type=file] { font-size: 0.78rem; flex: 1; min-width: 0; }
