:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f0f4ff;
    --text: #18202a;
    --muted: #5d6978;
    --border: #dde5f0;
    --primary: #2962ff;
    --primary-dark: #1746c6;
    --success-bg: #ecfdf3;
    --success-text: #166534;
    --error-bg: #fef2f2;
    --error-text: #b91c1c;
    --shadow: 0 18px 40px rgba(21, 34, 50, 0.08);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --container: 1120px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
}

img {
    display: block;
    max-width: 100%;
}

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

.container {
    width: min(calc(100% - 32px), var(--container));
    margin: 0 auto;
}

.site-page {
    max-width: 640px;
    margin: 0 auto;
    background: #ffffff;
    box-shadow: var(--shadow);
    min-height: 100vh;
}

.hero {
    padding: 56px 0 36px;
}

.hero__content {
    display: flex;
    gap: 24px;
    justify-content: space-between;
    align-items: flex-end;
    padding: 32px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(221, 229, 240, 0.8);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.eyebrow {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero h1,
.contact-card h2,
.login-card h1,
.admin-header h1,
.empty-state h2 {
    margin: 0 0 12px;
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1.15;
}

.hero__text,
.contact-card__intro p,
.login-hint,
.admin-subtitle,
.empty-state p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.7;
}

.hero__actions,
.admin-header__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    border: 1px solid transparent;
    transition: 0.2s ease;
    cursor: pointer;
}

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

.button--primary {
    color: #ffffff;
    background: var(--primary);
}

.button--primary:hover {
    background: var(--primary-dark);
}

.button--ghost {
    color: var(--text);
    background: #ffffff;
    border-color: var(--border);
}

.button--block {
    width: 100%;
}

.notice-wrap {
    margin-bottom: 24px;
}

.notice {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
}

.notice--success {
    color: var(--success-text);
    background: var(--success-bg);
    border-color: #bbf7d0;
}

.notice--error {
    color: var(--error-text);
    background: var(--error-bg);
    border-color: #fecaca;
}

.gallery {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0;
}

.gallery__item {
    width: 100%;
    margin: 0;
    overflow: hidden;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    line-height: 0;
}

.gallery__item img {
    width: 100%;
    height: auto;
    display: block;
}

.contact-section {
    padding: 0 0 56px;
}

.contact-card,
.login-card,
.table-card,
.stats-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.contact-card {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 40px 24px;
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--border);
    box-shadow: none;
}

.contact-card__intro {
    text-align: center;
}

.floating-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 80px;
    height: 80px;
    background: var(--primary);
    color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(41, 98, 255, 0.3);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    line-height: 1.1;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.floating-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 12px 32px rgba(41, 98, 255, 0.4);
}

.floating-btn svg {
    margin-bottom: 2px;
}

@media (min-width: 680px) {
    .floating-btn {
        right: calc(50% - 320px - 100px);
        bottom: 40px;
    }
}

.contact-form {
    display: grid;
    gap: 16px;
}

.contact-form label {
    display: grid;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}

.contact-form input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text);
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(41, 98, 255, 0.12);
}

.empty-state {
    padding: 48px 24px;
    text-align: center;
}

.admin-page {
    min-height: 100vh;
    background: #f8fafc;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
}

.admin-login-page {
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 100%);
}

.login-shell {
    width: min(100%, 420px);
}

.login-card {
    padding: 40px;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
    text-align: center;
}

.login-card h1 {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
}

.login-card .eyebrow {
    color: var(--primary);
    font-size: 13px;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.login-hint {
    color: #64748b;
    font-size: 15px;
    margin-bottom: 32px;
}

.login-card .contact-form {
    text-align: left;
}

.login-card input {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    height: 52px;
    font-size: 15px;
}

.login-card input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(41, 98, 255, 0.1);
}

.login-card .button {
    height: 52px;
    font-size: 16px;
    margin-top: 8px;
    box-shadow: 0 8px 16px -4px rgba(41, 98, 255, 0.25);
}

.login-card .button:hover {
    box-shadow: 0 12px 20px -4px rgba(41, 98, 255, 0.35);
}

.back-link {
    display: inline-block;
    margin-top: 24px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: #0f172a;
}

.admin-header {
    background: #ffffff;
    padding: 24px 0;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.admin-header .eyebrow {
    display: none;
}

.admin-subtitle {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

.admin-header__actions .button {
    min-height: 40px;
    padding: 0 16px;
    font-size: 14px;
}

.admin-main {
    display: grid;
    gap: 24px;
    padding-top: 32px;
    padding-bottom: 64px;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 16px 24px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.02);
}

.filter-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-stats span {
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
}

.filter-stats strong {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.filter-label {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

.filter-bar select,
.filter-bar input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #0f172a;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.2s;
}

.filter-bar select:focus,
.filter-bar input[type="date"]:focus {
    border-color: var(--primary);
}

.button--small {
    min-height: 36px;
    padding: 0 16px;
    font-size: 13px;
    border-radius: 8px;
}

.button--danger {
    background: #ef4444;
    color: white;
}

.button--danger:hover {
    background: #dc2626;
}

.button--success {
    background: #10b981;
    color: white;
}

.button--success:hover {
    background: #059669;
}

.bulk-actions {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.table-card {
    padding: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.02);
    overflow: hidden;
}

.table-wrap {
    overflow-x: auto;
}

.message-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 800px;
}

.message-table th,
.message-table td {
    padding: 18px 24px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    font-size: 15px;
    vertical-align: middle;
}

.message-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

.message-table tbody tr {
    transition: background-color 0.2s;
}

.message-table tbody tr:hover {
    background: #f8fafc;
}

.message-table td:first-child {
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.message-table td a {
    color: var(--primary);
    font-weight: 500;
}

.message-table td a:hover {
    text-decoration: underline;
}

.empty-state--admin {
    padding: 80px 24px;
    color: #64748b;
}

.empty-state--admin h2 {
    color: #0f172a;
    font-size: 20px;
    margin-bottom: 8px;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.pagination-info {
    font-size: 14px;
    color: #64748b;
}

.pagination-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-link,
.page-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: 6px;
    text-decoration: none;
}

.page-link {
    background: #f1f5f9;
    color: #475569;
    transition: all 0.2s;
}

.page-link:hover:not(.disabled) {
    background: #e2e8f0;
    color: #0f172a;
}

.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-dots {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    min-width: 24px;
    height: 32px;
    padding-bottom: 6px;
    color: #94a3b8;
}

.page-current {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
}

@media (max-width: 900px) {
    .hero__content,
    .contact-card,
    .admin-header__inner {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .hero {
        padding-top: 28px;
    }

    .hero__content,
    .contact-card,
    .login-card {
        padding: 24px;
    }

    .hero__actions,
    .admin-header__actions {
        width: 100%;
    }

    .hero__actions .button,
    .admin-header__actions .button {
        width: 100%;
    }
}
