:root {
  --navy:    #1A2B5E;
  --navy2:   #243678;
  --gold:    #F5A623;
  --saffron: #E8630A;
  --sky:     #EEF4FF;
  --sky2:    #F8FAFF;
  --white:   #FFFFFF;
  --text:    #1C2B3A;
  --muted:   #607080;
  --border:  #D6E0EE;
  --green:   #1DB96B;
  --red:     #E03030;
  --r8:  8px;
  --r12: 12px;
  --r16: 16px;
  --shadow:  0 4px 24px rgba(26,43,94,0.10);
  --shadow2: 0 8px 40px rgba(26,43,94,0.14);
  --transition: all 0.25s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; color: var(--text); background: var(--sky2); line-height: 1.6; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

.btn { display: inline-block; padding: 12px 26px; border-radius: 50px; font-size: 0.9rem; font-weight: 600; border: none; transition: var(--transition); cursor: pointer; }
.btn-primary { background: var(--saffron); color: var(--white); }
.btn-primary:hover { background: #c95608; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-full { width: 100%; text-align: center; }
.btn-small { padding: 8px 18px; font-size: 0.82rem; }

.logo-icon { width: 42px; height: 42px; background: linear-gradient(135deg, var(--navy), var(--navy2)); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 1.2rem; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 1.05rem; color: var(--navy); }
.logo-sub { font-size: 0.68rem; color: var(--saffron); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }

/* LOGIN */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 20% 20%, rgba(245,166,35,0.12), transparent 40%), radial-gradient(circle at 80% 80%, rgba(26,43,94,0.12), transparent 40%), var(--sky2); padding: 24px; }
.login-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r16); box-shadow: var(--shadow2); padding: 44px 40px; width: 100%; max-width: 400px; }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.login-card h1 { font-family: 'Playfair Display', serif; font-size: 1.7rem; color: var(--navy); margin-bottom: 6px; }
.login-desc { color: var(--muted); font-size: 0.88rem; margin-bottom: 26px; }
.login-form .form-group { margin-bottom: 16px; }
.login-form label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.login-form input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--r8); font-size: 0.92rem; outline: none; transition: var(--transition); }
.login-form input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26,43,94,0.1); }
.login-error { background: #fee2e2; color: #991b1b; border-radius: var(--r8); padding: 10px 14px; font-size: 0.82rem; font-weight: 600; margin-bottom: 14px; }
.login-hint { margin-top: 20px; font-size: 0.76rem; color: var(--muted); background: var(--sky); border-radius: var(--r8); padding: 10px 12px; text-align: center; line-height: 1.5; }
.back-site { display: block; text-align: center; margin-top: 18px; font-size: 0.82rem; color: var(--navy); font-weight: 600; }
.back-site:hover { color: var(--saffron); }

/* DASHBOARD */
.dash-wrap { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex-shrink: 0; background: var(--navy); color: white; display: flex; flex-direction: column; padding: 24px 16px; position: fixed; top: 0; bottom: 0; left: 0; z-index: 200; transition: var(--transition); overflow-y: auto; }
.sidebar-logo { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.sidebar-logo .logo-icon { background: rgba(255,255,255,0.12); }
.sidebar-logo .logo-name { color: white; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sn-link { display: flex; align-items: center; gap: 10px; background: none; border: none; color: rgba(255,255,255,0.75); text-align: left; padding: 12px 14px; border-radius: var(--r8); font-size: 0.9rem; font-weight: 500; transition: var(--transition); }
.sn-link i { width: 16px; text-align: center; }
.sn-link:hover { background: rgba(255,255,255,0.08); color: white; }
.sn-link.active { background: var(--saffron); color: white; font-weight: 600; }
.sidebar-logout { display: flex; align-items: center; gap: 8px; justify-content: center; background: rgba(255,255,255,0.08); border: none; color: white; padding: 12px 14px; border-radius: var(--r8); font-size: 0.88rem; font-weight: 600; transition: var(--transition); }
.sidebar-logout:hover { background: #c02f2f; }

.dash-main { margin-left: 240px; flex: 1; min-width: 0; }
.dash-header { background: white; border-bottom: 1px solid var(--border); padding: 16px 28px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 100; }
.dash-hamburger { display: none; background: none; border: none; font-size: 1.3rem; color: var(--navy); }
.dash-title { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: var(--navy); font-weight: 700; flex: 1; }
.dash-view-site { background: var(--sky); color: var(--navy); padding: 8px 16px; border-radius: 50px; font-size: 0.82rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.dash-view-site:hover { background: var(--navy); color: white; }

.dash-content { padding: 28px; max-width: 1100px; }
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.panel { background: white; border: 1px solid var(--border); border-radius: var(--r16); padding: 24px; margin-bottom: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.panel-head h3 { font-size: 1.05rem; color: var(--navy); font-weight: 700; }
.panel-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.save-confirm { color: var(--green); font-weight: 600; font-size: 0.85rem; display: none; }
.field-hint { font-size: 0.78rem; color: var(--muted); margin-top: 8px; }

.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; margin-bottom: 8px; }
.admin-form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--text); }
.admin-form-grid label.full { grid-column: 1 / -1; }
.admin-form-grid input, .admin-form-grid select, .admin-form-grid textarea {
  padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--r8);
  font-size: 0.88rem; font-weight: 400; color: var(--text); outline: none; transition: var(--transition); font-family: inherit;
}
.admin-form-grid input:focus, .admin-form-grid select:focus, .admin-form-grid textarea:focus { border-color: var(--saffron); box-shadow: 0 0 0 3px rgba(232,99,10,0.1); }

.logo-upload-row { display: flex; align-items: center; gap: 20px; }
.logo-preview { width: 72px; height: 72px; border-radius: 16px; background: var(--sky); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; border: 1.5px solid var(--border); }
.logo-preview i { font-size: 1.5rem; color: var(--muted); }
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }

.item-list { display: flex; flex-direction: column; gap: 16px; }
.item-card { background: var(--sky2); border: 1.5px solid var(--border); border-radius: var(--r16); padding: 20px; }
.item-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin-bottom: 14px; }
.item-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--text); }
.item-fields label.full { grid-column: 1 / -1; }
.item-fields input, .item-fields select, .item-fields textarea {
  padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--r8);
  font-size: 0.88rem; color: var(--text); outline: none; transition: var(--transition); font-family: inherit; background: white;
}
.item-fields input:focus, .item-fields select:focus, .item-fields textarea:focus { border-color: var(--saffron); box-shadow: 0 0 0 3px rgba(232,99,10,0.1); }
.item-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.item-photo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; grid-column: 1 / -1; }
.item-photo-preview { width: 64px; height: 64px; border-radius: 50%; background: var(--sky); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; border: 1.5px solid var(--border); }
.item-photo-preview.square { border-radius: 12px; width: 90px; height: 64px; }
.item-photo-preview i { font-size: 1.2rem; color: var(--muted); }
.item-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.icon-btn { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; font-size: 0.8rem; transition: var(--transition); display: inline-flex; align-items: center; gap: 6px; }
.icon-btn:hover { border-color: var(--navy); background: var(--sky); }
.icon-btn.danger:hover { border-color: var(--red); background: #fee2e2; color: var(--red); }
.upload-status { font-size: 0.76rem; color: var(--muted); }
.upload-status.ok { color: var(--green); }
.upload-status.err { color: var(--red); }

.gallery-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.gallery-admin-item { background: var(--sky2); border: 1.5px solid var(--border); border-radius: var(--r16); padding: 16px; }
.gallery-admin-item .gi-preview { width: 100%; height: 110px; border-radius: var(--r8); background: var(--sky); display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 12px; }
.gallery-admin-item .gi-preview img { width: 100%; height: 100%; object-fit: cover; }
.gallery-admin-item .gi-preview i { font-size: 1.6rem; color: var(--muted); }
.gallery-admin-item input, .gallery-admin-item select { width: 100%; margin-bottom: 8px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: var(--r8); font-size: 0.82rem; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .dash-main { margin-left: 0; }
  .dash-hamburger { display: block; }
  .admin-form-grid, .item-fields { grid-template-columns: 1fr; }
}
