:root {
  --navy:    #0A1628;
  --ocean:   #1E3A5F;
  --gold:    #C9A84C;
  --charcoal:#1A1A2E;
  --success: #1D9E75;
  --error:   #E24B4A;
  --warning: #F59E0B;
  --sidebar-w: 250px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body.admin-body { background: #0d1117; color: #e6edf3; font-family: 'Inter', sans-serif; line-height: 1.6; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ===== SIDEBAR ===== */
.admin-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #161b22;
  border-right: 1px solid rgba(255,255,255,0.06);
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo img { height: 28px; filter: brightness(0) invert(1); }
.sidebar-logo span { font-size: 0.9rem; font-weight: 600; line-height: 1.3; }
.sidebar-logo small { font-size: 0.7rem; color: var(--gold); display: block; font-weight: 400; }
.sidebar-nav { padding: 16px 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; color: rgba(230,237,243,0.65);
  font-size: 0.88rem; transition: all 0.2s;
  position: relative;
}
.sidebar-nav a i { width: 18px; text-align: center; }
.sidebar-nav a:hover { color: #e6edf3; background: rgba(255,255,255,0.04); }
.sidebar-nav a.active { color: var(--gold); background: rgba(201,168,76,0.08); }
.sidebar-nav a.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); }
.sidebar-nav a.logout-link { color: var(--error); margin-top: 12px; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 20px; }
.badge { background: var(--error); color: white; font-size: 0.65rem; padding: 2px 7px; border-radius: 10px; margin-left: auto; font-weight: 600; }

/* ===== MAIN LAYOUT ===== */
.admin-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}
.admin-topbar {
  padding: 20px 32px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between;
  background: #161b22;
  position: sticky; top: 0; z-index: 50;
}
.admin-topbar h1 { font-size: 1.1rem; font-weight: 500; color: #e6edf3; }
.admin-topbar-actions { display: flex; align-items: center; gap: 12px; }
.admin-content { padding: 32px; }

/* ===== STATS CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 16px; margin-bottom: 32px; }
.stat-card {
  background: #161b22;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--gold); }
.stat-card.blue::before { background: #0ea5e9; }
.stat-card.green::before { background: var(--success); }
.stat-card.red::before { background: var(--error); }
.stat-icon { font-size: 1.8rem; margin-bottom: 12px; opacity: 0.7; }
.stat-number { font-size: 2rem; font-weight: 600; color: #e6edf3; line-height: 1; }
.stat-label { font-size: 0.75rem; color: rgba(230,237,243,0.5); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.1em; }

/* ===== ADMIN BUTTONS ===== */
.btn-admin { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 4px; font-size: 0.82rem; font-weight: 500; cursor: pointer; transition: all 0.2s; border: none; }
.btn-admin-primary { background: var(--gold); color: var(--navy); }
.btn-admin-primary:hover { background: #d4b460; }
.btn-admin-secondary { background: rgba(255,255,255,0.06); color: #e6edf3; border: 1px solid rgba(255,255,255,0.1); }
.btn-admin-secondary:hover { background: rgba(255,255,255,0.1); }
.btn-admin-danger { background: rgba(226,75,74,0.15); color: var(--error); border: 1px solid rgba(226,75,74,0.3); }
.btn-admin-danger:hover { background: var(--error); color: white; }
.btn-admin-success { background: rgba(29,158,117,0.15); color: var(--success); border: 1px solid rgba(29,158,117,0.3); }
.btn-admin-success:hover { background: var(--success); color: white; }
.btn-admin-sm { padding: 5px 10px; font-size: 0.75rem; }

/* ===== TABLE ===== */
.admin-table-wrap { background: #161b22; border: 1px solid rgba(255,255,255,0.06); border-radius: 6px; overflow: hidden; }
.admin-table-header { padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-table-header h3 { font-size: 0.9rem; font-weight: 600; }
.search-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e6edf3;
  padding: 7px 12px;
  border-radius: 4px;
  font-size: 0.82rem;
  width: 220px;
  outline: none;
}
.search-input:focus { border-color: var(--gold); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(230,237,243,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.admin-table td {
  padding: 12px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.admin-table tr.unread td { background: rgba(201,168,76,0.04); }
.thumb-img { width: 50px; height: 38px; object-fit: cover; border-radius: 3px; }
.status-badge { padding: 3px 9px; border-radius: 12px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; }
.status-active { background: rgba(29,158,117,0.15); color: var(--success); }
.status-inactive { background: rgba(226,75,74,0.15); color: var(--error); }
.status-featured { background: rgba(201,168,76,0.15); color: var(--gold); }
.actions-cell { display: flex; gap: 6px; align-items: center; }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 6px; align-items: center; padding: 16px 20px; }
.page-btn { padding: 6px 12px; border-radius: 4px; font-size: 0.82rem; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: rgba(230,237,243,0.7); transition: all 0.2s; }
.page-btn:hover, .page-btn.active { background: var(--gold); color: var(--navy); border-color: var(--gold); }

/* ===== ADMIN FORM ===== */
.admin-form-wrap { background: #161b22; border: 1px solid rgba(255,255,255,0.06); border-radius: 6px; overflow: hidden; max-width: 1100px; }
.form-tabs { display: flex; border-bottom: 1px solid rgba(255,255,255,0.06); overflow-x: auto; }
.form-tab {
  padding: 14px 24px;
  font-size: 0.82rem;
  color: rgba(230,237,243,0.5);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
}
.form-tab:hover { color: #e6edf3; }
.form-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.form-tab-content { display: none; padding: 28px; }
.form-tab-content.active { display: block; }
.form-section-title { font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 20px; padding-bottom: 8px; border-bottom: 1px solid rgba(201,168,76,0.15); }
.admin-field { margin-bottom: 20px; }
.admin-field label { display: block; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(230,237,243,0.55); margin-bottom: 7px; }
.admin-field input,
.admin-field select,
.admin-field textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e6edf3;
  padding: 10px 14px;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus { border-color: var(--gold); }
.admin-field select option { background: #1a1a2e; }
.admin-field textarea { resize: vertical; min-height: 100px; }
.admin-field .field-hint { font-size: 0.73rem; color: rgba(230,237,243,0.35); margin-top: 5px; }
.fields-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.fields-row-3 { grid-template-columns: repeat(3,1fr); }
.fields-row-4 { grid-template-columns: repeat(4,1fr); }

/* ===== CHECKBOX TOGGLE ===== */
.toggle-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.toggle-label { font-size: 0.85rem; color: rgba(230,237,243,0.75); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--gold); cursor: pointer; }

/* ===== GALLERY MANAGER ===== */
.gallery-url-list { display: flex; flex-direction: column; gap: 8px; }
.gallery-url-row { display: flex; gap: 8px; align-items: center; }
.gallery-url-row input { flex: 1; }
.gallery-url-row .del-row { flex-shrink: 0; padding: 10px 12px; background: rgba(226,75,74,0.15); border: 1px solid rgba(226,75,74,0.25); border-radius: 4px; color: var(--error); cursor: pointer; transition: all 0.2s; font-size: 0.8rem; }
.gallery-url-row .del-row:hover { background: var(--error); color: white; }
.add-gallery-row { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: rgba(255,255,255,0.04); border: 1px dashed rgba(255,255,255,0.15); border-radius: 4px; color: rgba(230,237,243,0.5); cursor: pointer; font-size: 0.82rem; margin-top: 8px; transition: all 0.2s; }
.add-gallery-row:hover { border-color: var(--gold); color: var(--gold); }

/* ===== INQUIRIES ===== */
.inquiry-row { cursor: pointer; }
.inquiry-row:hover td { background: rgba(201,168,76,0.05) !important; }
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 999; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal-box { background: #161b22; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.06); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; color: rgba(230,237,243,0.5); font-size: 1.2rem; cursor: pointer; padding: 4px; transition: color 0.2s; }
.modal-close:hover { color: #e6edf3; }
.modal-body { padding: 24px; }
.inq-field { margin-bottom: 14px; }
.inq-field label { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(230,237,243,0.45); display: block; margin-bottom: 4px; }
.inq-field p { color: #e6edf3; font-size: 0.9rem; }

/* ===== SETTINGS PAGE ===== */
.settings-section { background: #161b22; border: 1px solid rgba(255,255,255,0.06); border-radius: 6px; padding: 24px; margin-bottom: 24px; }
.settings-section h3 { font-size: 0.88rem; font-weight: 600; color: var(--gold); margin-bottom: 20px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.06); }

/* ===== TOAST ===== */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--success); color: white; padding: 14px 24px; border-radius: 4px; font-size: 0.88rem; z-index: 9999; transform: translateY(80px); opacity: 0; transition: all 0.35s; box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--error); }

/* ===== ALERTS ===== */
.alert { padding: 12px 16px; border-radius: 4px; font-size: 0.85rem; margin-bottom: 20px; }
.alert-success { background: rgba(29,158,117,0.15); border: 1px solid rgba(29,158,117,0.3); color: var(--success); }
.alert-error { background: rgba(226,75,74,0.15); border: 1px solid rgba(226,75,74,0.3); color: var(--error); }

/* ===== LOGIN PAGE ===== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #0d1117; }
.login-box { background: #161b22; border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; padding: 48px 40px; width: 100%; max-width: 400px; }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { height: 36px; filter: brightness(0) invert(1); margin: 0 auto 12px; }
.login-logo h1 { font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(230,237,243,0.5); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .fields-row-3, .fields-row-4 { grid-template-columns: repeat(2,1fr); }
}
