body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: #f4f4f4;
    color: #222;
}

header {
    background: #2c3e50;
    color: white;
    padding: 20px 30px;
}

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

nav {
    margin-top: 10px;
}

nav a {
    color: white;
    text-decoration: none;
    margin-right: 20px;
    font-weight: bold;
}

nav a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1280px;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.08);
}

.card {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    background: #fafafa;
}

.summary-box {
    margin-top: 30px;
    padding: 20px;
    background: #eef6ee;
    border: 1px solid #b7d3b7;
    border-radius: 8px;
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.button-link,
button {
    flex: 1 0 100px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 14px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
}

.button-reset,
button {
    flex: 1 0 100px;
    text-align: center;
    justify-content: center;
    display: inline-block;
    padding: 8px 14px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
}

.button-link:hover,
button:hover {
    background: #2980b9;
}

.button-secondary {
    background: #6c757d;
    border-color: #6c757d;
}

.button-secondary:hover {
    background: #5a6268;
}

form p {
    margin-bottom: 15px;
}

input,
textarea,
select {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

.muted {
    color: #666;
}

.top-space {
    margin-top: 20px;
}

.danger-link {
    display: inline-block;
    padding: 10px 16px;
    background: #c0392b;
    color: white;
    text-decoration: none;
    border-radius: 6px;
}

.danger-link:hover {
    background: #a93226;
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 16px;
    width: 100%;
}

.estimate-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: white;
    font-size: 13px;
}

.estimate-table th,
.estimate-table td {
    border: 1px solid #dcdcdc;
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.estimate-table th {
    background: #f4f6f8;
    font-size: 12px;
}

.total-row {
    background: #f9f9f9;
    font-weight: bold;
}

.estimate-table tr:hover {
    background: #fafafa;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

.status-approved {
    background: #e6f4ea;
    color: #1e7e34;
}

.status-draft {
    background: #fff4e5;
    color: #b36b00;
}

.logo-box {
    background-image: url('/static/images/logo.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    width: 150px;
    height: 150px;
    border: 1px solid #bbb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #777;
    margin-bottom: 12px;
}

.estimate-items-table {
    width: 100%;
    table-layout: fixed;
}

.estimate-items-table a {
    word-break: break-word;
}

.estimate-items-table th,
.estimate-items-table td {
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.estimate-items-table select,
.estimate-items-table input,
.estimate-items-table textarea {
    width: 100%;
    box-sizing: border-box;
}

.pagination-wrapper {
    margin: 16px 0 18px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: grid;
    grid-template-columns: 96px 326px 96px;
    align-items: center;
    column-gap: 12px;
}

.pagination-side {
    display: grid;
    grid-template-columns: 44px 44px;
    gap: 8px;
}

.pagination-pages {
    display: grid;
    grid-template-columns: repeat(7, 38px);
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.pagination-link,
.pagination-dots,
.pagination-slot-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    box-sizing: border-box;
}

.pagination-nav {
    width: 44px;
    min-width: 44px;
    font-size: 18px;
    font-weight: 600;
}

.pagination-link {
    color: #1f2937;
    background: #ffffff;
    border: 1px solid #d1d5db;
    transition: all 0.15s ease;
}

.pagination-link:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pagination-link-active {
    background: #3498db;
    color: #ffffff;
    border: 1px solid #3498db;
    font-weight: 600;
    cursor: default;
}

.pagination-link-disabled {
    color: #9ca3af;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    cursor: default;
    pointer-events: none;
}

.pagination-dots {
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: default;
}

.pagination-slot-empty {
    visibility: hidden;
}

.action-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.back-actions {
    margin-top: 16px;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.card-spaced {
    margin-bottom: 20px;
}

.inline-muted {
    color: #666;
}

.detail-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.table-text-wrap {
    white-space: normal;
    line-height: 1.4;
}

.table-comment-wide {
    min-width: 280px;
    max-width: 420px;
    white-space: normal;
    line-height: 1.4;
}

.table-comment-wider {
    min-width: 320px;
    max-width: 480px;
    white-space: normal;
    line-height: 1.4;
}

.app-form {
    margin-top: 16px;
}

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

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-help {
    color: #666;
    margin-top: 4px;
    font-size: 14px;
}

.form-field-errors {
    color: #b00020;
    margin-top: 4px;
    font-size: 14px;
}

.form-error-box {
    color: #b00020;
    background: #fdeaea;
    border: 1px solid #f3b5b5;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 16px;
}

.public-header {
    background: #2c3e50;
    color: white;
    padding: 28px 30px;
}

.public-header__inner {
    max-width: 1100px;
    margin: 0 auto;
}

.public-brand-title {
    margin: 0;
    font-size: 32px;
}

.public-brand-subtitle {
    margin-top: 8px;
    color: #d7e1ea;
    font-size: 16px;
}

.public-shell {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 16px;
}

.public-shell--narrow {
    max-width: 760px;
}

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

.public-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.06);
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

    .form-actions {
        flex-direction: column;
    }

    .button-link,
    button {
        width: 100%;
    }
}

.public-header__inner--row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.public-header-actions {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.public-login-form {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
}

.public-login-form__group {
    min-width: 220px;
}

.public-login-form__label {
    display: block;
    font-size: 13px;
    color: #d7e1ea;
    margin-bottom: 6px;
    font-weight: 600;
}

.public-login-form input {
    min-width: 220px;
}

.public-landing {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.public-landing__content {
    max-width: 920px;
    text-align: center;
}

.public-landing__title {
    margin: 0;
    font-size: 52px;
    line-height: 1.1;
    color: #1f2937;
}

.public-landing__subtitle {
    margin: 22px auto 0;
    max-width: 760px;
    font-size: 20px;
    line-height: 1.5;
    color: #4b5563;
}

.public-landing__error-box {
    margin: 28px auto 0;
    max-width: 640px;
    text-align: left;
}

@media (max-width: 900px) {
    .public-header-actions {
        width: 100%;
        align-items: stretch;
    }

    .public-login-form {
        width: 100%;
        align-items: stretch;
    }

    .public-login-form__group {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .public-login-form input {
        min-width: 100%;
    }
}

@media (max-width: 640px) {
    .public-landing__title {
        font-size: 36px;
    }

    .public-landing__subtitle {
        font-size: 18px;
    }
}

.table-checkbox-cell {
    text-align: center;
    vertical-align: middle;
}

.table-checkbox-cell input[type="checkbox"] {
    width: auto;
    transform: scale(1.2);
    cursor: pointer;
}

.estimate-items-table input[type="number"] {
    min-width: 72px;
    max-width: 90px;
}

.estimate-items-table .form-field-errors ul {
    margin: 4px 0 0;
    padding-left: 16px;
}


.page-narrow {
    max-width: 720px;
    margin: 0 auto;
}