
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f1f4f8;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: #26364a;
}

.login-container {
    width: 100%;
    max-width: 1050px;
    min-height: 620px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(20, 35, 55, 0.12);
}

.login-brand {
    background: linear-gradient(145deg, #17253b, #244c78);
    color: #ffffff;
    padding: 55px 45px;
    display: flex;
    flex-direction: column;
}

.brand-logo {
    width: 58px;
    height: 58px;
    background: #ffffff;
    color: #17253b;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    font-weight: bold;
    margin-bottom: 25px;
}

.login-brand h1 {
    font-size: 25px;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.login-brand > p {
    color: #c6d5e6;
    font-size: 13px;
}

.brand-description {
    margin-top: auto;
    margin-bottom: auto;
    padding: 55px 0;
}

.brand-description h2 {
    font-size: 30px;
    line-height: 1.35;
    margin-bottom: 18px;
}

.brand-description p {
    color: #c6d5e6;
    line-height: 1.8;
    font-size: 14px;
}

.brand-footer {
    color: #a9bdd4;
    font-size: 12px;
}

.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 65px 55px 25px;
}

.login-form-container {
    width: 100%;
    max-width: 360px;
    margin: auto;
}

.login-form-container h2 {
    font-size: 29px;
    color: #17253b;
    margin-bottom: 10px;
}

.login-subtitle {
    color: #7b8795;
    font-size: 14px;
    margin-bottom: 35px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 9px;
    color: #34445a;
}

.form-group input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #dce2e9;
    border-radius: 7px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
}

.form-group input:focus {
    border-color: #315e91;
}

.form-group input::placeholder {
    color: #a6afba;
}

.login-message {
    display: none;
    font-size: 13px;
    padding: 11px;
    border-radius: 6px;
    margin-bottom: 18px;
}

.login-message.error {
    display: block;
    background: #fff0f0;
    color: #bd3333;
}

.login-message.success {
    display: block;
    background: #edfaf2;
    color: #237a48;
}

#loginButton {
    width: 100%;
    height: 49px;
    background: #244c78;
    color: #ffffff;
    border: none;
    border-radius: 7px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

#loginButton:hover {
    background: #17253b;
}

#loginButton:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.login-security {
    text-align: center;
    color: #929daa;
    font-size: 12px;
    margin-top: 28px;
}

.page-footer {
    text-align: center;
    color: #a0aab5;
    font-size: 11px;
    padding-top: 25px;
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .login-container {
        grid-template-columns: 1fr;
    }

    .login-brand {
        padding: 30px;
    }

    .brand-description {
        padding: 35px 0;
    }

    .brand-description h2 {
        font-size: 23px;
    }

    .login-panel {
        padding: 45px 30px 25px;
        min-height: 400px;
    }
}

/* Invoice submission and review */
.invoice-workflow {
    margin-top: 24px;
}

.pending-invoice-list {
    display: grid;
    gap: 12px;
}

.pending-invoice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid #dce2e9;
    border-radius: 8px;
    background: #fff;
}

.pending-invoice-info {
    min-width: 0;
}

.pending-invoice-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pending-invoice-delete-btn {
    background: #bd3333;
    color: #fff;
    border: 1px solid #bd3333;
}

.pending-invoice-delete-btn:hover {
    background: #a52828;
}

.pending-invoice-info strong {
    display: block;
    overflow-wrap: anywhere;
    margin-bottom: 6px;
}

.invoice-review-panel {
    margin-top: 24px;
}

.invoice-review-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 20px;
    align-items: start;
}

.invoice-pdf-viewer {
    width: 100%;
    height: 720px;
    border: 1px solid #dce2e9;
    border-radius: 8px;
    background: #f1f4f8;
}

.invoice-review-fields {
    display: grid;
    gap: 14px;
}

.invoice-review-fields .form-group {
    margin-bottom: 0;
}

.invoice-review-fields input {
    width: 100%;
    min-height: 42px;
    padding: 10px;
    border: 1px solid #dce2e9;
    border-radius: 6px;
    font-size: 14px;
}

.invoice-review-message {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .invoice-review-layout {
        grid-template-columns: 1fr;
    }

    .invoice-pdf-viewer {
        height: 500px;
    }
}

@media (max-width: 600px) {
    .pending-invoice-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .invoice-pdf-viewer {
        height: 420px;
    }
}

/* Invoice History */
.invoice-history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.invoice-history-header .form-group {
    min-width: 190px;
}

.invoice-history-header select {
    width: 100%;
    padding: 11px;
    border: 1px solid #dce2e9;
    border-radius: 7px;
    background: #fff;
}

.invoice-history-export-btn {
    padding: 11px 20px;
    border: none;
    border-radius: 7px;
    background: #198754;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    min-height: 42px;
}

.invoice-history-export-btn:hover {
    background: #146c43;
}

.invoice-history-export-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .invoice-history-export-btn {
        width: 100%;
    }
}

.invoice-history-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: #f5f7fa;
    border-radius: 7px;
}

.invoice-history-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.invoice-history-table {
    min-width: 1500px;
    white-space: nowrap;
}

.invoice-history-table th {
    background: #f5f7fa;
    position: sticky;
    top: 0;
    z-index: 1;
}

.invoice-history-table td {
    vertical-align: middle;
}

.invoice-history-table a {
    color: #245b91;
    font-weight: 600;
    text-decoration: none;
}

.invoice-history-table a:hover {
    text-decoration: underline;
}

/* User Management */
.staff-assignment-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) minmax(160px, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.staff-assignment-row select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #dce2e9;
    border-radius: 7px;
    background: #fff;
    color: #26364a;
}

.staff-management-table {
    min-width: 950px;
}

.staff-management-table th,
.staff-management-table td {
    padding: 12px;
    vertical-align: middle;
    text-align: left;
    white-space: nowrap;
}

.staff-management-table td:first-child {
    white-space: normal;
    min-width: 190px;
}

.staff-management-table .btn {
    padding: 8px 11px;
    font-size: 12px;
    white-space: nowrap;
}

#staffForm h3 {
    margin: 24px 0 10px;
}

#staffForm .form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

@media (max-width: 700px) {
    .staff-assignment-row {
        grid-template-columns: 1fr;
        border: 1px solid #dce2e9;
        border-radius: 8px;
        padding: 12px;
        gap: 9px;
    }

    .staff-assignment-row .btn {
        width: 100%;
    }
}

/* Mobile PDF.js invoice viewer */
.mobile-pdf-viewer {
    display: none;
    margin: 8px 0 16px;
}

.mobile-pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.mobile-pdf-toolbar button {
    padding: 9px 14px;
    border: 0;
    border-radius: 6px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
}

.mobile-pdf-toolbar button:disabled {
    opacity: 0.4;
}

#mobilePdfPageInfo {
    font-size: 14px;
    font-weight: 600;
}

#mobilePdfStatus {
    font-size: 13px;
    text-align: center;
}

#mobilePdfCanvasContainer {
    width: 100%;
    overflow-x: auto;
    text-align: center;
    background: #eeeeee;
    border-radius: 6px;
    padding: 8px 0;
}

#mobilePdfCanvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    background: #ffffff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}

.mobile-invoice-pdf-link {
    display: none;
    margin: 8px 0 16px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
}

@media (max-width: 600px) {
    .invoice-pdf-viewer {
        display: none;
    }

    .mobile-pdf-viewer:not([hidden]) {
        display: block;
    }

    .mobile-invoice-pdf-link:not([hidden]) {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

