:root {
    --color-bg: #def0f4;
    --color-surface: #ffffff;
    --color-surface-alt: #f8fafc;
    --color-text: #374151;
    --color-heading: #1f2937;
    --color-muted: #6b7280;
    --color-primary: #2563eb;
    --color-primary-light: #3b82f6;
    --color-primary-dark: #1d4ed8;
    --color-accent: #22c55e;
    --color-danger: #ef4444;
    --color-border: #e5e7eb;
    --color-footer: #0f172a;
    --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-card-hover: 0 10px 24px rgba(15, 23, 42, 0.12);
    --radius: 8px;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

#main {
    flex: 1;
    width: 100%;
}

h1, h2, h3 {
    color: var(--color-heading);
    line-height: 1.3;
}

h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5em;
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5em;
}

a {
    color: var(--color-primary);
}

/* ---- Header ---- */

.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo img {
    height: 32px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.nav-link {
    font-weight: 500;
    font-size: 0.925rem;
    color: var(--color-text);
    text-decoration: none;
    padding: 0.4em 0.9em;
    border-radius: 6px;
    transition: color 0.3s, background-color 0.3s;
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-link.active {
    color: var(--color-primary);
    background: #eff6ff;
}

.nav-auth {
    margin-left: 12px;
}

.menu-toggle {
    display: none;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle svg {
    stroke: var(--color-heading);
}

/* ---- Buttons ---- */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0 24px;
    height: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    color: white;
    background: linear-gradient(to right, var(--color-primary-light), var(--color-primary-dark));
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0 20px;
    height: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--color-primary);
    background: transparent;
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

.btn-danger-outline {
    display: inline-flex;
    align-items: center;
    padding: 0.35em 0.9em;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--color-danger);
    background: transparent;
    border: 1px solid var(--color-danger);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.btn-danger-outline:hover {
    background: var(--color-danger);
    color: white;
}

/* ---- Page layout ---- */

.page {
    max-width: 1200px;
    margin: auto;
    padding: 2em 20px 3em;
}

.page-header {
    margin-bottom: 1.5em;
}

.page-header p {
    color: var(--color-muted);
    margin-top: -0.25em;
}

/* ---- Cards ---- */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 1.5em;
    margin-bottom: 1em;
}

.card h2:first-child {
    margin-top: 0;
}

.card p:last-child {
    margin-bottom: 0;
}

/* ---- Forms ---- */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input:not([type]),
select,
textarea {
    width: 100%;
    padding: 0.55em 0.75em;
    font-size: 0.925rem;
    font-family: inherit;
    color: var(--color-heading);
    background: var(--color-surface);
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
input:not([type]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
}

.field > span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-heading);
}

/* ---- Badges ---- */

.badge {
    display: inline-block;
    padding: 0.15em 0.7em;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 999px;
    background: #f3f4f6;
    color: var(--color-muted);
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* ---- Empty state ---- */

.empty-state {
    text-align: center;
    padding: 3em 1.5em;
    color: var(--color-muted);
    background: var(--color-surface);
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius);
}

.empty-state strong {
    display: block;
    margin-bottom: 0.25em;
    font-size: 1rem;
    color: var(--color-heading);
}

/* ---- Progress ---- */

progress {
    width: 100%;
    height: 10px;
    appearance: none;
    -webkit-appearance: none;
    border: none;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
}

progress::-webkit-progress-bar {
    background: #e2e8f0;
}

progress::-webkit-progress-value {
    background: linear-gradient(to right, var(--color-primary-light), var(--color-primary-dark));
}

progress::-moz-progress-bar {
    background: linear-gradient(to right, var(--color-primary-light), var(--color-primary-dark));
}

.form-error {
    color: var(--color-danger);
    font-size: 0.875rem;
    min-height: 1.2em;
}

/* ---- Footer ---- */

.site-footer {
    background: var(--color-footer);
    padding: 40px 20px 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-logo img {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
}

.footer-text {
    margin: 20px 0;
    line-height: 1.6;
    color: #9ca3af;
}

.social-links a {
    color: #9ca3af;
    margin-right: 15px;
    text-decoration: none;
    transition: color 0.3s;
}

.social-links a:hover {
    color: #ffffff;
}

.site-footer h3 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer ul li {
    margin-bottom: 10px;
}

.site-footer ul li a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s;
}

.site-footer ul li a:hover {
    color: white;
}

.contact-item {
    display: flex;
    align-items: center;
}

.contact-item svg {
    margin-right: 8px;
    color: #9ca3af;
}

.footer-bottom {
    border-top: 1px solid #1f2937;
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #9ca3af;
}

/* ---- Mobile ---- */

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin: 0;
        padding: 12px 20px 16px;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
    }

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

    .nav-link {
        padding: 0.6em 0.9em;
    }

    .nav-auth {
        margin: 8px 0 0;
    }
}
