:root {
    --blue-dark: #0a3d91;
    --blue-light: #2f80ed;
    --bg: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    margin: 0;
    background: linear-gradient(135deg, #e3f2fd 0%, #d1e3f7 50%, #c5d9f5 100%);
    color: var(--text);
}

.bg-light {
    background: linear-gradient(135deg, #e3f2fd 0%, #d1e3f7 50%, #c5d9f5 100%);
}

.topbar {
    background: linear-gradient(90deg, var(--blue-dark), var(--blue-light));
    color: #fff;
    padding: 1rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.topbar-logo {
    height: auto !important;
    max-height: 50px !important;
    width: auto !important;
    object-fit: contain;
}

.topbar h1 {
    margin: 0;
}

.topbar p {
    margin: 0.2rem 0 0;
    opacity: 0.9;
}

.topbar-actions {
    display: flex;
    gap: 0.6rem;
}

.container {
    max-width: 1100px;
    margin: 1.2rem auto;
    padding: 0 1rem 2rem;
}

.stack {
    display: grid;
    gap: 1rem;
}

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

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 8px 18px rgba(31, 41, 55, 0.08);
    transition: all 0.2s ease;
}

.module-card {
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    min-height: 132px;
    display: block;
}

.module-card__icon {
    position: absolute;
    top: 50%;
    right: -4%;
    width: 68%;
    height: 78%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.module-card__icon img {
    width: 100%;
    max-width: 120px;
    height: auto;
    opacity: 0.17;
    object-fit: contain;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.module-card__body {
    position: relative;
    z-index: 1;
}

.module-card__body h3 {
    margin: 0 0 0.35rem;
}

.module-card__body p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.module-card:hover .module-card__icon {
    transform: translateY(-50%) scale(1.03);
}

.module-card:hover .module-card__icon img {
    opacity: 0.24;
}

.module-card--highlighted {
    background: var(--blue-dark);
    border-color: var(--blue-light);
    box-shadow: 0 8px 18px rgba(47, 128, 237, 0.15);
}

.module-card--highlighted .module-card__body h3,
.module-card--highlighted .module-card__body p {
    color: #FFD700;
}

.module-card--highlighted:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(47, 128, 237, 0.25);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 24px rgba(10, 61, 145, 0.15);
}

.login-wrapper {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
}

.login-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.login-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.login-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.form-grid {
    display: grid;
    gap: 0.6rem;
}

.cols-4 {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.cols-2 {
    grid-template-columns: 1fr auto;
}

input,
select,
button {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.6rem 0.7rem;
    font-size: 0.95rem;
}

button,
.btn-secondary,
.btn-danger {
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    color: #fff;
}

button,
.btn-secondary {
    background: var(--blue-dark);
}

.btn-danger {
    background: #dc2626;
}

.small {
    font-size: 0.85rem;
    padding: 0.45rem 0.7rem;
}

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

.alert {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border: 1px solid;
}

.alert.success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.alert.error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

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

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

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

.actions {
    display: flex;
    gap: 0.4rem;
}

.actions form {
    margin: 0;
}

.form-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.4rem 0.8rem;
    margin-bottom: 0.7rem;
}

.role-box {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
}

.section-separator {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(229, 231, 235, 0.5), transparent);
    margin: 1.5rem 0;
    width: 100%;
}

@media (max-width: 700px) {
    .topbar {
        align-items: flex-start;
    }
    .actions {
        flex-direction: column;
    }
}
