* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    background: #f3f5f8;
    color: #1a1a1a;
}

a { color: #1a5f2a; }

/* ── Admin login ── */
.login-page {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 10% 0%, rgba(37, 211, 102, 0.12), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 100%, rgba(26, 95, 42, 0.15), transparent 50%),
        linear-gradient(160deg, #0b1628 0%, #12243d 45%, #0d2818 100%);
    z-index: 0;
}

.login-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.login-frame {
    width: min(960px, 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 32px 64px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
}

.login-showcase {
    padding: 2.75rem 2.5rem;
    background: linear-gradient(165deg, rgba(26, 95, 42, 0.95) 0%, rgba(13, 40, 24, 0.98) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.login-showcase::before {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    top: -80px;
    right: -80px;
    pointer-events: none;
}

.login-showcase-inner {
    position: relative;
    max-width: 380px;
}

.login-mark {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #25d366, #1a5f2a);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
}

.login-mark-sm {
    width: 44px;
    height: 44px;
    font-size: 0.9375rem;
    border-radius: 12px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.login-eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.login-showcase h1 {
    margin: 0 0 1rem;
    font-size: clamp(1.5rem, 2.5vw, 1.875rem);
    line-height: 1.2;
    font-weight: 700;
}

.login-lead {
    margin: 0 0 1.75rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.65;
    font-size: 0.9375rem;
}

.login-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.login-checklist li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.92);
}

.login-checklist svg {
    color: #9fe870;
    flex-shrink: 0;
}

.login-panel {
    padding: 2.5rem 2.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.login-card {
    width: 100%;
    max-width: 360px;
}

.login-card-top {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.75rem;
}

.login-card-top .login-mark-sm {
    display: none;
}

.login-card-top h2 {
    margin: 0 0 0.2rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0b1628;
    letter-spacing: -0.02em;
}

.login-sub {
    margin: 0;
    color: #5f6b7a;
    font-size: 0.9375rem;
}

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: #fef3f2;
    border: 1px solid #fecdca;
    color: #912018;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

.login-alert svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.login-alert strong {
    display: block;
    font-size: 0.9375rem;
    margin-bottom: 0.1rem;
}

.login-form {
    display: grid;
    gap: 1.25rem;
}

.login-field label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: #344054;
    margin-bottom: 0.45rem;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #98a2b3;
    pointer-events: none;
    display: flex;
    line-height: 0;
}

.login-input-wrap input {
    width: 100%;
    padding: 0.75rem 2.75rem 0.75rem 2.65rem;
    border: 1.5px solid #e4e9ef;
    border-radius: 12px;
    font: inherit;
    font-size: 0.9375rem;
    color: #0b1628;
    background: #f9fafb;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-input-wrap input::placeholder {
    color: #98a2b3;
}

.login-input-wrap input:focus {
    outline: none;
    border-color: #1a5f2a;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(26, 95, 42, 0.1);
}

.login-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #667085;
    width: 36px;
    height: 36px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}

.login-toggle:hover {
    color: #344054;
    background: rgba(16, 24, 40, 0.05);
}

.login-toggle .icon-hide {
    display: none;
}

.login-toggle.visible .icon-show {
    display: none;
}

.login-toggle.visible .icon-hide {
    display: block;
}

.login-submit {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(180deg, #227038 0%, #1a5f2a 100%);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 4px 12px rgba(26, 95, 42, 0.25);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(26, 95, 42, 0.3);
}

.login-submit:active {
    transform: translateY(0);
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.8125rem;
    color: #98a2b3;
}

.login-footer svg {
    opacity: 0.7;
}

.login-back {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #5f6b7a;
    text-decoration: none;
    transition: color 0.15s;
}

.login-back:hover {
    color: #1a5f2a;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #12341c;
    color: #fff;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
}

.brand {
    padding: 0 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 1rem;
}

.brand strong {
    display: block;
    font-size: 1rem;
}

.brand span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.875rem;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.75rem;
    border-radius: 8px;
}

.sidebar nav a.active,
.sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.sidebar .logout {
    margin-top: auto;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 0.75rem;
}

.content {
    flex: 1;
    padding: 1.5rem 2rem;
}

.page-header h1 {
    margin: 0 0 1.5rem;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.card strong {
    display: block;
    font-size: 1.75rem;
    margin-bottom: 0.35rem;
}

.meta {
    color: #555;
    font-size: 0.875rem;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
}

input[type=text],
input[type=password],
input[type=number],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #cfd6df;
    border-radius: 8px;
    font: inherit;
}

textarea {
    min-height: 140px;
    resize: vertical;
}

.btn,
button {
    display: inline-block;
    padding: 0.65rem 1rem;
    border: 0;
    border-radius: 8px;
    font: inherit;
    cursor: pointer;
}

.btn-primary,
button.btn-primary {
    background: #1a5f2a;
    color: #fff;
}

.btn-secondary {
    background: #e8edf2;
    color: #1a1a1a;
    text-decoration: none;
}

.btn-danger {
    background: #b42318;
    color: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

th, td {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.85rem;
    text-align: left;
    vertical-align: top;
}

th {
    background: #eef2f7;
    font-size: 0.875rem;
}

.notice {
    background: #e8f5e9;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.notice.error {
    background: #fdecea;
    color: #8a1c1c;
}

.error {
    color: #b00020;
}

.form-grid {
    display: grid;
    gap: 1rem;
    max-width: 760px;
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: #e8edf2;
}

.badge.active {
    background: #e8f5e9;
    color: #1a5f2a;
}

.badge.inactive {
    background: #fdecea;
    color: #8a1c1c;
}

.badge.menu {
    background: #eef4ff;
    color: #1d4ed8;
}

.answer-preview {
    white-space: pre-wrap;
    font-size: 0.875rem;
    color: #444;
}

@media (max-width: 820px) {
    .login-frame {
        grid-template-columns: 1fr;
        max-width: 420px;
    }

    .login-showcase {
        display: none;
    }

    .login-panel {
        padding: 2rem 1.75rem 1.75rem;
    }

    .login-card-top .login-mark-sm {
        display: grid;
    }
}

@media (max-width: 900px) {
    .admin-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}
