/* ================================================================
   ICBA 2026 – Admin Panel Stylesheet
   ================================================================ */

:root {
  --sidebar-w:     260px;
  --navbar-h:      60px;
  --primary:       #1b5e20;
  --primary-dark:  #0a2210;
  --primary-mid:   #2e7d32;
  --accent:        #f9a825;
  --accent-dark:   #f57f17;
  --bg:            #f0f3f6;
  --card:          #ffffff;
  --border:        #e2e8f0;
  --text:          #2d3748;
  --muted:         #718096;
  --danger:        #e53e3e;
  --success:       #38a169;
  --warning:       #d69e2e;
  --info:          #3182ce;
  --radius:        10px;
  --shadow:        0 2px 12px rgba(0,0,0,.08);
  --trans:         .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: .9rem; }
a { text-decoration: none; color: inherit; }

/* ── Sidebar ─────────────────────────────────────────────────────── */
.admin-sidebar {
  position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh;
  background: var(--primary-dark); color: #fff; display: flex; flex-direction: column;
  overflow-y: auto; z-index: 1040; transition: transform var(--trans);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 16px 16px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand-logo {
  width: 40px; height: 40px; background: var(--accent); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--primary-dark); flex-shrink: 0;
}
.brand-name { font-weight: 700; font-size: .95rem; line-height: 1.2; }
.brand-sub  { font-size: .7rem; opacity: .7; }

.sidebar-nav   { flex: 1; padding: 12px 8px; }
.nav-section-label { font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.45); padding: 12px 8px 4px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 7px; font-size: .83rem;
  color: rgba(255,255,255,.78); transition: background var(--trans), color var(--trans);
  margin-bottom: 2px;
}
.nav-link i { width: 18px; text-align: center; font-size: .9rem; }
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.12); color: #fff;
}
.nav-link.active { background: var(--primary-mid); color: var(--accent); font-weight: 600; }

.sidebar-footer { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.1); }
.user-info      { display: flex; align-items: center; gap: 10px; }
.user-avatar    { width: 34px; height: 34px; background: rgba(255,255,255,.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .85rem; flex-shrink: 0; }
.user-name      { font-size: .82rem; font-weight: 600; }
.user-role      { font-size: .7rem; opacity: .6; }

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

/* ── Navbar ──────────────────────────────────────────────────────── */
.admin-navbar {
  height: var(--navbar-h); background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  position: sticky; top: 0; z-index: 1030; box-shadow: var(--shadow);
}
.navbar-left, .navbar-right { display: flex; align-items: center; gap: 10px; }
.sidebar-toggle {
  border: none; background: none; width: 34px; height: 34px; border-radius: 7px;
  cursor: pointer; color: var(--text); font-size: 1.05rem; display: none;
  align-items: center; justify-content: center; transition: background var(--trans);
}
.sidebar-toggle:hover { background: var(--bg); }
.page-title { font-weight: 600; font-size: .95rem; color: var(--text); }
.btn-nav {
  padding: 6px 12px; border-radius: 7px; font-size: .8rem;
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  transition: background var(--trans);
}
.btn-nav:hover { background: var(--border); }
.btn-nav-danger { background: #fff5f5; color: var(--danger); border-color: #fed7d7; }
.btn-nav-danger:hover { background: #fed7d7; }

/* ── Page content ────────────────────────────────────────────────── */
.page-content { padding: 24px 20px; flex: 1; }

/* ── Admin card ──────────────────────────────────────────────────── */
.admin-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head-title { font-weight: 600; font-size: .9rem; }

/* ── Stat card ───────────────────────────────────────────────────── */
.stat-card  { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.stat-icon  { width: 40px; height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .75rem; color: var(--muted); }
.ic-green  { background: #e8f5e9; color: var(--primary); }
.ic-gold   { background: #fff8e1; color: var(--accent-dark); }
.ic-blue   { background: #e3f2fd; color: #1565c0; }
.ic-red    { background: #ffebee; color: #c62828; }
.ic-teal   { background: #e0f2f1; color: #00695c; }
.ic-purple { background: #f3e5f5; color: #6a1b9a; }
.ic-orange { background: #fff3e0; color: #e65100; }

/* ── Table ───────────────────────────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; font-size: .83rem; }
.admin-table th { background: #f7f9fc; color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tbody tr:hover td { background: #f9fafb; }

/* ── Action buttons ──────────────────────────────────────────────── */
.btn-action { border: none; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; transition: background var(--trans); }
.btn-action.edit  { background: #e3f2fd; color: #1565c0; }
.btn-action.edit:hover  { background: #bbdefb; }
.btn-action.del   { background: #ffebee; color: var(--danger); }
.btn-action.del:hover   { background: #ffcdd2; }
.btn-action.view  { background: #e8f5e9; color: var(--primary); }
.btn-action.view:hover  { background: #c8e6c9; }

/* ── Admin buttons ───────────────────────────────────────────────── */
.btn-admin { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 14px; border-radius: 7px; font-size: .82rem; font-weight: 500; border: none; cursor: pointer; transition: all var(--trans); text-decoration: none; white-space: nowrap; }
.btn-admin.primary { background: var(--primary); color: #fff; }
.btn-admin.primary:hover { background: var(--primary-mid); }
.btn-admin.accent  { background: var(--accent); color: var(--primary-dark); }
.btn-admin.accent:hover  { background: var(--accent-dark); }
.btn-admin.outline { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-admin.outline:hover { background: var(--bg); }
.btn-admin.danger  { background: #ffebee; color: var(--danger); }
.btn-admin.danger:hover  { background: #ffcdd2; }
.btn-admin.sm { padding: 4px 10px; font-size: .78rem; }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge-pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.bp-green  { background: #e8f5e9; color: #2e7d32; }
.bp-gold   { background: #fff8e1; color: #e65100; }
.bp-blue   { background: #e3f2fd; color: #1565c0; }
.bp-red    { background: #ffebee; color: #c62828; }
.bp-gray   { background: #f5f5f5; color: #616161; }
.bp-purple { background: #f3e5f5; color: #6a1b9a; }
.bp-teal   { background: #e0f2f1; color: #00695c; }
.bp-orange { background: #fff3e0; color: #e65100; }

/* ── Filter bar ──────────────────────────────────────────────────── */
.filter-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filter-input  { width: 240px !important; }
.filter-select { width: 160px !important; }

/* ── Admin tabs ──────────────────────────────────────────────────── */
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--border); padding-bottom: 0; margin-bottom: 16px; }
.admin-tab {
  padding: 7px 16px; border-radius: 7px 7px 0 0; font-size: .82rem; font-weight: 500;
  color: var(--muted); background: none; border: none; cursor: pointer;
  transition: color var(--trans), background var(--trans);
}
.admin-tab:hover  { color: var(--primary); background: #e8f5e9; }
.admin-tab.active { color: var(--primary); background: #e8f5e9; font-weight: 700; border-bottom: 2px solid var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Gallery ─────────────────────────────────────────────────────── */
.gallery-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; margin-top: 8px; }
.gallery-admin-item { position: relative; border-radius: 8px; overflow: hidden; background: #f7f9fc; border: 1px solid var(--border); aspect-ratio: 1; }
.gallery-admin-item img, .gallery-admin-item .gallery-placeholder { width: 100%; height: 100%; object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 2rem; color: var(--muted); }
.gallery-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; gap: 8px; opacity: 0; transition: opacity var(--trans); }
.gallery-admin-item:hover .gallery-overlay { opacity: 1; }
.btn-gal-action { border: none; width: 32px; height: 32px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: .82rem; }
.btn-gal-action.edit-gal { background: var(--accent); color: var(--primary-dark); }
.btn-gal-action.del-gal  { background: var(--danger); color: #fff; }
.gallery-label { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.55); color: #fff; font-size: .7rem; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Upload zone ─────────────────────────────────────────────────── */
.upload-zone { border: 2px dashed var(--border); border-radius: 10px; padding: 32px; text-align: center; cursor: pointer; position: relative; transition: border-color var(--trans); }
.upload-zone:hover { border-color: var(--primary); }
.upload-zone-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ── Modal ───────────────────────────────────────────────────────── */
.modal-header { background: var(--primary); color: #fff; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; padding: 14px 20px; }
.modal-title  { font-size: .95rem; font-weight: 600; }
.modal-content { border-radius: var(--radius); border: none; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.delete-modal-icon { width: 56px; height: 56px; background: #ffebee; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; color: var(--danger); }

/* ── Toast ───────────────────────────────────────────────────────── */
#toastContainer { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast-item { min-width: 260px; max-width: 340px; padding: 12px 16px; border-radius: 9px; background: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.15); display: flex; align-items: center; gap: 10px; font-size: .83rem; animation: toastIn .25s ease; border-left: 4px solid var(--primary); }
.toast-item.success { border-left-color: var(--success); }
.toast-item.error   { border-left-color: var(--danger); }
.toast-item.warning { border-left-color: var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* ── Messages ────────────────────────────────────────────────────── */
.msg-item   { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.msg-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.msg-body   { flex: 1; min-width: 0; }
.msg-name   { font-size: .82rem; font-weight: 600; }
.msg-subject { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-time   { font-size: .73rem; white-space: nowrap; }
.unread-dot { display: inline-block; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; margin-left: 4px; }
.unread     { background: #f9fff9; }

/* ── Avatar ──────────────────────────────────────────────────────── */
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.av-green  { background: var(--primary); }
.av-blue   { background: var(--info); }
.av-gold   { background: var(--accent); color: var(--primary-dark); }
.av-red    { background: var(--danger); }
.av-purple { background: #6a1b9a; }
.av-teal   { background: #00695c; }

/* ── Login page ──────────────────────────────────────────────────── */
.login-body { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-wrapper { width: 100%; max-width: 400px; }
.login-card { background: var(--card); border-radius: 16px; padding: 36px 32px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { width: 56px; height: 56px; background: var(--primary); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: #fff; margin: 0 auto 12px; }
.login-title { text-align: center; font-weight: 700; color: var(--primary); font-size: 1.3rem; margin-bottom: 4px; }
.login-sub   { text-align: center; color: var(--muted); font-size: .82rem; margin-bottom: 24px; }
.input-icon  { position: relative; }
.input-icon i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; }
.input-icon .form-control { padding-left: 36px; }
.btn-login { background: var(--primary); color: #fff; border: none; padding: 10px; border-radius: 8px; font-size: .9rem; font-weight: 600; cursor: pointer; transition: background var(--trans); }
.btn-login:hover { background: var(--primary-mid); }

/* ── Sidebar overlay (mobile) ────────────────────────────────────── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1039; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 991px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .sidebar-overlay.open { display: block; }
  .filter-input, .filter-select { width: 100% !important; }
}
@media (max-width: 575px) {
  .page-content { padding: 14px 12px; }
  .gallery-admin-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
