:root {
    --primary: #ff6b6b;
    --primary-dark: #e6455f;
    --secondary: #3f3d56;
    --background: #f6f8fb;
    --surface: #ffffff;
    --accent: #4ecdc4;
    --text: #2f2e41;
    --muted: #6c6a7d;
    --shadow: 0 18px 45px rgba(63, 61, 86, 0.12);
    --radius-lg: 18px;
    --radius-sm: 10px;
    --transition: all 0.25s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
}

body {
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

.page-wrapper {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 10px 30px rgba(63, 61, 86, 0.08);
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.nav-links a {
    text-decoration: none;
    font-weight: 500;
    color: var(--secondary);
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a:focus {
    background: rgba(255, 107, 107, 0.12);
    color: var(--primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.4rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(255, 107, 107, 0.25);
    transition: var(--transition);
}

.btn:hover,
.btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 18px 35px rgba(255, 107, 107, 0.35);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid rgba(255, 107, 107, 0.6);
    box-shadow: none;
}

.btn-outline:hover,
.btn-outline:focus {
    background: rgba(255, 107, 107, 0.12);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    margin-left: auto;
}

.nav-toggle span {
    width: 24px;
    height: 3px;
    border-radius: 999px;
    background: var(--secondary);
    transition: var(--transition);
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.main-content {
    flex: 1;
    padding: 3rem 1.5rem 4rem;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.container h1,
.container h2,
.container h3 {
    color: var(--secondary);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.container p {
    color: var(--muted);
}

.container section + section,
.container .card-grid,
.container form {
    margin-top: 1.5rem;
}

form {
    display: grid;
    gap: 1rem;
}

label {
    font-weight: 600;
    color: var(--secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(63, 61, 86, 0.15);
    border-radius: var(--radius-sm);
    background: #fff;
    font: inherit;
    transition: var(--transition);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

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

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
}

th,
td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(63, 61, 86, 0.08);
}

th {
    background: rgba(255, 107, 107, 0.08);
    color: var(--secondary);
    font-weight: 600;
}

tr:hover td {
    background: rgba(63, 61, 86, 0.03);
}

.card-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(78, 205, 196, 0.15);
    color: var(--accent);
}

.flash-container {
    max-width: 1100px;
    margin: 0 auto 1.5rem;
    display: grid;
    gap: 0.75rem;
}

.flash-message {
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    box-shadow: var(--shadow);
}

.flash-message.success { background: #e8fdf4; color: #1b8a5a; }
.flash-message.error { background: #ffe8e8; color: #d64545; }
.flash-message.warning { background: #fff4e5; color: #b7791f; }
.flash-message.info { background: #e5f1ff; color: #1a56db; }

.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .navbar {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links,
    .nav-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        display: none;
    }

    .nav-links.open,
    .nav-actions.open {
        display: flex;
    }

    .nav-links {
        order: 3;
        margin-left: 0;
    }

    .nav-actions {
        order: 2;
        margin-left: 0;
    }

    .nav-links a {
        padding: 0.75rem 1rem;
    }

    .container {
        padding: 2rem;
    }
}

@media (max-width: 600px) {
    .main-content {
        padding: 2rem 1rem 3rem;
    }

    .container {
        padding: 1.6rem;
    }

    .btn {
        width: 100%;
    }
}
