* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6fb;
    color: #1f2937;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.admin-container {
    max-width: 1100px;
}

header h1 {
    margin: 0 0 8px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.card, .panel {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
}

.big {
    font-size: 32px;
    font-weight: bold;
    margin: 0;
}

.status.ok {
    color: #047857;
}

.status.warn {
    color: #b45309;
}

label {
    display: block;
    margin-bottom: 14px;
}

input[type="text"],
input[type="password"],
input[type="file"] {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}

button, .button {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 12px 18px;
    cursor: pointer;
    text-decoration: none;
    font-size: 15px;
}

button:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

.button.primary {
    background: #2563eb;
}

.button.secondary {
    background: #374151;
}

.button.large {
    width: 100%;
    padding: 16px 20px;
    font-size: 17px;
    font-weight: bold;
}

.button.create {
    background: #059669;
}

.button.create:hover {
    background: #047857;
}

.button.delete {
    background: #dc2626;
}

.button.delete:hover {
    background: #b91c1c;
}

.action-buttons {
    display: grid;
    gap: 14px;
    margin-top: 8px;
}

.action-form {
    margin: 0;
}

.result {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    white-space: pre-wrap;
}

.result.hidden {
    display: none;
}

.result.ok, .warn-panel {
    background: #ecfdf5;
    color: #065f46;
}

.result.error {
    background: #fef2f2;
    color: #991b1b;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.info-table th {
    width: 180px;
    color: #6b7280;
    font-weight: 600;
}

code, pre {
    display: block;
    background: #111827;
    color: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
}

code.inline {
    display: inline;
    padding: 3px 6px;
    font-size: 13px;
}

footer, .admin-footer {
    margin-top: 24px;
}

footer a, .admin-footer a, .text-link {
    color: #2563eb;
    text-decoration: none;
}

.landing-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 45%, #ecfeff 100%);
}

.landing-card {
    width: 100%;
    max-width: 520px;
    background: #fff;
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
    text-align: center;
}

.landing-card.narrow {
    max-width: 420px;
}

.landing-icon {
    font-size: 42px;
    margin-bottom: 8px;
}

.landing-card h1 {
    margin: 0 0 12px;
    font-size: 30px;
}

.landing-message {
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 20px;
}

.landing-stats {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f3f4f6;
    font-size: 13px;
    color: #374151;
}

.pill.ok {
    background: #dcfce7;
    color: #166534;
}

.pill.warn {
    background: #fef3c7;
    color: #92400e;
}

.landing-form {
    margin: 8px 0 12px;
}

.landing-note {
    color: #6b7280;
    font-size: 14px;
    margin: 0 0 20px;
}

.landing-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.panel-note {
    margin-top: 12px;
}

/* ── Mobile app homepage ── */
.mobile-app {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #0b1220;
    color: #f1f5f9;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow-x: hidden;
}

.mobile-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(59, 130, 246, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(16, 185, 129, 0.08), transparent),
        #0b1220;
    pointer-events: none;
    z-index: 0;
}

.mobile-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding:
        max(12px, env(safe-area-inset-top))
        max(20px, env(safe-area-inset-right))
        max(28px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));
    max-width: 420px;
    margin: 0 auto;
}

/* ── Top bar ── */
.mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 0 8px;
}

.mobile-topbar-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #334155;
}

.mobile-topbar-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
}

/* ── Hero ── */
.mobile-hero {
    text-align: center;
    padding: 32px 8px 40px;
}

.mobile-hero-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(51, 65, 85, 0.6));
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.mobile-hero h1 {
    margin: 0 0 16px;
    font-size: 36px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #f8fafc;
}

.mobile-hero-sub {
    margin: 0;
    font-size: 16px;
    line-height: 1.55;
    color: #94a3b8;
    font-weight: 400;
}

/* ── Section breaks ── */
.mobile-break {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.25), transparent);
    margin: 0 16px 32px;
}

.mobile-break-sm {
    margin-bottom: 24px;
}

.mobile-break-lg {
    flex: 1;
    min-height: 32px;
    margin-top: 40px;
    margin-bottom: 24px;
    background: none;
}

/* ── Toast ── */
.mobile-toast {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0 4px 0;
    padding: 18px 20px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.5;
    animation: toastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-toast-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
}

.mobile-toast-text {
    flex: 1;
    padding-top: 3px;
}

.mobile-toast.ok {
    background: rgba(16, 185, 129, 0.12);
    color: #a7f3d0;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.mobile-toast.ok .mobile-toast-icon {
    background: rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
}

.mobile-toast.error {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.mobile-toast.error .mobile-toast-icon {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Section ── */
.mobile-section {
    padding: 0 4px;
}

.mobile-section-label {
    margin: 0 0 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mobile-action-form {
    margin: 0;
}

/* ── OR divider break ── */
.mobile-or-break {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 8px;
}

.mobile-or-line {
    flex: 1;
    height: 1px;
    background: rgba(148, 163, 184, 0.2);
}

.mobile-or-text {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #475569;
    padding: 6px 12px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.12);
}

/* ── Action cards ── */
.mobile-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 96px;
    padding: 22px 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease;
    -webkit-user-select: none;
    user-select: none;
}

.mobile-card:active {
    transform: scale(0.975);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.mobile-card.create {
    background: linear-gradient(135deg, #059669 0%, #047857 50%, #065f46 100%);
}

.mobile-card.delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
}

.mobile-card-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
}

.mobile-card-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.mobile-card-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.mobile-card-desc {
    font-size: 14px;
    line-height: 1.45;
    opacity: 0.88;
    font-weight: 400;
}

.mobile-card-arrow {
    flex-shrink: 0;
    font-size: 28px;
    font-weight: 300;
    opacity: 0.7;
    line-height: 1;
    padding-right: 4px;
}

/* ── Footer ── */
.mobile-footer {
    text-align: center;
    padding-bottom: 8px;
}

.mobile-footer-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.2), transparent);
    margin-bottom: 20px;
}

.mobile-footer p {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    letter-spacing: 0.04em;
}

.mobile-footer-sub {
    margin-top: 6px !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    color: #334155 !important;
    letter-spacing: 0.06em !important;
}

@media (min-width: 421px) {
    .mobile-shell {
        padding-top: 24px;
    }

    .mobile-hero {
        padding-top: 40px;
    }

    .mobile-card {
        min-height: 104px;
        padding: 24px 22px;
    }
}

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

    table {
        display: block;
        overflow-x: auto;
    }
}
