:root {
    --bg: #f3efe7;
    --bg-accent: radial-gradient(circle at top left, rgba(221, 115, 54, 0.24), transparent 34%), radial-gradient(circle at right, rgba(17, 120, 106, 0.18), transparent 32%), linear-gradient(180deg, #f7f3ea 0%, #efe7d8 100%);
    --panel: rgba(255, 255, 255, 0.82);
    --panel-strong: #fffdf8;
    --line: rgba(56, 44, 34, 0.12);
    --text: #1d1b18;
    --muted: #675f58;
    --primary: #c45724;
    --primary-strong: #9f4318;
    --secondary: #0d6a60;
    --danger: #a93030;
    --shadow: 0 24px 60px rgba(73, 47, 28, 0.14);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-accent);
    color: var(--text);
    font-family: "Plus Jakarta Sans", "Noto Sans Myanmar", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

code,
textarea,
input,
button {
    font: inherit;
}

.site-shell {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
}

.site-header nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.site-header nav a {
    color: var(--muted);
    font-weight: 600;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #e58a4e);
    color: #fff;
    box-shadow: 0 12px 24px rgba(196, 87, 36, 0.35);
}

.hero,
.admin-shell {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 24px;
}

.hero-copy,
.panel,
.info-card,
.redirect-card {
    background: var(--panel);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.hero-copy {
    padding: 38px;
}

.hero-copy h1,
.panel h1,
.panel h2,
.redirect-card h1,
.login-panel h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.panel h2,
.admin-list-panel h2 {
    font-size: clamp(1.4rem, 2vw, 2rem);
}

.lead {
    color: var(--muted);
    line-height: 1.7;
    margin: 0;
}

.eyebrow {
    margin-bottom: 12px;
    color: var(--secondary);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

.panel {
    padding: 28px;
}

.stack {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
}

label small {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.95);
    color: var(--text);
    border-radius: 16px;
    padding: 14px 16px;
    outline: none;
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

input:focus,
textarea:focus {
    border-color: rgba(196, 87, 36, 0.45);
    box-shadow: 0 0 0 4px rgba(196, 87, 36, 0.12);
}

textarea {
    resize: vertical;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button.primary {
    background: linear-gradient(135deg, var(--primary), #de7d43);
    color: #fff;
    box-shadow: 0 14px 24px rgba(196, 87, 36, 0.26);
}

.button.ghost {
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--line);
    color: var(--text);
}

.button.danger {
    background: rgba(169, 48, 48, 0.1);
    color: var(--danger);
    border-color: rgba(169, 48, 48, 0.2);
}

.button.small {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.9rem;
}

.stats,
.info-grid {
    display: grid;
    gap: 16px;
}

.stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 28px;
}

.stat-card,
.info-card,
.helper-box {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.62);
}

.stat-card strong {
    display: block;
    font-size: 1.55rem;
    letter-spacing: -0.05em;
}

.stat-card span,
.helper-box span,
.mini-meta,
.empty-state,
.login-note,
.redirect-note {
    color: var(--muted);
}

.public-panel {
    align-self: start;
}

.helper-box {
    display: grid;
    gap: 8px;
}

.helper-box a {
    color: var(--secondary);
    font-weight: 700;
}

.info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 24px;
}

.info-card {
    padding: 24px;
}

.info-card h3 {
    margin-top: 0;
    letter-spacing: -0.03em;
}

.flash-stack {
    display: grid;
    gap: 10px;
}

.flash {
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 600;
}

.flash.error {
    background: rgba(169, 48, 48, 0.1);
    color: #872525;
}

.flash.success {
    background: rgba(13, 106, 96, 0.12);
    color: #0c5e55;
}

.flash.result {
    background: rgba(196, 87, 36, 0.1);
    color: #9f4318;
    word-break: break-all;
}

.admin-shell {
    align-items: start;
}

.admin-column,
.visit-list {
    display: grid;
    gap: 24px;
}

.admin-tabs-panel {
    display: grid;
    gap: 22px;
}

.menu-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text) !important;
    letter-spacing: normal;
    cursor: pointer;
    text-align: center;
    box-shadow: none;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.menu-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(29, 27, 24, 0.08);
}

.menu-toggle.is-open {
    border-color: rgba(196, 87, 36, 0.35);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 10px 18px rgba(29, 27, 24, 0.08);
}

.menu-icon {
    width: 18px;
    height: 2px;
    background: var(--text);
    position: relative;
    border-radius: 999px;
    transition: transform 160ms ease;
}

.menu-icon::before,
.menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 999px;
}

.menu-icon::before {
    top: -5px;
}

.menu-icon::after {
    top: 5px;
}

.menu-toggle.is-open .menu-icon {
    transform: rotate(90deg);
}

.menu-label {
    font-size: 0.9rem;
    font-weight: 700;
}

.menu-current {
    min-height: 38px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.62);
    color: var(--muted);
    font-size: 0.88rem;
}

.menu-current strong {
    margin-left: 6px;
    color: var(--text);
}

.menu-caret {
    width: 8px;
    height: 8px;
    border-right: 1.8px solid var(--muted);
    border-bottom: 1.8px solid var(--muted);
    transform: rotate(45deg);
    transition: transform 160ms ease, border-color 160ms ease;
}

.menu-toggle.is-open .menu-caret {
    transform: rotate(-135deg);
    border-color: var(--primary);
}

.menu-panel {
    display: grid;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.menu-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: normal;
    color: var(--text);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.menu-link:hover {
    transform: translateY(-1px);
    border-color: rgba(196, 87, 36, 0.26);
    box-shadow: 0 8px 14px rgba(29, 27, 24, 0.08);
}

.menu-link.active {
    background: linear-gradient(135deg, var(--primary), #de7d43);
    color: #fff;
    border-color: rgba(159, 67, 24, 0.5);
}

.tab-panel {
    display: grid;
    gap: 18px;
}

.tab-intro {
    padding: 18px 20px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.56);
}

.tab-intro h2 {
    margin: 0 0 8px;
}

.section-head,
.link-card-top,
.card-actions,
.button-row,
.redirect-actions,
.redirect-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-list-panel,
.admin-form-panel {
    min-height: 100%;
}

.link-list {
    display: grid;
    gap: 14px;
}

.link-card {
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.6);
}

.link-card p {
    margin: 14px 0;
}

.link-card a[target="_blank"] {
    color: var(--secondary);
    word-break: break-all;
}

.badge {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(13, 106, 96, 0.1);
    color: var(--secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

.badge-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.badge.subtle {
    background: rgba(29, 27, 24, 0.06);
    color: var(--muted);
}

.mini-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.88rem;
}

.toggle-card {
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.58);
}

.toggle-card input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.toggle-card strong {
    display: block;
    margin-bottom: 6px;
}

.visits-panel h2,
.settings-panel h2 {
    margin-top: 0;
}

.visit-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.58);
}

.visit-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.visit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    color: var(--muted);
    font-size: 0.92rem;
}

.visit-grid strong {
    color: var(--text);
    margin-right: 6px;
}

.card-actions {
    margin-top: 16px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.card-actions form {
    margin: 0;
}

.login-shell,
.redirect-card {
    width: min(640px, 100%);
    margin: 8vh auto 0;
}

.login-panel,
.redirect-card {
    padding: 34px;
}

.redirect-card h1 {
    font-size: clamp(1.9rem, 5vw, 3.1rem);
}

.redirect-meta {
    margin-top: 22px;
    justify-content: flex-start;
    flex-wrap: wrap;
    color: var(--muted);
}

.redirect-meta code {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 12px;
    border: 1px solid var(--line);
    word-break: break-all;
}

@media (max-width: 980px) {
    .hero,
    .admin-shell,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .site-shell {
        width: min(100% - 20px, 100%);
        padding-top: 18px;
    }

    .site-header,
    .section-head,
    .link-card-top,
    .visit-top,
    .button-row,
    .redirect-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-copy,
    .panel,
    .login-panel,
    .redirect-card {
        padding: 22px;
        border-radius: 22px;
    }

    .button,
    .site-header nav a {
        width: 100%;
    }

    .visit-grid {
        grid-template-columns: 1fr;
    }

    .badge-row {
        justify-content: flex-start;
    }

    .menu-toggle,
    .menu-link,
    .menu-current {
        width: 100%;
    }

    .menu-bar {
        display: grid;
        align-items: stretch;
    }

    .site-header nav {
        width: 100%;
    }
}
