/* ── CSS Variables ─────────────────────────────────────────────────────────── */
:root {
    --gc-dark: #064E3B;
    --gc-mid: #059669;
    --gc-accent: #10B981;
    --gc-light: #34D399;
    --gc-pale: #D1FAE5;
    --gc-bg: #F0FDF4;
    --gc-text: #0A2E23;
    --gc-text-light: #6B7280;
    --gc-white: #FFFFFF;
}

/* ── Reset & Base ──────────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    background: var(--gc-white);
    color: #1c1c1e;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

/* ── Nav ───────────────────────────────────────────────────────────────────── */
nav {
    background: var(--gc-dark);
    border-bottom: none;
    padding: 0 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 52px;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.env-badge {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #fff;
    background: #ef4444;
    border-radius: 6px;
    vertical-align: middle;
}

/* ── Desktop nav links ────────────────────────────────────────────────────── */
.nav-links {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
    margin-right: 0.75rem;
}

.nav-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* ── Hamburger button ─────────────────────────────────────────────────────── */
.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    -webkit-tap-highlight-color: transparent;
    z-index: 120;
}

.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.2s;
}

.hamburger-btn.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Hamburger menu (slide-in) ───────────────────────────────────────────── */
.hamburger-menu {
    position: fixed;
    top: 52px;
    right: -260px;
    width: 240px;
    background: rgba(255,255,255,0.97);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-radius: 0 0 0 14px;
    box-shadow: -4px 4px 20px rgba(0,0,0,0.15);
    z-index: 110;
    transition: right 0.25s ease;
    padding: 0.5rem 0;
}

.hamburger-menu.open { right: 0; }

.hamburger-menu a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: #1c1c1e;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.1s;
}

.hamburger-menu a:hover { background: rgba(0,0,0,0.04); }

.hamburger-divider {
    height: 1px;
    background: rgba(0,0,0,0.06);
    margin: 0.25rem 1rem;
}

.menu-disabled {
    opacity: 0.35 !important;
    pointer-events: none;
}

.hamburger-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 105;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-overlay.open { display: block; }

/* ── Main ──────────────────────────────────────────────────────────────────── */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

/* ── Header row ────────────────────────────────────────────────────────────── */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

h1 {
    font-size: 1.7rem;
    color: #1c1c1e;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.2rem;
    color: #1c1c1e;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 0.9rem;
    background: var(--gc-dark);
    color: white;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover { background: var(--gc-mid); }
.btn:active { transform: scale(0.96); }

.btn-secondary {
    background: rgba(16,185,129,0.1);
    color: var(--gc-accent);
}
.btn-secondary:hover { background: rgba(16,185,129,0.18); color: var(--gc-dark); }

.btn-danger { background: #ff3b30; }
.btn-danger:hover { background: #d70015; }

.btn-small {
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
    border-radius: 7px;
}

.btn-group {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Icon buttons (filter, 3-dot) ────────────────────────────────────────── */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(118,118,128,0.12);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: #8e8e93;
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.icon-btn:hover { background: rgba(118,118,128,0.2); }
.icon-btn.active { background: rgba(16,185,129,0.12); color: var(--gc-accent); }

/* ── Page kebab menu with search ─────────────────────────────────────────── */
.kebab-menu-search {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.kebab-menu-search input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    font-size: 0.82rem;
    background: rgba(118,118,128,0.08);
    color: #1c1c1e;
    font-family: inherit;
}

.kebab-menu-search input:focus {
    outline: none;
    border-color: var(--gc-accent);
    box-shadow: 0 0 0 2px rgba(16,185,129,0.15);
}

.kebab-menu-search input::placeholder { color: #8e8e93; }

/* ── Sticky controls (frozen headers for long lists) ──────────────────────── */
.sticky-controls {
    position: sticky;
    top: 52px;
    z-index: 15;
    background: var(--gc-white);
    padding-top: 0.5rem;
    padding-bottom: 0.25rem;
}

/* ── Flash messages ────────────────────────────────────────────────────────── */
.flash-msg {
    background: var(--gc-pale);
    color: var(--gc-dark);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty {
    text-align: center;
    color: #8e8e93;
    padding: 3rem 1rem;
    font-size: 1rem;
}

.empty a { color: var(--gc-accent); }

/* ── Scroll loader ───────────────────────────────────────────────────────── */
.scroll-loader {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0;
}
.scroll-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e5e5ea;
    border-top-color: var(--gc-accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive button labels ─────────────────────────────────────────────── */
.btn-label-short { display: none; }
.btn-label-full { display: inline; }
