/* ============================================================
   E Services ISP - Admin Panel Stylesheet
   ============================================================ */

:root {
  --admin-sidebar-w: 260px;
  --admin-header-h: 64px;
  --navy:        #0B132B;
  --navy-light:  #1C2541;
  --purple:      #6C5CE7;
  --purple-light:#8B7FF0;
  --cyan:        #00F5D4;
  --white:       #FFFFFF;
  --white-80:    rgba(255,255,255,0.8);
  --white-60:    rgba(255,255,255,0.6);
  --glass-bg:    rgba(255,255,255,0.07);
  --glass-border:rgba(255,255,255,0.12);
  --gradient-accent: linear-gradient(135deg, #6C5CE7 0%, #00F5D4 100%);
  --gradient-text:   linear-gradient(135deg, #00F5D4 0%, #8B7FF0 100%);
  --success: #00C882;
  --danger:  #FF3250;
  --warning: #FFC107;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', 'Poppins', sans-serif;
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  cursor: default;
}
body::before {
  content: ''; position: fixed; inset: 0;
  background: linear-gradient(135deg, #0B132B 0%, #1C2541 50%, #0B132B 100%);
  z-index: -1;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }
button { cursor: pointer; border: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 3px; }

/* ─── Admin Layout ──────────────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }

/* ─── Sidebar ───────────────────────────────────────────────────────────── */
.admin-sidebar {
  width: var(--admin-sidebar-w); flex-shrink: 0;
  background: rgba(11,19,43,0.95);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100; overflow-y: auto;
  transition: transform 0.3s ease;
  display: flex; flex-direction: column;
}
.sidebar-brand {
  padding: 1.5rem 1.25rem; display: flex; align-items: center; gap: 0.75rem;
  border-bottom: 1px solid var(--glass-border);
}
.sidebar-brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--glass-border); }
.sidebar-brand-text { font-size: 0.9rem; font-weight: 700; background: var(--gradient-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.sidebar-brand-sub { font-size: 0.7rem; color: var(--white-60); }

.sidebar-nav { padding: 1rem 0; flex: 1; }
.sidebar-section-label { padding: 0.75rem 1.25rem 0.35rem; font-size: 0.65rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--white-60); }
.sidebar-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 1.25rem; font-size: 0.875rem; font-weight: 500;
  color: var(--white-60); transition: all 0.2s; border-left: 3px solid transparent;
}
.sidebar-link:hover { color: var(--white); background: var(--glass-bg); }
.sidebar-link.active { color: var(--cyan); background: rgba(0,245,212,0.06); border-left-color: var(--cyan); }
.sidebar-link .material-icons { font-size: 20px; flex-shrink: 0; }
.sidebar-badge { margin-left: auto; padding: 0.15rem 0.5rem; border-radius: 10px; background: var(--danger); color: white; font-size: 0.7rem; font-weight: 700; }

.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--glass-border); }
.sidebar-user { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }
.sidebar-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gradient-accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; color: var(--navy); }
.sidebar-user-name { font-size: 0.875rem; font-weight: 600; }
.sidebar-user-role { font-size: 0.7rem; color: var(--white-60); }
.btn-logout { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; border-radius: 8px; background: rgba(255,50,80,0.1); border: 1px solid rgba(255,50,80,0.2); color: #FF3250; font-size: 0.8rem; font-weight: 600; width: 100%; transition: all 0.3s; }
.btn-logout:hover { background: rgba(255,50,80,0.2); }

/* ─── Main Content ──────────────────────────────────────────────────────── */
.admin-main { flex: 1; margin-left: var(--admin-sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }

.admin-topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--admin-header-h); padding: 0 1.5rem;
  background: rgba(11,19,43,0.92); border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(15px);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.topbar-title { font-size: 1.1rem; font-weight: 700; }
.topbar-subtitle { font-size: 0.8rem; color: var(--white-60); }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.topbar-date { font-size: 0.8rem; color: var(--white-60); }
.topbar-sidebar-toggle { display: none; width: 38px; height: 38px; border-radius: 8px; background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--white); align-items: center; justify-content: center; }

.admin-content { padding: 1.75rem; flex: 1; }

/* ─── Dashboard Stats ───────────────────────────────────────────────────── */
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stat-card {
  padding: 1.5rem; border-radius: 12px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  backdrop-filter: blur(15px); position: relative; overflow: hidden;
  transition: all 0.3s;
}
.stat-card:hover { transform: translateY(-3px); border-color: rgba(108,92,231,0.4); }
.stat-card::after { content: ''; position: absolute; bottom: -15px; right: -15px; width: 80px; height: 80px; border-radius: 50%; background: currentColor; opacity: 0.05; }
.stat-card-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.stat-card-icon .material-icons { font-size: 22px; }
.stat-icon-blue { background: rgba(108,92,231,0.2); color: var(--purple-light); }
.stat-icon-cyan { background: rgba(0,245,212,0.15); color: var(--cyan); }
.stat-icon-green { background: rgba(0,200,130,0.15); color: #00C882; }
.stat-icon-red { background: rgba(255,50,80,0.15); color: #FF3250; }
.stat-icon-yellow { background: rgba(255,193,7,0.15); color: #FFC107; }
.stat-card-label { font-size: 0.78rem; color: var(--white-60); font-weight: 500; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.4rem; }
.stat-card-value { font-size: 2rem; font-weight: 800; line-height: 1; }

/* ─── Admin Cards ───────────────────────────────────────────────────────── */
.admin-card { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 12px; backdrop-filter: blur(15px); margin-bottom: 1.5rem; }
.admin-card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--glass-border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.admin-card-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.admin-card-title .material-icons { color: var(--cyan); font-size: 20px; }
.admin-card-body { padding: 1.5rem; }

/* ─── Tables ────────────────────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th { padding: 0.875rem 1rem; text-align: left; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--white-60); border-bottom: 1px solid var(--glass-border); white-space: nowrap; }
.admin-table td { padding: 0.875rem 1rem; 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: var(--glass-bg); }
.table-thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; }
.table-actions { display: flex; gap: 0.5rem; flex-wrap: nowrap; }

/* ─── Badges ────────────────────────────────────────────────────────────── */
.badge { padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.badge-success { background: rgba(0,200,130,0.15); color: #00C882; }
.badge-danger  { background: rgba(255,50,80,0.15); color: #FF3250; }
.badge-warning { background: rgba(255,193,7,0.15); color: #FFC107; }
.badge-info    { background: rgba(108,92,231,0.15); color: var(--purple-light); }
.badge-cyan    { background: rgba(0,245,212,0.15); color: var(--cyan); }

/* ─── Forms ─────────────────────────────────────────────────────────────── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--white-80); margin-bottom: 0.5rem; }
.form-control {
  width: 100%; padding: 0.75rem 1rem; border-radius: 8px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--glass-border);
  color: var(--white); font-size: 0.875rem; outline: none; transition: all 0.3s;
}
.form-control:focus { border-color: var(--cyan); background: rgba(0,245,212,0.05); box-shadow: 0 0 0 3px rgba(0,245,212,0.1); }
.form-control::placeholder { color: rgba(255,255,255,0.3); }
select.form-control option { background: var(--navy-light); color: var(--white); }
textarea.form-control { resize: vertical; min-height: 120px; }
.form-hint { font-size: 0.75rem; color: var(--white-60); margin-top: 0.35rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check-input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--cyan); }
.form-check-label { font-size: 0.875rem; color: var(--white-80); cursor: pointer; }

/* ─── Buttons (Admin) ───────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.6rem 1.25rem; border-radius: 8px; font-size: 0.85rem; font-weight: 600; transition: all 0.25s; cursor: pointer; border: 1px solid transparent; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.78rem; border-radius: 6px; }
.btn-primary { background: var(--gradient-accent); color: var(--navy); border-color: transparent; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,245,212,0.3); }
.btn-secondary { background: var(--glass-bg); border-color: var(--glass-border); color: var(--white-80); }
.btn-secondary:hover { background: rgba(255,255,255,0.12); }
.btn-danger { background: rgba(255,50,80,0.15); border-color: rgba(255,50,80,0.3); color: #FF3250; }
.btn-danger:hover { background: rgba(255,50,80,0.25); }
.btn-success { background: rgba(0,200,130,0.15); border-color: rgba(0,200,130,0.3); color: #00C882; }
.btn-success:hover { background: rgba(0,200,130,0.25); }
.btn-warning { background: rgba(255,193,7,0.15); border-color: rgba(255,193,7,0.3); color: #FFC107; }
.btn-warning:hover { background: rgba(255,193,7,0.25); }
.btn .material-icons { font-size: 16px; }

/* ─── Image Preview ─────────────────────────────────────────────────────── */
.img-preview-wrap { margin-top: 0.75rem; }
.img-preview { width: 120px; height: 90px; border-radius: 8px; object-fit: cover; border: 1px solid var(--glass-border); display: block; }
.img-preview-placeholder { width: 120px; height: 90px; border-radius: 8px; border: 2px dashed var(--glass-border); display: flex; align-items: center; justify-content: center; color: var(--white-60); font-size: 0.7rem; }

/* ─── Upload Area ───────────────────────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--glass-border); border-radius: 10px;
  padding: 2rem; text-align: center; cursor: pointer; transition: all 0.3s;
}
.upload-area:hover { border-color: var(--cyan); background: rgba(0,245,212,0.04); }
.upload-area .material-icons { font-size: 40px; color: var(--white-60); margin-bottom: 0.5rem; }
.upload-area p { color: var(--white-60); font-size: 0.875rem; }
.upload-area span { color: var(--cyan); font-weight: 600; }

/* ─── Stars ─────────────────────────────────────────────────────────────── */
.star-rating input { display: none; }
.star-rating label { font-size: 1.5rem; cursor: pointer; color: var(--glass-border); transition: color 0.2s; }
.star-rating label:hover, .star-rating label:hover ~ label { color: #FFD700; }
.star-rating input:checked ~ label { color: #FFD700; }

/* ─── Alert ─────────────────────────────────────────────────────────────── */
.alert { padding: 0.875rem 1.25rem; border-radius: 8px; margin-bottom: 1.25rem; font-size: 0.875rem; font-weight: 500; display: flex; align-items: center; gap: 0.5rem; }
.alert-success { background: rgba(0,200,130,0.12); border: 1px solid rgba(0,200,130,0.25); color: #00C882; }
.alert-error   { background: rgba(255,50,80,0.12); border: 1px solid rgba(255,50,80,0.25); color: #FF3250; }
.alert-info    { background: rgba(108,92,231,0.12); border: 1px solid rgba(108,92,231,0.25); color: var(--purple-light); }

/* ─── Toast ─────────────────────────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 2rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { padding: 0.875rem 1.25rem; border-radius: 10px; font-size: 0.875rem; font-weight: 500; display: flex; align-items: center; gap: 0.5rem; animation: toast-in 0.3s ease; backdrop-filter: blur(15px); min-width: 240px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.toast-success { background: rgba(0,32,20,0.9); border: 1px solid rgba(0,200,130,0.3); color: #00C882; }
.toast-error   { background: rgba(40,0,10,0.9); border: 1px solid rgba(255,50,80,0.3); color: #FF3250; }
@keyframes toast-in { from { transform: translateX(100px); opacity: 0; } }

/* ─── Gallery Admin Grid ────────────────────────────────────────────────── */
.gallery-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.gallery-admin-item { border-radius: 10px; overflow: hidden; border: 1px solid var(--glass-border); position: relative; group: gallery-item; }
.gallery-admin-thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.gallery-admin-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; gap: 0.5rem; opacity: 0; transition: opacity 0.3s; }
.gallery-admin-item:hover .gallery-admin-overlay { opacity: 1; }
.gallery-admin-caption { padding: 0.5rem; font-size: 0.75rem; color: var(--white-60); background: rgba(11,19,43,0.8); }

/* ─── Login Page ────────────────────────────────────────────────────────── */
.admin-login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { width: 100%; max-width: 420px; padding: 2.5rem; border-radius: 20px; background: rgba(255,255,255,0.07); border: 1px solid var(--glass-border); backdrop-filter: blur(20px); }
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo img { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; margin: 0 auto 0.75rem; border: 3px solid var(--glass-border); box-shadow: 0 0 30px rgba(0,245,212,0.3); }
.login-logo h1 { font-size: 1.5rem; font-weight: 800; background: var(--gradient-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.login-logo p { color: var(--white-60); font-size: 0.85rem; }

/* ─── Responsive Admin ──────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,0.5); }
  .admin-main { margin-left: 0; }
  .topbar-sidebar-toggle { display: flex; }
}
@media (max-width: 600px) {
  .admin-content { padding: 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; }
}
