/* MOF Manager Compact Design Standard v1 */

:root {
    --bg: #f5f7fb;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #dbe3ef;
    --panel: #ffffff;
    --nav: #101827;
    --blue: #2563eb;
    --green: #0f9f4f;
    --red: #ef4444;
    --orange: #f97316;
    --amber: #f79009;
    --shadow: 0 6px 18px rgba(15, 23, 42, .06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    font-family: Inter, Segoe UI, Arial, sans-serif;
    color: var(--ink);
    font-size: 13px;
}

.shell,
.app {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    min-height: 100vh;
}

.side {
    background: linear-gradient(180deg, #0f172a, #14213d);
    color: #ffffff;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px;
    z-index: 20;
}

.brand,
.logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #1d4ed8;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 17px;
    margin: 4px 0 14px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.nav a,
.side a {
    color: #dbeafe;
    text-decoration: none;
    border-radius: 12px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: relative;
}

.nav a.active,
.nav a:hover,
.side a.active,
.side a:hover {
    background: #2563eb;
    color: #ffffff;
}

.nav a span,
.side a span {
    position: absolute;
    left: 64px;
    background: #0f172a;
    color: #ffffff;
    padding: 6px 9px;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-4px);
    transition: .15s;
    z-index: 50;
}

.nav a:hover span,
.side a:hover span {
    opacity: 1;
    transform: none;
}

.side-foot,
.side .bottom {
    margin-top: auto;
    font-size: 11px;
    color: #93a4bd;
    padding-bottom: 8px;
}

.main {
    padding: 12px 14px;
    max-width: 1900px;
    width: 100%;
    margin: 0 auto;
    min-width: 0;
}

.top,
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.title h1,
.header h1 {
    font-size: 22px;
    margin: 0;
    font-weight: 900;
    line-height: 1.1;
}

.title p,
.header p {
    margin: 2px 0 0;
    color: var(--muted);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.datebox,
.iconbtn,
.userbox,
.user-pill {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    box-shadow: var(--shadow);
}

.iconbtn {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #0f172a;
    text-decoration: none;
}

.userbox,
.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.kpi {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 10px;
    min-height: 58px;
    box-shadow: var(--shadow);
}

.kpi span {
    display: block;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: .03em;
}

.kpi b {
    display: block;
    font-size: 18px;
    line-height: 1.1;
    margin-top: 3px;
}

.kpi small {
    color: var(--muted);
    display: block;
    margin-top: 1px;
}

.kpi.blue b {
    color: var(--blue);
}

.kpi.green b {
    color: var(--green);
}

.kpi.amber b {
    color: var(--amber);
}

.kpi.red b {
    color: var(--red);
}

.cardx {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.card-head {
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.card-head h2,
.card-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 850;
}

.card-body {
    padding: 10px;
}

.toolbar {
    padding: 8px;
    display: flex;
    gap: 7px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.search,
.form-control,
.form-select,
input,
select,
textarea {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    color: var(--ink);
    font-size: 12px;
}

.search,
.form-control,
.form-select,
input,
select {
    height: 31px;
    padding: 5px 9px;
}

textarea {
    padding: 8px 9px;
}

.btnx {
    border: 1px solid var(--line);
    background: #ffffff;
    border-radius: 10px;
    height: 31px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 750;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
}

.btnx.primary {
    background: var(--blue);
    color: #ffffff;
    border-color: var(--blue);
}

.btnx.green {
    background: var(--green);
    color: #ffffff;
    border-color: var(--green);
}

.btnx.red {
    background: var(--red);
    color: #ffffff;
    border-color: var(--red);
}

.grid2 {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr);
    gap: 10px;
}

.grid3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.tablewrap {
    overflow: auto;
    border-radius: 12px;
}

.tablex {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.tablex th {
    background: #f8fafc;
    color: #475569;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .03em;
    position: sticky;
    top: 0;
    z-index: 3;
    cursor: default;
}

.tablex th.sortable {
    cursor: pointer;
}

.tablex th,
.tablex td {
    padding: 7px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.tablex tbody tr:hover {
    background: #f8fafc;
}

.tablex tbody tr.selected {
    background: #dbeafe;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 800;
}

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

.badge.green {
    background: #dcfce7;
    color: #166534;
}

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

.badge.amber {
    background: #fef3c7;
    color: #92400e;
}

.badge.gray {
    background: #f1f5f9;
    color: #475569;
}

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

.formgrid .full {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
}

.checkrow {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 31px;
}

.login-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .22), transparent 34%),
        radial-gradient(circle at bottom right, rgba(124, 58, 237, .18), transparent 32%),
        #0f172a;
    display: grid;
    place-items: center;
    padding: 22px;
}

.login-card {
    width: 100%;
    max-width: 980px;
    min-height: 560px;
    display: grid;
    grid-template-columns: 1fr 420px;
    background: #ffffff;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .32);
}

.login-hero {
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .92), rgba(30, 64, 175, .88)),
        linear-gradient(45deg, #1d4ed8, #7c3aed);
    padding: 42px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-form {
    padding: 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mobilebar {
    display: none;
}

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

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

@media (max-width: 760px) {
    .shell,
    .app {
        grid-template-columns: 1fr;
    }

    .side {
        position: fixed;
        inset: 0 auto 0 0;
        width: 76px;
        transform: translateX(-100%);
        transition: .2s;
    }

    .side.open {
        transform: none;
    }

    .mobilebar {
        display: flex;
        gap: 8px;
        align-items: center;
        margin-bottom: 8px;
    }

    .main {
        padding: 10px;
    }

    .top,
    .header {
        align-items: flex-start;
    }

    .top-actions,
    .userbox,
    .user-pill {
        display: none;
    }

    .kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .login-card {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .login-hero {
        display: none;
    }

    .login-form {
        padding: 28px;
    }
}

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