* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #f4f7fb 0%, #e9eef6 100%);
    color: #18212f;
}

a {
    color: #0f5cc0;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card,
.panel,
.stat-card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(21, 37, 63, 0.08);
}

.login-card {
    width: min(460px, 100%);
    padding: 32px;
    display: grid;
    gap: 24px;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #5f6f85;
}

h1,
h2,
p {
    margin-top: 0;
}

.muted {
    color: #5f6f85;
}

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

label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.upload-stack {
    margin-top: 8px;
}

input,
textarea,
button,
.button {
    border-radius: 12px;
    border: 1px solid #cfd8e6;
    font: inherit;
}

input,
textarea {
    width: 100%;
    padding: 12px 14px;
    background: #f9fbff;
}

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

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    background: #0f5cc0;
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
}

.button.secondary {
    background: #ffffff;
    color: #18212f;
}

.button.small {
    padding: 8px 12px;
    font-size: 14px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 24px 32px 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page {
    padding: 24px 32px 32px;
    display: grid;
    gap: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
}

.stat-card,
.panel {
    padding: 20px;
}

.stat-card strong {
    display: block;
    margin-top: 10px;
    font-size: 30px;
}

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

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

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

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

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

.alert.success {
    background: #e8f6ee;
    color: #21663c;
}

.alert.error {
    background: #fdebec;
    color: #9d2831;
}

.pagination {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.page-link {
    min-width: 38px;
    padding: 8px 10px;
    border: 1px solid #cfd8e6;
    border-radius: 10px;
    background: #ffffff;
    text-align: center;
    text-decoration: none;
}

.page-link.active {
    background: #0f5cc0;
    color: #ffffff;
    border-color: #0f5cc0;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.image-card {
    padding: 16px;
    border: 1px solid #e6ecf4;
    border-radius: 14px;
    background: #f9fbff;
}

.preview {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #d8e1ef;
    margin: 12px 0 10px;
    background: #f3f6fb;
}

@media (max-width: 720px) {
    .topbar,
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page,
    .topbar {
        padding-left: 18px;
        padding-right: 18px;
    }
}
