﻿* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f5f7;
    color: #18212f;
    overflow-x: hidden;
}

.page {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 18px;
}

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

.card {
    background: #ffffff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 16px;
}

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

h1,
h2 {
    margin-top: 0;
    overflow-wrap: anywhere;
}

p,
.alert,
.hint,
.success {
    overflow-wrap: anywhere;
}

.muted {
    color: #687385;
    font-size: 14px;
}

label {
    display: block;
    margin: 18px 0 8px;
    font-weight: bold;
}

input {
    width: 100%;
    height: 48px;
    border: 1px solid #cfd6df;
    border-radius: 12px;
    padding: 0 14px;
    min-width: 0;
    font-size: 16px;
}

button,
.tile {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: #083f5f;
    color: #ffffff;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow-wrap: anywhere;
}

form button {
    margin-top: 18px;
}

.alert {
    background: #ffe8e8;
    color: #8a1010;
    padding: 12px;
    border-radius: 12px;
    margin: 12px 0;
}

.topbar {
    position: sticky;
    top: 0;
    background: #083f5f;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    z-index: 100;
}

.topbar > div:first-child {
    min-width: 0;
}

.topbar strong {
    display: block;
    overflow-wrap: anywhere;
}

.topbar span {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar form {
    margin: 0;
}

.topbar form button {
    margin-top: 0;
}

.topbar-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.small {
    width: auto;
    min-height: 36px;
    padding: 0 14px;
    background: #0d6d98;
    font-size: 14px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.tile {
    height: 90px;
}

@media (max-width: 520px) {
    .page {
        padding: 14px;
    }

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

    .tile {
        height: 70px;
    }
}

textarea {
    width: 100%;
    border: 1px solid #cfd6df;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 16px;
    resize: vertical;
    font-family: Arial, sans-serif;
}

.primary-link,
.toplink {
    min-height: 44px;
    border-radius: 12px;
    background: #083f5f;
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    margin-bottom: 16px;
    text-align: center;
    overflow-wrap: anywhere;
}

.toplink {
    width: auto;
    margin-bottom: 0;
    background: #0d6d98;
    min-height: 42px;
    padding: 0 12px;
}

select {
    width: 100%;
    height: 48px;
    border: 1px solid #cfd6df;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 16px;
    background: #ffffff;
    min-width: 0;
    max-width: 100%;
    text-overflow: ellipsis;
}

.total-box {
    margin-top: 18px;
    margin-bottom: 18px;
    padding: 14px;
    border-radius: 14px;
    background: #eef5f8;
    border: 1px solid #d3e2e8;
}

.total-box div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #d3e2e8;
}

.total-box div:last-child {
    border-bottom: 0;
}

.total-box span {
    color: #465466;
}

.total-box strong {
    font-size: 17px;
}

.grand-total strong {
    font-size: 21px;
}

.codebox {
    width: 100%;
    overflow-x: auto;
    background: #101820;
    color: #e8f1f5;
    border-radius: 14px;
    padding: 14px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.hint {
    font-size: 13px;
    color: #687385;
    background: #eef5f8;
    padding: 10px;
    border-radius: 10px;
}

.lookup-button {
    margin-top: 10px;
    background: #0d6d98;
}

.lookup-status {
    min-height: 20px;
    margin: 8px 0 0;
    color: #445264;
    font-size: 13px;
}

.inline-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pdf-link {
    background: #176b2c;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 14px;
}

.search-form button {
    width: auto;
    padding: 0 16px;
    margin-top: 0;
}

.compact-list {
    display: grid;
    gap: 10px;
}

.compact-row {
    background: #ffffff;
    border-radius: 14px;
    padding: 14px;
    text-decoration: none;
    color: #18212f;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.compact-row strong {
    display: block;
    font-size: 17px;
    overflow-wrap: anywhere;
}

.compact-row span {
    display: block;
    color: #687385;
    font-size: 13px;
    margin-top: 4px;
}

.compact-row em {
    font-style: normal;
    color: #0d6d98;
    font-weight: bold;
    white-space: nowrap;
}

@media (max-width: 520px) {
    .search-form {
        grid-template-columns: 1fr;
    }

    .search-form button {
        width: 100%;
    }
}

.danger-button {
    background: #9b1c1c;
}

.secondary-button {
    background: #607180;
}

.sms-approval-box {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid #d7c36c;
    border-radius: 14px;
    background: #fffbea;
}

.sms-approval-box h3 {
    margin: 0 0 8px;
}

.sms-phone {
    margin: 12px 0 0;
}

.invoice-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.invoice-filter-card {
    padding-top: 4px;
}

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

.invoice-filter-form label {
    margin-top: 14px;
}

.invoice-filter-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: end;
}

.invoice-filter-actions button {
    margin-top: 14px;
}

.invoice-filter-actions a {
    min-height: 48px;
    margin-top: 14px;
    padding: 0 16px;
    border: 1px solid #cfd6df;
    border-radius: 12px;
    color: #18212f;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.invoice-list-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 0 2px 10px;
    color: #687385;
    font-size: 14px;
}

.invoice-compact-list {
    display: grid;
    gap: 10px;
}

.invoice-compact-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

.invoice-select,
.invoice-select-placeholder {
    width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.invoice-select input,
.batch-toolbar input {
    width: 20px;
    height: 20px;
    margin: 0;
}

.batch-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #eaf2f6;
}

.batch-toolbar label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.batch-toolbar button {
    width: auto;
    margin: 0;
}

.source-label {
    color: #0d6d98 !important;
    font-weight: bold;
}

.gib-import-card summary {
    cursor: pointer;
    font-weight: bold;
    font-size: 17px;
}

.gib-import-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.gib-import-form button {
    margin: 0;
    min-height: 48px;
}

.batch-invoice-list {
    display: grid;
    gap: 8px;
    margin: 14px 0;
}

.batch-invoice-list a {
    padding: 10px 12px;
    border-radius: 10px;
    background: #eef5f8;
    color: #18212f;
    text-decoration: none;
}

.batch-invoice-list strong,
.batch-invoice-list span {
    display: block;
    overflow-wrap: anywhere;
}

.batch-invoice-list span {
    margin-top: 3px;
    color: #687385;
    font-size: 13px;
}

.invoice-compact-main {
    min-width: 0;
    color: #18212f;
    text-decoration: none;
}

.invoice-compact-main strong,
.invoice-compact-main span {
    display: block;
}

.invoice-compact-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
}

.invoice-compact-main span {
    margin-top: 4px;
    color: #687385;
    font-size: 13px;
}

.invoice-compact-side {
    display: grid;
    justify-items: end;
    gap: 8px;
}

.invoice-compact-side > a {
    color: #0d6d98;
    font-weight: bold;
    text-decoration: none;
}

.status-badge {
    padding: 5px 8px;
    border-radius: 999px;
    background: #eef5f8;
    color: #445264;
    font-size: 12px;
    white-space: nowrap;
}

.status-gib_draft_created {
    background: #fff3cd;
    color: #6b5000;
}

.status-approved {
    background: #e4f7e8;
    color: #176b2c;
}

.status-gib_deleted {
    background: #f3e5e5;
    color: #8a1f1f;
}

.pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
}

.pagination a,
.pagination span {
    min-height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination a {
    background: #083f5f;
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
}

.pagination span {
    background: #e8edf0;
    color: #8a949f;
}

.pagination strong {
    white-space: nowrap;
}

@media (max-width: 620px) {
    .invoice-actions,
    .invoice-filter-grid {
        grid-template-columns: 1fr;
    }

    .invoice-compact-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .invoice-compact-side {
        grid-column: 2;
        grid-template-columns: 1fr auto;
        align-items: center;
        justify-items: start;
    }

    .batch-toolbar,
    .gib-import-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .batch-toolbar button {
        width: 100%;
    }

    .inline-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .page {
        padding: 12px;
    }

    .card {
        padding: 14px;
        border-radius: 14px;
    }

    .topbar {
        padding: 10px 12px;
    }

    .topbar-actions {
        gap: 6px;
    }

    .toplink {
        min-height: 40px;
        padding: 0 10px;
        font-size: 14px;
    }

    .invoice-filter-actions,
    .pagination {
        grid-template-columns: 1fr;
    }

    .pagination strong {
        text-align: center;
    }

    .compact-row {
        align-items: flex-start;
    }
}

.success {
    background: #e4f7e8;
    color: #176b2c;
    padding: 12px;
    border-radius: 12px;
    margin: 12px 0;
}
