:root {
    --ink: #172c2a;
    --muted: #71817e;
    --line: #e3eae7;
    --bg: #f5f8f6;
    --green: #126b58;
    --mint: #dff3eb
}

* {
    box-sizing: border-box
}

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

.top {
    height: 68px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 2
}

.brand {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--ink);
    text-decoration: none
}

.brand span {
    color: var(--green)
}

.top small {
    color: var(--muted);
    margin: 0 12px
}

.inline {
    display: inline
}

.linkbtn {
    border: 0;
    background: none;
    color: var(--green);
    font-weight: 700;
    cursor: pointer
}

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

aside {
    padding: 24px 14px;
    background: #fff;
    border-right: 1px solid var(--line)
}

aside a {
    display: block;
    padding: 9px 12px;
    color: #4d625e;
    text-decoration: none;
    border-radius: 8px;
    margin: 2px 0
}

aside a:hover {
    background: var(--mint);
    color: var(--green)
}

.navlabel {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.3px;
    color: #93a29e;
    margin: 18px 12px 7px
}

main {
    padding: 30px;
    min-width: 0
}

.pagehead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px
}

.pagehead h1,
h1 {
    font-size: 30px;
    letter-spacing: -.8px;
    margin: 2px 0 4px
}

.eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--green);
    margin: 0
}

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

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px
}

.stat,
.panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 3px 12px #173c2c05
}

.stat span,
.stat small {
    display: block;
    color: var(--muted)
}

.stat strong {
    font-size: 30px;
    display: block;
    margin: 7px 0
}

.panel {
    margin-bottom: 22px
}

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

.quicklinks {
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

.quicklinks a {
    padding: 10px 13px;
    background: #f3f8f5;
    border-radius: 8px;
    text-decoration: none;
    color: var(--green);
    font-weight: 650
}

.primary,
.buttonlink {
    display: inline-block;
    background: var(--green);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 11px 16px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer
}

.wide {
    width: 100%;
    margin-top: 10px
}

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

.formgrid label,
.auth label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #526561
}

.formgrid input,
.formgrid textarea,
.auth input {
    width: 100%;
    border: 1px solid #dce5e1;
    border-radius: 8px;
    padding: 10px 11px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    outline-color: #5da995
}

.formaction {
    display: flex;
    align-items: end
}

.tablehead {
    display: flex;
    align-items: center;
    justify-content: space-between
}

.tablehead h2 {
    margin: 0 0 14px
}

.tablewrap {
    overflow: auto
}

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

th,
td {
    text-align: left;
    padding: 11px 12px;
    border-bottom: 1px solid #edf1ef;
    white-space: nowrap
}

th {
    color: #71817e;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: .7px;
    background: #f9fbfa
}

td {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 30px
}

.alert {
    margin: 14px 0;
    padding: 12px 16px;
    border-radius: 8px
}

.success {
    background: #e2f7eb;
    color: #145c3d
}

.error {
    background: #fff0ef;
    color: #9b2922
}

.auth {
    max-width: 420px;
    margin: 7vh auto;
    background: white;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 34px;
    box-shadow: 0 15px 40px #173c2c0b
}

.auth h1 {
    font-size: 27px;
    margin-top: 25px
}

.auth label {
    margin: 18px 0
}

.big {
    font-size: 32px
}

.tiny {
    font-size: 12px
}

.footer {
    text-align: center;
    padding: 20px;
    color: #92a09c;
    font-size: 11px
}

.footer a {
    color: var(--green)
}

@media(max-width:1000px) {
    .shell {
        grid-template-columns: 190px minmax(0, 1fr)
    }

    main {
        padding: 20px
    }

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

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


@media (max-width: 650px) {
    .shell {
        display: block;
    }

    aside {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 12px;
    }

    .navlabel {
        grid-column: 1 / -1;
        margin: 12px;
    }

    .top {
        padding: 0 14px;
    }

    .top small {
        display: none;
    }

    main {
        padding: 15px;
    }

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

    .pagehead {
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }

    .auth {
        margin: 20px 12px;
        padding: 25px;
    }

    .rowactions .action-btn {
        min-width: 62px;
        height: 34px;
        padding: 6px 9px;
    }

    .formaction {
        flex-direction: column;
        align-items: stretch;
    }

    .formaction .primary,
    .formaction .btn {
        width: 100%;
    }
}

/* Dropdowns */
.formgrid select {
    width: 100%;
    min-height: 40px;
    padding: 10px 11px;
    border: 1px solid #dce5e1;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    cursor: pointer;
}

/* CRUD table actions */
.rowactions {
    white-space: nowrap;
    vertical-align: middle;
}

.rowactions .delete-form {
    display: inline-block;
    margin: 0;
    padding: 0;
}

.rowactions .action-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 70px;
    height: 36px;
    padding: 0 14px;
    margin-right: 6px;
    border-radius: 7px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.rowactions a.action-btn.edit-btn {
    background: var(--mint) !important;
    color: var(--green) !important;
    border: 1px solid #b9dace !important;
}

.rowactions a.action-btn.edit-btn:hover {
    background: #ccebe1 !important;
}

.rowactions button.action-btn.delete-btn {
    background: #fff0ef !important;
    color: #a52d26 !important;
    border: 1px solid #f0c9c5 !important;
}

.rowactions button.action-btn.delete-btn:hover {
    background: #ffe0dd !important;
}

/* Save / Update / Cancel */
.formaction {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.formaction button.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    background: var(--green);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.formaction a.btn.btn-secondary {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    min-height: 42px;
    padding: 10px 16px;
    background: #eef2f0 !important;
    color: #526561 !important;
    border: 1px solid #d6dfdc !important;
    border-radius: 8px;
    font: inherit;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
}

.formaction a.btn.btn-secondary:hover {
    background: #e3eae7 !important;
    color: var(--ink) !important;
}



/* =========================================
   COLLAPSIBLE SIDEBAR NAVIGATION
   ========================================= */

.sidebar-nav {
    padding: 18px 12px;
    background: #fff;
    border-right: 1px solid var(--line);
}

.nav-group {
    margin-bottom: 8px;
}

.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 14px;

    background: #f5f8f6;
    color: var(--ink);
    border: 1px solid transparent;
    border-radius: 9px;

    font: inherit;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.nav-toggle:hover,
.nav-group.open > .nav-toggle {
    background: var(--mint);
    color: var(--green);
}

.nav-arrow {
    font-size: 22px;
    line-height: 1;
    transition: transform .2s ease;
}

.nav-group.open .nav-arrow {
    transform: rotate(90deg);
}

.nav-links {
    display: none;
    padding: 6px 0 4px 12px;
}

.nav-group.open .nav-links {
    display: block;
}

.nav-links a {
    display: block;
    padding: 9px 12px;
    margin: 2px 0;

    color: #4d625e;
    background: transparent;
    border-radius: 7px;

    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--green);
    background: var(--mint);
}

@media (max-width: 650px) {
    .sidebar-nav {
        display: block;
        padding: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .nav-toggle {
        min-height: 42px;
    }
}



.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.organization-name {
    font-size: 30px;
    font-weight: 800;
    color: var(--green);
}

.welcome-user {
    font-size: 20px;
    font-weight: 600;
    color: var(--ink);
}


/* Assetalon resource table actions */
.rowactions {
    white-space: nowrap;
    min-width: 200px;
}

.rowactions .action-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 3px 5px 3px 0;
    text-decoration: none;
    cursor: pointer;
}

.rowactions .delete-form {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0;
    padding: 0;
}

.rowactions .edit-btn {
    color: #1565c0;
}

.rowactions .delete-btn {
    color: #c62828;
    background: transparent;
    border: 1px solid #c62828;
    border-radius: 4px;
    padding: 6px 10px;
    font: inherit;
}
