/* Global look & feel ----------------------------------------------------- */
:root {
    --mim-bg: #f5f7fb;
    --mim-card-bg: #ffffff;
    --mim-card-border: #e7ecf5;
    --mim-card-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
    --mim-text: #1f2544;
    --mim-muted: #6b7280;
    --mim-primary: #1a73e8;
    --mim-success: #059669;
    --mim-danger: #dc2626;
    --mim-radius: 16px;
}

body {
    font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--mim-bg);
    color: var(--mim-text);
    line-height: 1.6;
}

.container,
.container-fluid {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.card {
    border: 1px solid var(--mim-card-border);
    border-radius: var(--mim-radius);
    box-shadow: var(--mim-card-shadow);
}

.card-header {
    background: var(--mim-card-bg);
    border-bottom: 1px solid var(--mim-card-border);
}

.card + .card {
    margin-top: 1.25rem;
}

footer {
    margin-top: 2rem;
    padding: 1.5rem 0;
    background: var(--mim-card-bg);
    border-top: 1px solid var(--mim-card-border);
}

/* Flash messages --------------------------------------------------------- */
.flashes {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.flashes li {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.85rem;
    font-weight: 500;
}

.flashes .success {
    background: rgba(5, 150, 105, 0.12);
    color: var(--mim-success);
}

.flashes .error,
.flashes .danger {
    background: rgba(220, 38, 38, 0.12);
    color: var(--mim-danger);
}

.flashes .warning {
    background: rgba(234, 179, 8, 0.12);
    color: #92400e;
}

/* Tables ----------------------------------------------------------------- */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--mim-card-shadow);
    margin-bottom: 1.5rem;
    background: #fff;
}

.styled-table thead {
    background: var(--mim-primary);
    color: #fff;
}

.styled-table th,
.styled-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--mim-card-border);
}

.styled-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.styled-table tbody tr:last-child td {
    border-bottom: none;
}

/* Utility classes -------------------------------------------------------- */
.link-container {
    margin-bottom: 1rem;
}

.styled-link {
    margin-right: 1rem;
    text-decoration: none;
    color: var(--mim-primary);
    font-weight: 600;
}

.styled-link:hover {
    text-decoration: underline;
}

.subnav-toolbar {
    position: sticky;
    top: 84px;
    z-index: 900;
    background: var(--mim-bg);
    padding: 0.5rem 0;
    border-radius: var(--mim-radius);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.subnav-toolbar .btn {
    border-radius: 999px;
}

.form-control,
.form-select {
    min-height: 42px;
    border-radius: 10px;
    border-color: rgba(15, 23, 42, 0.12);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--mim-primary);
    box-shadow: 0 0 0 0.15rem rgba(26, 115, 232, 0.18);
}

/* Responsive tweaks ------------------------------------------------------ */
@media (max-width: 991.98px) {
    .subnav-toolbar {
        position: static;
        flex-wrap: wrap;
    }

    .card + .card {
        margin-top: 1rem;
    }

    .styled-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 575.98px) {
    .flashes li {
        font-size: 0.95rem;
    }

    .styled-link {
        display: inline-block;
        margin-bottom: 0.35rem;
    }
}
