* {
    box-sizing: border-box;
}

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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fb;
    color: #101828;
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: #1849a9;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.erp-layout {
    display: flex;
    min-height: 100vh;
    background: #f5f7fb;
}

.erp-sidebar {
    width: 245px;
    min-width: 245px;
    background: #081d36;
    color: #ffffff;
    padding: 24px 16px;
}

.erp-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 28px;
    color: #ffffff;
}

.erp-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #ffffff;
    color: #081d36;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.erp-brand strong {
    display: block;
    font-size: 15px;
    line-height: 1.1;
}

.erp-brand span {
    display: block;
    font-size: 12px;
    color: #b9c9e4;
    margin-top: 2px;
}

.erp-nav a {
    display: block;
    color: #d6e4ff;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 5px;
    font-weight: 700;
}

.erp-nav a:hover,
.erp-nav a.active {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    text-decoration: none;
}

.erp-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.erp-topbar {
    min-height: 62px;
    background: #ffffff;
    border-bottom: 1px solid #e4e7ec;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.erp-userbar {
    display: flex;
    gap: 10px;
    align-items: center;
    color: #667085;
    font-size: 13px;
}

.erp-content {
    flex: 1;
    padding: 28px;
}

.page-header,
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.page-header h1 {
    margin: 0 0 6px 0;
    font-size: 28px;
}

.page-header p {
    margin: 0;
    color: #667085;
}

.card,
.stat-card,
.login-card {
    background: #ffffff;
    border: 1px solid #e4e7ec;
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.card h2 {
    margin: 0 0 16px 0;
    font-size: 19px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.stat-number {
    display: block;
    margin-top: 6px;
    font-size: 32px;
    font-weight: 800;
}

.btn,
button,
input[type="submit"] {
    display: inline-block;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid #d0d5dd;
    background: #ffffff;
    color: #344054;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.25;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
    background: #f9fafb;
    text-decoration: none;
}

.btn-primary {
    background: #1849a9;
    border-color: #1849a9;
    color: #ffffff;
}

.btn-primary:hover {
    background: #123b87;
}

.btn-secondary {
    background: #f9fafb;
}

.btn-small {
    padding: 6px 10px;
    font-size: 13px;
}

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

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label,
label {
    font-weight: 700;
    color: #344054;
}

input,
select,
textarea {
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    background: #ffffff;
    color: #101828;
}

textarea {
    resize: vertical;
}

.span-2 {
    grid-column: span 2;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar input,
.filter-bar select {
    min-width: 220px;
}

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

.data-table,
table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.data-table th,
.data-table td,
table th,
table td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid #eef0f4;
    vertical-align: top;
}

.data-table th,
table th {
    background: #f9fafb;
    color: #475467;
    font-size: 13px;
    font-weight: 800;
}

.detail-list,
dl {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px 16px;
}

.detail-list dt,
dt {
    font-weight: 800;
    color: #475467;
}

.detail-list dd,
dd {
    margin: 0;
}

.badge,
.tag,
.status,
.pill {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef4ff;
    color: #1849a9;
    font-size: 12px;
    font-weight: 800;
    margin: 2px 4px 2px 0;
}

.badge-active,
.badge-preferred {
    background: #ecfdf3;
    color: #027a48;
}

.badge-inactive {
    background: #f2f4f7;
    color: #475467;
}

.badge-blocked {
    background: #fef3f2;
    color: #b42318;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-link {
    text-decoration: none;
}

.muted {
    color: #667085;
}

.muted-tag {
    opacity: 0.55;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 10px;
}

.alert {
    padding: 13px 15px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.alert-error {
    background: #fef3f2;
    color: #b42318;
    border: 1px solid #fecdca;
}

.alert-success {
    background: #ecfdf3;
    color: #027a48;
    border: 1px solid #abefc6;
}

.login-body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 850px) {
    .erp-layout {
        flex-direction: column;
    }

    .erp-sidebar {
        width: 100%;
        min-width: 0;
    }

    .erp-nav a {
        display: inline-block;
    }

    .erp-topbar {
        padding: 14px 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .erp-content {
        padding: 18px;
    }

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

    .span-2 {
        grid-column: span 1;
    }

    .detail-list,
    dl {
        grid-template-columns: 1fr;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

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

    .filter-bar input,
    .filter-bar select {
        width: 100%;
        min-width: 0;
    }

    .page-header h1 {
        font-size: 23px;
    }
}
