/* CG Tools - Stylesheet v6 */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,700&display=swap');

:root {
  --primary: #00524B;
  --primary-d: #003d37;
  --primary-l: #006b62;
  --accent1: #4cc6e1;
  --accent2: #61CE70;
  --accent2-d: #3ba84a;
  --overlay-color: rgba(0,82,75,0.04);
  --bg: #f4f7f6;
  --card: #ffffff;
  --text: #0d1f1e;
  --muted: #5a7472;
  --border: rgba(0,82,75,0.12);
  --radius: 14px;
  --shadow: 0 4px 20px rgba(0,82,75,0.08);
  --shadow-lg: 0 12px 40px rgba(0,82,75,0.12);
  --admin-sidebar: #003d37;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Montserrat', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; font-size: 16px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ===== NAVBAR ===== */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 999;
  box-shadow: 0 2px 10px rgba(0,82,75,0.05);
}
.nav-inner {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800; font-size: 20px;
  color: var(--primary); flex-shrink: 0; text-decoration: none;
}
.logo-icon {
  width: 36px; height: 36px; background: var(--primary);
  border-radius: 9px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.logo-icon svg { width: 18px; height: 18px; }
.logo-text { white-space: nowrap; }

/* Nav links pushed RIGHT */
.nav-links {
  display: flex; gap: 0; list-style: none;
  margin-left: auto; align-items: center; flex-shrink: 0;
}
.nav-links > li { position: relative; }
.nav-links a {
  font-size: 14px; font-weight: 500;
  color: var(--muted); padding: 7px 13px;
  border-radius: 8px; display: block;
  transition: all .18s; white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--primary); background: rgba(0,82,75,0.07);
}

/* ===== DROPDOWN - FIXED: no gap, stays open ===== */
.nav-dropdown { position: relative; }
.nav-dropdown .dropdown {
  display: none;
  position: absolute;
  top: 100%;           /* flush with bottom of nav item - NO gap */
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  padding: 6px;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  /* Invisible top bridge to close gap between parent and dropdown */
  margin-top: 0;
}
/* Pseudo-element bridge - fills gap so mouse doesn't leave hover zone */
.nav-dropdown > a::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0; right: 0;
  height: 8px;        /* bridges the gap if any */
  background: transparent;
}
/* Keep dropdown open when hovering parent OR dropdown */
.nav-dropdown:hover .dropdown { display: block; }
.nav-dropdown .dropdown:hover { display: block; }

.dropdown li a {
  font-size: 13px; padding: 9px 14px;
  border-radius: 8px; display: block; color: var(--muted);
  transition: all .15s;
}
.dropdown li a:hover { color: var(--primary); background: rgba(0,82,75,0.07); }

/* Extra: keep dropdown visible via JS class too (belt+suspenders) */
.nav-dropdown.dd-open .dropdown { display: block; }

/* Hamburger */
.nav-toggle {
  display: none; background: none; border: none;
  font-size: 22px; cursor: pointer;
  color: var(--primary); padding: 4px;
  margin-left: auto;
}

/* Mobile nav */
.mobile-nav {
  background: #fff; border-top: 1px solid var(--border);
  padding: 12px 24px; box-shadow: 0 8px 24px rgba(0,0,0,.07);
}
.mobile-nav a, .mobile-nav summary {
  display: block; padding: 9px 0;
  font-size: 14px; font-weight: 500; color: var(--muted);
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.mobile-nav a:hover, .mobile-nav summary:hover { color: var(--primary); }
.mobile-nav .mob-sub { padding-left: 14px; }
.mobile-nav .mob-sub a { font-size: 13px; border-bottom: none; }
.mobile-nav details summary { list-style: none; }
.mobile-nav details summary::-webkit-details-marker { display: none; }

/* ===== HERO ===== */
.hero {
  background: #ffffff;
  padding: 72px 20px 76px; text-align: center;
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: var(--overlay-color); pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(0,82,75,0.07); border: 1px solid rgba(0,82,75,0.15);
  border-radius: 50px; padding: 6px 16px;
  font-size: 12px; font-weight: 600; color: var(--primary);
  margin-bottom: 20px; position: relative; z-index: 1;
}
.hero-badge span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent2); animation: blink 2s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.25} }
.hero h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(28px, 4.5vw, 58px);
  font-weight: 800; color: var(--text); line-height: 1.1;
  margin-bottom: 14px; max-width: 960px;
  margin-left: auto; margin-right: auto; position: relative; z-index: 1;
}
.hero h1 em { font-style: normal; color: var(--primary); }
.hero-sub {
  font-size: 16px; color: var(--muted);
  max-width: 680px; margin: 0 auto 28px; line-height: 1.7;
  position: relative; z-index: 1;
}
.hero-search {
  max-width: 680px; margin: 0 auto 22px;
  display: flex; border-radius: 50px; overflow: hidden;
  border: 2px solid var(--border); background: #fff;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  position: relative; z-index: 1;
}
.hero-search input {
  flex: 1; border: none; outline: none;
  padding: 14px 22px; font-size: 15px;
  font-family: 'Montserrat', sans-serif; color: var(--text); background: transparent;
}
.hero-search input::placeholder { color: var(--muted); }
.hero-search button {
  background: var(--primary); color: #fff; border: none;
  padding: 14px 28px; font-size: 14px; font-weight: 700;
  font-family: 'Montserrat', sans-serif; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: background .18s; white-space: nowrap;
  border-radius: 0 48px 48px 0;
}
.hero-search button:hover { background: var(--primary-l); }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; position: relative; z-index: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Montserrat', sans-serif; font-weight: 600;
  font-size: 14px; padding: 12px 28px;
  border-radius: 50px; border: none; cursor: pointer;
  transition: all .18s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-l); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: rgba(0,82,75,0.06); }
.btn-main { background: var(--primary); color: #fff; }
.btn-main:hover { background: var(--primary-l); }

/* Stats */
.stats-section { padding: 36px 20px; background: var(--bg); }
.stats-card {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: 18px; display: flex; overflow: hidden;
  max-width: 860px; margin: 0 auto; box-shadow: var(--shadow);
}
.stat-item {
  flex: 1; padding: 28px 20px;
  text-align: center; border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-num {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(28px, 4vw, 44px); font-weight: 800; color: var(--primary);
}
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 500; }

/* Sections */
.section { padding: 52px 0; }
.section-head {
  display: flex; align-items: baseline;
  justify-content: space-between; gap: 12px;
  margin-bottom: 28px; flex-wrap: wrap;
}
.section-head h2 {
  font-family: 'Montserrat', sans-serif; font-size: 22px; font-weight: 700; color: var(--text);
}
.view-all { font-size: 13px; font-weight: 600; color: var(--primary); }

/* Pills */
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pill {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 50px;
  border: 1.5px solid var(--border); background: #fff;
  font-size: 13px; font-weight: 500; color: var(--muted);
  cursor: pointer; transition: all .18s;
  white-space: nowrap; text-decoration: none; user-select: none;
}
.pill:hover, .pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Tool cards */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.tool-card {
  background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 22px 18px;
  transition: all .22s; position: relative;
  overflow: hidden; display: block; text-decoration: none;
}
.tool-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent1));
  transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(0,82,75,.2); }
.tool-card:hover::before { transform: scaleX(1); }
.tool-icon { width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 21px; }
.tool-name { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 5px; line-height: 1.3; }
.tool-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.tool-badge { display: inline-block; margin-top: 10px; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 50px; background: #e8f6f4; color: var(--primary); text-transform: uppercase; letter-spacing: .5px; }

/* Features */
.features-section { background: linear-gradient(135deg, var(--primary), var(--primary-d)); padding: 70px 20px; }
.features-head { text-align: center; margin-bottom: 44px; }
.features-head h2 { font-family: 'Montserrat', sans-serif; font-size: 28px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.features-head p { font-size: 15px; color: rgba(255,255,255,.55); }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; }
.feat-card { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); padding: 28px 22px; }
.feat-icon { font-size: 28px; margin-bottom: 12px; }
.feat-title { font-family: 'Montserrat', sans-serif; font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 7px; }
.feat-text { font-size: 13px; color: rgba(255,255,255,.6); line-height: 1.65; }

/* Blog */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.blog-card { background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; display: block; transition: all .2s; }
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.blog-thumb { height: 190px; background: linear-gradient(135deg, #e8f6f4, #c5eee8); display: flex; align-items: center; justify-content: center; font-size: 50px; overflow: hidden; position: relative; }
.blog-thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; display: block; }
.blog-body { padding: 20px; }
.blog-meta { font-size: 11px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 12px; align-items: center; }
.blog-tag { background: #e8f6f4; color: var(--primary); padding: 2px 8px; border-radius: 50px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.blog-title { font-family: 'Montserrat', sans-serif; font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 8px; line-height: 1.35; }
.blog-excerpt { font-size: 13px; color: var(--muted); line-height: 1.55; }
.blog-read { font-size: 12px; font-weight: 600; color: var(--primary); margin-top: 12px; display: block; }

/* Page header */
.page-header { background: linear-gradient(135deg, var(--primary), var(--primary-d)); padding: 50px 20px; text-align: center; color: #fff; }
.page-header h1 { font-family: 'Montserrat', sans-serif; font-size: clamp(24px, 4vw, 40px); font-weight: 800; margin-bottom: 8px; }
.page-header p { font-size: 16px; color: rgba(255,255,255,.65); max-width: 500px; margin: 0 auto; }
.breadcrumb { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 13px; color: rgba(255,255,255,.5); margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb a { color: rgba(255,255,255,.75); }
.breadcrumb span { color: rgba(255,255,255,.35); }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px; font-family: 'Montserrat', sans-serif; font-size: 14px; color: var(--text); background: #fff; outline: none; transition: border-color .18s; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 130px; }
.alert { padding: 14px 18px; border-radius: 10px; font-size: 14px; margin-bottom: 18px; font-weight: 500; }
.alert-success { background: #edf8ed; color: #1a5c24; border: 1px solid #a0d9a7; }
.alert-error { background: #fdf0f0; color: #8c1a1a; border: 1px solid #f3a0a0; }

/* Contact */
.contact-wrap { display: grid; grid-template-columns: 1fr 1.6fr; gap: 40px; align-items: start; }
.contact-item { display: flex; gap: 14px; margin-bottom: 20px; align-items: flex-start; }
.contact-item-icon { width: 40px; height: 40px; background: #e8f6f4; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.contact-item h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.contact-item p { font-size: 13px; color: var(--muted); }

/* Footer */
.footer { background: #0a1f1d; padding: 56px 20px 28px; }
.footer-inner { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand {}
.footer-logo { font-family: 'Montserrat', sans-serif; font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 10px; }
.footer-tagline { font-size: 13px; color: rgba(255,255,255,.4); line-height: 1.7; max-width: 220px; }
.footer-col h4 { font-size: 11px; font-weight: 700; color: rgba(255,255,255,.35); text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 16px; }
.footer-col a { display: block; font-size: 13px; color: rgba(255,255,255,.6); margin-bottom: 10px; transition: color .15s; }
.footer-col a:hover { color: var(--accent1); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.07); margin-top: 40px; padding-top: 22px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-bottom p { font-size: 12px; color: rgba(255,255,255,.3); }
.social-links { display: flex; gap: 8px; flex-wrap: wrap; }
.social-btn { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s; font-size: 12px; color: rgba(255,255,255,.55); font-weight: 600; gap: 6px; text-decoration: none; }
.social-btn:hover { background: rgba(76,198,225,.15); color: var(--accent1); }
.social-btn img { width: 18px; height: 18px; object-fit: contain; border-radius: 3px; }

/* ===== ADMIN ===== */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--admin-sidebar); flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-logo { padding: 18px 16px; font-family: 'Montserrat', sans-serif; font-size: 17px; font-weight: 800; color: #fff; border-bottom: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; gap: 10px; }
.sidebar-logo .sl-sub { font-size: 10px; font-weight: 400; color: rgba(255,255,255,.4); display: block; line-height: 1.2; }
.sidebar-logo .sl-icon { width: 34px; height: 34px; background: rgba(255,255,255,.12); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.sidebar-logo .sl-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
.sidebar-nav { padding: 10px 8px; flex: 1; }
.sidebar-nav .nav-group { font-size: 10px; font-weight: 700; color: rgba(255,255,255,.28); text-transform: uppercase; letter-spacing: 1px; padding: 14px 12px 6px; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; font-size: 13px; font-weight: 500; color: rgba(255,255,255,.65); margin-bottom: 2px; transition: all .18s; text-decoration: none; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.admin-main { flex: 1; background: #f0f4f3; overflow: auto; min-height: 100vh; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 0 24px; height: 62px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 8px rgba(0,0,0,.04); }
.admin-topbar-title { font-family: 'Montserrat', sans-serif; font-size: 17px; font-weight: 700; color: var(--text); }
.admin-content { padding: 24px; }
.admin-card { background: #fff; border-radius: 14px; border: 1.5px solid var(--border); padding: 24px; margin-bottom: 20px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { background: #fff; border-radius: 14px; border: 1.5px solid var(--border); padding: 20px; display: flex; align-items: center; gap: 14px; transition: all .2s; }
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat-card-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stat-card h3 { font-family: 'Montserrat', sans-serif; font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-card p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 10px 14px; border-bottom: 1.5px solid var(--border); }
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f7faf9; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 50px; font-size: 11px; font-weight: 600; }
.badge-green { background: #edf8ed; color: #1a5c24; }
.badge-red { background: #fdf0f0; color: #8c1a1a; }
.badge-blue { background: #eef6ff; color: #185FA5; }
.admin-btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; border: none; cursor: pointer; font-family: 'Montserrat', sans-serif; transition: all .15s; text-decoration: none; }
.admin-btn-primary { background: var(--primary); color: #fff; }
.admin-btn-primary:hover { background: var(--primary-l); }
.admin-btn-danger { background: #fdf0f0; color: #8c1a1a; }
.admin-btn-danger:hover { background: #f7c1c1; }
.admin-btn-edit { background: #eef6ff; color: #185FA5; }
.admin-btn-edit:hover { background: #B5D4F4; }

/* Topbar profile/notif */
.topbar-right { display: flex; align-items: center; gap: 12px; }
.notif-wrap { position: relative; }
.notif-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .18s; position: relative; flex-shrink: 0; }
.notif-btn:hover { background: #e8f6f4; border-color: var(--primary); }
.notif-btn svg { width: 18px; height: 18px; stroke: var(--muted); }
.notif-badge { position: absolute; top: -2px; right: -2px; width: 16px; height: 16px; background: #e24b4a; border-radius: 50%; font-size: 9px; font-weight: 700; color: #fff; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.dropdown-panel { position: absolute; top: calc(100% + 10px); right: 0; background: #fff; border: 1.5px solid var(--border); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.12); z-index: 300; display: none; }
.dropdown-panel.open { display: block; }
.notif-panel { width: 300px; padding: 16px; }
.notif-panel-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.notif-item { padding: 10px 12px; border-radius: 9px; background: var(--bg); margin-bottom: 8px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.notif-item strong { color: var(--text); display: block; font-weight: 600; margin-bottom: 2px; }
.notif-empty { text-align: center; padding: 20px; color: var(--muted); font-size: 13px; }
.profile-wrap { position: relative; }
.profile-btn { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 5px 10px; border-radius: 10px; border: 1.5px solid var(--border); background: #fff; transition: all .18s; }
.profile-btn:hover { background: var(--bg); }
.profile-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; font-size: 12px; font-weight: 700; color: #fff; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: 12px; font-weight: 600; color: var(--text); }
.chev { width: 14px; height: 14px; stroke: var(--muted); }
.profile-panel { width: 240px; }
.profile-dd-header { padding: 16px; text-align: center; border-bottom: 1px solid var(--border); }
.profile-dd-avatar-lg { width: 56px; height: 56px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; overflow: hidden; margin: 0 auto 8px; font-size: 20px; font-weight: 700; color: #fff; }
.profile-dd-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.profile-dd-email { font-size: 12px; color: var(--muted); word-break: break-all; }
.profile-dd-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; transition: background .15s; border: none; background: transparent; width: 100%; text-align: left; text-decoration: none; font-family: 'Montserrat', sans-serif; }
.profile-dd-item:hover { background: var(--bg); }
.profile-dd-item.danger { color: #e24b4a; }
.profile-dd-sep { height: 1px; background: var(--border); }

/* Emoji grid */
.emoji-picker-wrap { position: relative; }
.emoji-display-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.emoji-display { font-size: 28px; width: 48px; height: 48px; background: var(--bg); border: 1.5px solid var(--border); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.emoji-pick-btn { font-size: 13px; font-weight: 600; color: var(--primary); cursor: pointer; background: none; border: none; font-family: 'Montserrat', sans-serif; text-decoration: underline; }
.emoji-grid { display: none; grid-template-columns: repeat(10, 36px); gap: 4px; max-height: 200px; overflow-y: auto; border: 1.5px solid var(--border); border-radius: 10px; padding: 8px; background: #fff; margin-top: 6px; }
.emoji-grid.open { display: grid; }
.emoji-opt { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 20px; border-radius: 7px; cursor: pointer; transition: background .15s; border: 1.5px solid transparent; }
.emoji-opt:hover, .emoji-opt.sel { background: #e8f6f4; border-color: var(--primary); }

/* Rich editor */
.rich-editor-wrap { border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
.rich-editor-wrap:focus-within { border-color: var(--primary); }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 3px; padding: 8px; background: #f8faf9; border-bottom: 1px solid var(--border); }
.rich-toolbar button, .rich-toolbar select { height: 28px; border: none; border-radius: 5px; cursor: pointer; background: transparent; font-family: 'Montserrat', sans-serif; font-size: 12px; color: var(--text); padding: 0 6px; transition: background .15s; }
.rich-toolbar button { min-width: 28px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.rich-toolbar button:hover { background: #e8f6f4; color: var(--primary); }
.rich-toolbar .sep { width: 1px; height: 18px; background: var(--border); align-self: center; margin: 0 3px; }
.rich-editor-area { width: 100%; min-height: 260px; padding: 14px; border: none; outline: none; font-family: 'Montserrat', sans-serif; font-size: 14px; color: var(--text); line-height: 1.75; overflow-y: auto; background: #fff; }
.html-mode-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: #f0f4f3; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.html-mode-bar a { color: var(--primary); font-weight: 600; cursor: pointer; text-decoration: underline; }
.raw-html-area { width: 100%; min-height: 200px; padding: 12px; border: none; border-top: 1px solid var(--border); font-family: monospace; font-size: 13px; color: var(--text); outline: none; resize: vertical; background: #fafafa; display: none; } .raw-html-area.visible { display: block; }

/* Toggle */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 14px; font-weight: 500; color: var(--text); }
.toggle-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; border-radius: 24px; transition: .3s; }
.toggle-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .3s; }
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.page-btn { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1.5px solid var(--border); background: #fff; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; text-decoration: none; transition: all .15s; }
.page-btn:hover, .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Misc */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .empty-icon { font-size: 50px; margin-bottom: 16px; display: block; }

/* Responsive */
@media(max-width: 960px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .contact-wrap { grid-template-columns: 1fr; }
}
@media(max-width: 700px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .stats-card { flex-wrap: wrap; }
  .stat-item { min-width: 50%; border-right: none; border-bottom: 1px solid var(--border); }
}
@media(max-width: 480px) {
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .blog-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .emoji-grid { grid-template-columns: repeat(7, 36px); }
}

/* Ensure hidden content textareas are always submitted even when display:none */
.content-sync-ta {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  /* NOT display:none - so browser always submits the value */
}
