/* CPE HUB 2.0 - Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;500;600;700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2128;
  --bg-hover: #222831;
  --accent: #00d4aa;
  --accent-dim: #00d4aa18;
  --accent-hover: #00f0c0;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --border: #30363d;
  --border-light: #21262d;
  --red: #f85149;
  --yellow: #e3b341;
  --green: #3fb950;
  --blue: #58a6ff;
  --purple: #bc8cff;
  --orange: #ffa657;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 60px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; overflow-x: hidden; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* NAVBAR */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(13,17,23,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex; align-items: center;
  padding: 0 16px; gap: 6px;
}
.nav-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; margin-right: 4px; }
.nav-logo-icon { width: 30px; height: 30px; background: var(--accent-dim); border: 1.5px solid var(--accent); border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.nav-logo-text { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 17px; }
.nav-logo-text span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 1px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-link { display: flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 6px; color: var(--text-secondary); text-decoration: none; font-size: 12.5px; font-weight: 500; white-space: nowrap; transition: all 0.2s; flex-shrink: 0; }
.nav-link:hover { color: var(--text-primary); background: var(--bg-card); }
.nav-link.active { color: var(--accent); background: var(--accent-dim); }
.nav-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: auto; }
.nav-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); cursor: pointer; transition: all 0.2s; text-decoration: none; font-size: 14px; }
.nav-btn:hover { color: var(--accent); border-color: var(--accent); }
.nav-streak { display: flex; align-items: center; gap: 4px; padding: 3px 9px; background: var(--accent-dim); border: 1px solid var(--accent); border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--accent); }

.main-content { margin-top: var(--nav-height); min-height: calc(100vh - var(--nav-height)); }

/* HERO */
.hero { padding: 48px 20px 32px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -80px; left: 50%; transform: translateX(-50%); width: 500px; height: 300px; background: radial-gradient(ellipse, rgba(0,212,170,0.07) 0%, transparent 70%); pointer-events: none; }
.hero-icon { width: 56px; height: 56px; background: var(--accent-dim); border: 2px solid var(--accent); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 24px; }
.hero h1 { font-family: 'Syne', sans-serif; font-size: clamp(32px, 8vw, 52px); font-weight: 800; letter-spacing: -2px; line-height: 1; margin-bottom: 10px; }
.hero h1 span { color: var(--accent); }
.hero-subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 6px; }
.hero-tagline { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-size: 12px; font-weight: 500; }

/* FEATURE GRID */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding: 0 16px 28px; max-width: 960px; margin: 0 auto; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 14px; text-align: center; text-decoration: none; color: var(--text-primary); transition: all 0.2s; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.feature-card:hover { border-color: var(--accent); background: var(--bg-hover); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,212,170,0.08); }
.feature-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.feature-name { font-size: 12px; font-weight: 600; }
.fi-teal { background: rgba(0,212,170,0.15); }
.fi-blue { background: rgba(88,166,255,0.15); }
.fi-purple { background: rgba(188,140,255,0.15); }
.fi-yellow { background: rgba(227,179,65,0.15); }
.fi-red { background: rgba(248,81,73,0.15); }
.fi-orange { background: rgba(255,166,87,0.15); }
.fi-green { background: rgba(63,185,80,0.15); }
.fi-pink { background: rgba(255,120,180,0.15); }

/* SECTIONS */
.section { padding: 0 16px 28px; max-width: 960px; margin: 0 auto; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-family: 'Syne', sans-serif; font-size: 17px; font-weight: 700; }
.section-link { font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 500; }
.section-link:hover { text-decoration: underline; }

/* ANNOUNCEMENT */
.announcement-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 8px; transition: border-color 0.2s; }
.announcement-card:hover { border-color: var(--accent); }
.announcement-card.pinned { border-left: 3px solid var(--accent); }
.announcement-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 6px; }
.badge-pinned { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent); }
.badge-new { background: rgba(63,185,80,0.15); color: var(--green); border: 1px solid var(--green); }
.announcement-title { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.announcement-body { font-size: 13px; color: var(--text-secondary); }
.announcement-time { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* CONTACTS */
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.contact-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 14px; text-align: center; transition: all 0.2s; }
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-dim); border: 2px solid var(--accent); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: var(--accent); margin: 0 auto 10px; font-family: 'Syne', sans-serif; }
.contact-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 3px; }
.contact-role { font-size: 10px; color: var(--text-secondary); margin-bottom: 10px; }
.contact-actions { display: flex; justify-content: center; gap: 6px; }
.contact-btn { width: 26px; height: 26px; border-radius: 5px; background: var(--bg-hover); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); text-decoration: none; font-size: 11px; transition: all 0.2s; }
.contact-btn:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* FOOTER */
.footer { text-align: center; padding: 28px 20px; border-top: 1px solid var(--border); margin-top: 16px; }
.footer-logo { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.footer-logo span { color: var(--accent); }
.footer-sub { font-size: 12px; color: var(--text-secondary); margin-bottom: 3px; }
.footer-copy { font-size: 11px; color: var(--text-muted); }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; border: none; text-decoration: none; font-family: 'DM Sans', sans-serif; }
.btn-primary { background: var(--accent); color: #0d1117; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #ff6b63; }
.btn-green { background: var(--green); color: #0d1117; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-full { width: 100%; }
button:disabled { opacity: 0.6; cursor: not-allowed; }

/* FORMS */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.4px; }
.form-input { width: 100%; padding: 9px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px; font-family: 'DM Sans', sans-serif; transition: border-color 0.2s; outline: none; }
.form-input:focus { border-color: var(--accent); background: var(--bg-hover); }
.form-input::placeholder { color: var(--text-muted); }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* PAGE HEADER */
.page-header { padding: 28px 16px 20px; max-width: 960px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.page-header-icon { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--accent-dim); border: 1px solid var(--accent); flex-shrink: 0; }
.page-header h1 { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800; }
.page-header p { font-size: 12px; color: var(--text-secondary); }

/* TOAST */
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 18px; font-size: 13px; font-weight: 500; z-index: 9999; transform: translateY(80px); opacity: 0; transition: all 0.3s; max-width: 300px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--accent); }

/* LOADING */
.loading-overlay { position: fixed; inset: 0; background: var(--bg-primary); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; z-index: 9998; }
.loading-spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
.empty-state-icon { font-size: 36px; margin-bottom: 10px; }
.empty-state h3 { font-size: 15px; font-weight: 600; margin-bottom: 5px; color: var(--text-primary); }
.empty-state p { font-size: 13px; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 14px; padding: 22px; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto; transform: scale(0.95); transition: transform 0.2s; }
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-title { font-family: 'Syne', sans-serif; font-size: 17px; font-weight: 700; }
.modal-close { width: 28px; height: 28px; border-radius: 5px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.modal-close:hover { color: var(--red); border-color: var(--red); }

/* TABS */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 9px 14px; font-size: 12px; font-weight: 600; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; transition: all 0.2s; background: none; border-top: none; border-left: none; border-right: none; font-family: 'DM Sans', sans-serif; display: flex; align-items: center; gap: 5px; }
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* PILL */
.pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; }
.pill-teal { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent); }
.pill-green { background: rgba(63,185,80,0.15); color: var(--green); border: 1px solid var(--green); }
.pill-red { background: rgba(248,81,73,0.15); color: var(--red); border: 1px solid var(--red); }
.pill-yellow { background: rgba(227,179,65,0.15); color: var(--yellow); border: 1px solid var(--yellow); }

/* TABLE */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; background: var(--bg-card); border-bottom: 1px solid var(--border); }
td { padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--border-light); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-card); }

/* SIGNIN PAGE */
.signin-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg-primary); }
.signin-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 18px; padding: 32px 28px; width: 100%; max-width: 400px; }
.signin-logo { text-align: center; margin-bottom: 24px; }
.signin-logo-icon { width: 56px; height: 56px; background: var(--accent-dim); border: 2px solid var(--accent); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; margin: 0 auto 10px; }
.signin-logo h1 { font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 800; }
.signin-logo h1 span { color: var(--accent); }
.signin-logo p { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.signin-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg-card); border-radius: var(--radius-sm); padding: 3px; margin-bottom: 20px; gap: 2px; }
.signin-tab { padding: 8px; text-align: center; font-size: 13px; font-weight: 600; border-radius: 6px; cursor: pointer; transition: all 0.2s; border: none; background: transparent; color: var(--text-secondary); font-family: 'DM Sans', sans-serif; }
.signin-tab.active { background: var(--accent); color: #0d1117; }

/* PAYMENT GATE */
.gate-steps { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.gate-step { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; font-size: 13px; color: var(--text-secondary); }
.gate-step:last-child { margin-bottom: 0; }
.gate-step-num { width: 20px; height: 20px; background: var(--accent-dim); border: 1px solid var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--accent); flex-shrink: 0; }

/* STREAK BADGES */
.badge-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.streak-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-fire { background: rgba(255,100,0,0.15); border: 1px solid rgba(255,100,0,0.4); color: #ff6400; }
.badge-unstoppable { background: rgba(88,166,255,0.15); border: 1px solid rgba(88,166,255,0.4); color: var(--blue); }
.badge-diamond { background: rgba(188,140,255,0.15); border: 1px solid rgba(188,140,255,0.4); color: var(--purple); }
.badge-legend { background: rgba(255,215,0,0.15); border: 2px solid gold; color: gold; }

/* ADMIN PANEL */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
.admin-tabs-wrap { overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.admin-tabs-wrap::-webkit-scrollbar { display: none; }
.admin-tabs { display: flex; gap: 0; white-space: nowrap; min-width: max-content; }
.admin-tab { padding: 10px 16px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s; background: none; border-top: none; border-left: none; border-right: none; font-family: 'DM Sans', sans-serif; display: inline-flex; align-items: center; gap: 5px; }
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.admin-section-title { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 20px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.stat-value { font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 3px; }
.list-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; gap: 10px; }
.list-item:hover { border-color: var(--accent); }
.list-item-info { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.list-actions { display: flex; gap: 5px; flex-shrink: 0; }
.icon-btn { width: 28px; height: 28px; border-radius: 5px; border: 1px solid var(--border); background: var(--bg-hover); color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; transition: all 0.2s; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn.danger:hover { border-color: var(--red); color: var(--red); }
.toggle-switch { width: 36px; height: 20px; background: var(--border); border-radius: 10px; cursor: pointer; position: relative; transition: background 0.2s; border: none; flex-shrink: 0; }
.toggle-switch.on { background: var(--accent); }
.toggle-switch::after { content: ''; position: absolute; width: 14px; height: 14px; background: white; border-radius: 50%; top: 3px; left: 3px; transition: transform 0.2s; }
.toggle-switch.on::after { transform: translateX(16px); }
.pending-card { background: rgba(227,179,65,0.05); border: 1px solid rgba(227,179,65,0.25); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 8px; }
.confirmed-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* STREAK BAR */
.streak-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; font-size: 13px; }
.streak-count { font-weight: 700; color: var(--accent); font-size: 16px; }

/* RESPONSIVE */
@media (max-width: 768px) { .nav-links { display: none; } .feature-grid { grid-template-columns: repeat(3, 1fr); } .contacts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } .hero h1 { font-size: 30px; } }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.35s ease forwards; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.pulse { animation: pulse 2s ease infinite; }
