* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family:
        Arial,
        Helvetica,
        sans-serif;
    background: #f4f7f5;
    color: #1f2933;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}


/* =========================================================
   LOGIN
========================================================= */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        linear-gradient(
            135deg,
            #0f5132 0%,
            #146c43 50%,
            #198754 100%
        );
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 14px;
    padding: 38px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.18);
}

.login-brand {
    text-align: center;
    margin-bottom: 30px;
}

.login-brand h1 {
    margin: 0 0 8px;
    color: #0f5132;
    font-size: 28px;
}

.login-brand p {
    margin: 0;
    color: #667085;
}

.login-button {
    width: 100%;
    margin-top: 8px;
}

.login-message {
    min-height: 20px;
    margin: 14px 0 0;
    color: #b42318;
    text-align: center;
    font-size: 14px;
}

.login-note {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
    color: #667085;
    text-align: center;
    font-size: 13px;
}


/* =========================================================
   HEADER
========================================================= */

header {
    background: #0f5132;
    color: #ffffff;
}

.header-content {
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

header h1 {
    margin: 0;
    font-size: 24px;
}

header p {
    margin: 5px 0 0;
    opacity: 0.85;
}

.session-area {
    display: flex;
    align-items: center;
    gap: 18px;
}

.current-user {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.current-user strong {
    font-size: 14px;
}

.current-user span {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 3px;
}

.logout-button {
    width: auto;
    background: #ffffff;
    color: #0f5132;
}


/* =========================================================
   NAVIGATION
========================================================= */

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px 24px;
    background: #ffffff;
    border-bottom: 1px solid #dfe5e1;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04);
}

.nav-btn {
    width: auto;
    background: transparent;
    color: #475467;
    border: 0;
    border-radius: 7px;
    padding: 10px 14px;
}

.nav-btn:hover {
    background: #eef7f1;
    color: #0f5132;
}

.nav-btn.active {
    background: #0f5132;
    color: #ffffff;
}


/* =========================================================
   MAIN
========================================================= */

main {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 28px;
}

.page {
    display: none;
}

.page.active-page {
    display: block;
}

.page h2 {
    margin-top: 0;
    color: #0f5132;
}


/* =========================================================
   PANELS
========================================================= */

.panel {
    background: #ffffff;
    border: 1px solid #e2e8e4;
    border-radius: 10px;
    padding: 22px;
    margin-bottom: 22px;
    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.04);
}

.panel h3 {
    margin-top: 0;
    color: #344054;
}


/* =========================================================
   DASHBOARD CARDS
========================================================= */

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

.card {
    background: #ffffff;
    border: 1px solid #e2e8e4;
    border-radius: 10px;
    padding: 22px;
    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.04);
}

.card h3 {
    margin: 0 0 12px;
    color: #667085;
    font-size: 14px;
    font-weight: 600;
}

.card p {
    margin: 0;
    color: #0f5132;
    font-size: 24px;
    font-weight: 700;
}


/* =========================================================
   FORMS
========================================================= */

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

.form-row > * {
    flex: 1 1 180px;
}

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

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #344054;
    font-size: 14px;
    font-weight: 600;
}

input,
select {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #cfd8d3;
    border-radius: 7px;
    background: #ffffff;
    color: #1f2933;
    outline: none;
}

input:focus,
select:focus {
    border-color: #198754;
    box-shadow:
        0 0 0 3px rgba(25, 135, 84, 0.10);
}

button {
    min-height: 42px;
    padding: 9px 16px;
    border: 0;
    border-radius: 7px;
    background: #0f5132;
    color: #ffffff;
    font-weight: 600;
}

button:hover {
    background: #0b3f27;
}

.secondary-button {
    background: #e9f5ee;
    color: #0f5132;
}

.secondary-button:hover {
    background: #d9eee2;
}

.danger-button {
    background: #b42318;
}

.danger-button:hover {
    background: #912018;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.helper-text {
    margin-bottom: 0;
    color: #667085;
    font-size: 13px;
}


/* =========================================================
   TRANSACTION USER INFO
========================================================= */

.transaction-user-info {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding: 14px 16px;
    margin: 18px 0;
    border: 1px solid #dce8e0;
    border-radius: 8px;
    background: #f6faf7;
}

.transaction-user-info > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.field-label {
    color: #667085;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}


/* =========================================================
   JOURNAL LINES
========================================================= */

.journal-lines-header,
.journal-line {
    display: grid;
    grid-template-columns:
        1.3fr 1.5fr 1fr 1fr auto;
    gap: 10px;
    align-items: center;
}

.journal-lines-header {
    margin: 20px 0 8px;
    color: #475467;
    font-size: 13px;
}

.journal-line {
    margin-bottom: 10px;
}

.remove-line {
    background: #f2f4f7;
    color: #344054;
}

.remove-line:hover {
    background: #e4e7ec;
}

.totals {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 28px;
    margin: 20px 0;
    padding-top: 16px;
    border-top: 1px solid #e4e7ec;
}


/* =========================================================
   TABLES
========================================================= */

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

th,
td {
    padding: 11px 12px;
    border-bottom: 1px solid #eaecf0;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f6f8f7;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

td {
    color: #475467;
    font-size: 14px;
}

tbody tr:hover {
    background: #fafcfb;
}


/* =========================================================
   LEDGER
========================================================= */

.ledger-account {
    overflow-x: auto;
}

.ledger-title {
    color: #0f5132;
}


/* =========================================================
   MESSAGE
========================================================= */

#message {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    display: none;
    max-width: 380px;
    padding: 14px 18px;
    border-radius: 8px;
    background: #0f5132;
    color: #ffffff;
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.18);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1000px) {

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

    .header-content {
        align-items: flex-start;
        flex-direction: column;
    }

    .session-area {
        width: 100%;
        justify-content: space-between;
    }

    .current-user {
        text-align: left;
    }
}

@media (max-width: 760px) {

    main {
        padding: 18px;
    }

    nav {
        padding: 8px;
    }

    .nav-btn {
        flex: 1 1 auto;
    }

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

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

    .journal-lines-header {
        display: none;
    }

    .journal-line {
        grid-template-columns: 1fr;
        padding: 14px;
        border: 1px solid #e4e7ec;
        border-radius: 8px;
        margin-bottom: 12px;
    }

    .login-card {
        padding: 28px 22px;
    }
}