:root {
    --bg: #f4f7f6;
    --surface: #ffffff;
    --text: #22303c;
    --muted: #64748b;
    --primary: #00695c;
    --primary-dark: #004d40;
    --danger: #b42318;
    --border: #dbe3e8;
    --shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    background: radial-gradient(circle at top right, #d8f3e8 0%, #f4f7f6 45%);
    color: var(--text);
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    background: linear-gradient(180deg, #073b3a 0%, #0b5a59 100%);
    color: #ecfeff;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.brand {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.nav-link {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: #ccfbf1;
    text-decoration: none;
    margin-bottom: 6px;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(236, 254, 255, 0.18);
    color: #fff;
}

.logout-form {
    margin-top: auto;
}

.main-content {
    padding: 28px;
}

.page-head {
    margin-bottom: 18px;
}

.page-head h1 {
    margin: 0 0 6px;
}

.page-head p {
    margin: 0;
    color: var(--muted);
}

.page-head.with-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 18px;
}

.form-grid {
    display: grid;
    gap: 12px;
}

.form-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.92rem;
    color: #3b4a5a;
}

input,
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    background: #fff;
}

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

.btn {
    display: inline-block;
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
}

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

.btn.small {
    padding: 8px 10px;
    font-size: 0.85rem;
}

.btn.danger {
    background: var(--danger);
}

.alert {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.alert.error {
    background: #fdecec;
    border: 1px solid #f4c7c3;
    color: #8b1d18;
}

.alert.success {
    background: #ecfdf3;
    border: 1px solid #b7e5c4;
    color: #075e36;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.filter-row input,
.filter-row select {
    max-width: 280px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

th {
    background: #f8fbfa;
    font-size: 0.88rem;
    color: #43617b;
}

.thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.preview {
    max-width: 140px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.action-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.stat-card {
    background: var(--surface);
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 16px;
}

.stat-card h3 {
    margin: 0;
    color: #3d566e;
    font-size: 0.96rem;
}

.stat-card p {
    margin: 10px 0 0;
    font-size: 1.6rem;
    font-weight: 700;
}

.pagination {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.muted {
    color: var(--muted);
    font-size: 0.85rem;
}

.guest-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, #d8f3e8 0%, #f4f7f6 70%);
}

.guest-container {
    width: min(420px, calc(100% - 28px));
}

.auth-card h1 {
    margin-top: 0;
    margin-bottom: 14px;
}

.profile-head {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #dbe3e8;
}

@media (max-width: 920px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 5;
        flex-direction: row;
        overflow: auto;
        align-items: center;
        gap: 10px;
    }

    .sidebar nav {
        display: flex;
        gap: 8px;
    }

    .nav-link {
        margin-bottom: 0;
        white-space: nowrap;
    }

    .logout-form {
        margin-top: 0;
        margin-left: auto;
    }

    .form-grid.two-col {
        grid-template-columns: 1fr;
    }
}
