* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: #f3f4f6;
    color: #222;
    min-height: 100vh;
    padding: 20px;
}

body.edit-modal-open {
    overflow: hidden;
}

.login-page {
    min-height: calc(100vh - 40px);
    display: grid;
    place-items: center;
}

.login-card {
    width: min(380px, 100%);
    background: #fff;
    border: 1px solid #d6d6d6;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

.login-card h1 {
    margin-bottom: 20px;
    font-size: 24px;
    color: #1f2937;
}

.login-card label {
    display: block;
    margin-bottom: 14px;
    color: #333;
    font-weight: bold;
}

.login-card input {
    width: 100%;
    margin-top: 6px;
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 18px;
}

.login-card button {
    width: 100%;
    height: 42px;
    border: 0;
    border-radius: 6px;
    background: #ff6a2a;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.login-status {
    min-height: 22px;
    margin-top: 12px;
    color: #dc2626;
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    background: #fff;
    border-radius: 4px;
    padding: 24px;
    border: 1px solid #cfcfcf;
}

.title {
    font-size: 28px;
    font-weight: bold;
    color: #f43f5e;
    text-align: center;
    margin-bottom: 20px;
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: -8px 0 12px;
}

.top-actions button {
    height: 36px;
    border: 0;
    border-radius: 6px;
    background: #64748b;
    color: #fff;
    padding: 0 14px;
    cursor: pointer;
}

.input-box {
    width: 100%;
    padding: 16px;
    font-size: 24px;
    border-radius: 10px;
    border: 2px solid #38bdf8;
    background: #0f172a;
    color: #34d399;
    outline: none;
}

.price-form {
    margin-top: 16px;
    border: 1px solid #b9b9a4;
    border-bottom: 0;
    background: #fff;
}

.form-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    min-height: 48px;
    border-bottom: 1px solid #b9b9a4;
}

.form-label {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background: #43b800;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    padding: 8px 12px;
}

.form-field {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #222;
    padding: 8px 12px;
    background: #fff;
    font-size: 18px;
}

.form-field input {
    width: 240px;
    max-width: 100%;
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    color: #222;
    background: #fff;
    padding: 7px 10px;
    font-size: 18px;
    outline: none;
}

.split-field {
    flex-wrap: wrap;
}

.history-page .split-field {
    flex-wrap: nowrap;
}

.split-field input {
    width: 150px;
}

.homepage-metadata {
    display: none;
}

.upper-input,
.code-input {
    text-transform: uppercase;
}

.short-code-input {
    width: 72px !important;
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.inline-check input {
    width: auto;
}

.split-field span,
.route-line span {
    white-space: nowrap;
}

.split-field .code-name-code {
    width: 64px;
    flex: 0 0 64px;
}

.split-field .code-name-text {
    width: 130px;
    flex: 0 0 130px;
}

.route-line {
    flex-wrap: nowrap;
    overflow-x: auto;
}

.route-code {
    width: 64px !important;
    flex: 0 0 64px;
}

.swap-route-button {
    min-width: 40px;
    width: 40px;
    padding: 0;
    text-align: center;
}

.route-name {
    width: 120px !important;
    flex: 0 0 120px;
}

.record-info-wrap {
    align-items: center;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.record-info-line {
    flex: 1 1 100%;
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-all;
}

.record-info-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.record-info-wrap button {
    flex: 0 0 auto;
    height: 30px;
    padding: 0 10px;
}

.price-edit-input {
    width: 150px;
}

.price-unit-input {
    width: 90px;
}

.price-edit-panel .form-row {
    grid-template-columns: 110px minmax(0, 1fr);
}

.price-edit-panel .price-edit-input {
    width: 180px;
}

.price-edit-panel #editHandPrice {
    width: 180px;
}

.hand-price-row {
    display: grid;
    grid-template-columns: auto 96px auto 180px minmax(0, 1fr);
    gap: 8px;
    width: 100%;
}

.checked-price-row {
    display: grid;
    grid-template-columns: auto 96px auto 180px auto minmax(0, 1fr);
    gap: 8px;
    width: 100%;
}

.checked-price-head {
    display: grid;
    grid-template-columns: 96px 180px auto minmax(0, 1fr);
    gap: 8px;
    color: #555;
    font-size: 14px;
    font-weight: bold;
}

.price-list-head .form-label {
    background: #2f8f00;
}

.price-row-label {
    color: #666;
    font-size: 14px;
}

.checked-price-row .secondary-button {
    justify-self: start;
}

.bulk-price-field {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) auto;
    align-items: flex-start;
    gap: 10px;
}

.bulk-price-field textarea {
    width: 100%;
    max-width: 100%;
    min-height: 72px;
    resize: vertical;
    border: 1px solid #c8c8c8;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 16px;
    line-height: 1.4;
}

.bulk-route-field {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) auto;
    align-items: flex-start;
    gap: 10px;
}

.bulk-route-textarea {
    display: grid;
    gap: 6px;
}

.bulk-route-textarea span {
    color: #475569;
    font-size: 14px;
    font-weight: 700;
}

.bulk-route-field textarea {
    width: 100%;
    max-width: 100%;
    min-height: 96px;
    resize: vertical;
    border: 1px solid #c8c8c8;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 16px;
    line-height: 1.45;
}

.bulk-route-actions {
    display: grid;
    gap: 8px;
    min-width: 150px;
}

.bulk-route-field .inline-check {
    min-height: 38px;
    align-items: center;
    white-space: nowrap;
}

.bulk-route-field button {
    height: 38px;
    white-space: nowrap;
}

.result-box {
    margin-top: 20px;
    background: #0284c7;
    padding: 20px;
    border-radius: 12px;
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    color: white;
}
.debug-box {

    margin-top: 20px;

    background: #0f172a;

    border: 1px solid #334155;

    border-radius: 12px;

    padding: 16px;

}

.debug-title {

    color: #38bdf8;

    font-size: 18px;

    margin-bottom: 10px;

    font-weight: bold;

}

#ocrRawText {

    color: #22c55e;

    white-space: pre-wrap;

    font-size: 14px;

    line-height: 1.5;

    word-break: break-word;

}
.airline-card {

    margin-top: 20px;

    background: #111827;

    border: 1px solid #374151;

    border-radius: 16px;

    padding: 20px;

}

.airline-title {

    font-size: 24px;

    font-weight: bold;

    color: #38bdf8;

    margin-bottom: 20px;

}

.price-item {

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding: 12px 0;

    border-bottom: 1px solid #1f2937;

}

.price-label {

    color: #f8fafc;

    font-size: 18px;

}

.price-value {

    color: #22c55e;

    font-size: 20px;

    font-weight: bold;

}

.copy-tip {

    margin-top: 16px;

    text-align: center;

    color: #facc15;

    font-size: 14px;

}
.setting-box {

    display: flex;

    gap: 12px;

    margin-top: 16px;

    margin-bottom: 20px;

}

.setting-box select {

    flex: 1;

    background: #0f172a;

    color: #38bdf8;

    border: 1px solid #334155;

    border-radius: 12px;

    padding: 12px;

    font-size: 16px;

}

.history-search {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.history-search input {
    width: 100%;
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
}

.history-panel {
    margin-top: 20px;
    background: #fff;
    border: 1px solid #cfcfcf;
    border-radius: 4px;
    padding: 14px;
}

.action-box {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    position: sticky;
    bottom: 0;
    z-index: 3;
    border-top: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.96);
    padding: 10px 0 0;
}

.action-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.action-group-main {
    margin-left: auto;
}

.action-box button,
.import-button,
.action-link {
    background: #0284c7;
    color: white;
    border: 0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.import-button,
.action-link {
    display: inline-flex;
    align-items: center;
}

.page-path {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    color: #333;
    font-size: 16px;
    margin-bottom: 16px;
}

.page-path a {
    color: #1f2937;
    font-weight: 600;
    text-decoration: none;
}

.page-path a:hover {
    color: #0284c7;
    text-decoration: underline;
}

.page-path span {
    color: #64748b;
}

.history-page {
    max-width: 1600px;
}

.search-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: #222;
    margin-bottom: 14px;
}

.search-toolbar input,
.search-toolbar select {
    height: 40px;
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    background: #fff;
    color: #222;
    padding: 7px 10px;
    font-size: 16px;
}

.search-toolbar .code-input {
    width: 76px;
    text-transform: uppercase;
}

.search-toolbar .airline-code-input {
    width: 72px;
}

.search-toolbar .route-search-input {
    width: 130px;
}

.search-toolbar #historyRateSelect {
    width: 110px;
}

.search-toolbar button {
    height: 40px;
    background: #ff6a2a;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 0 16px;
    font-size: 16px;
    cursor: pointer;
}

.search-toolbar .swap-route-button {
    width: 40px;
    padding: 0;
}

.search-toolbar .secondary-button {
    background: #64748b;
}

.recycle-check {
    height: 40px;
    padding: 0 8px;
}

.is-deleted-record {
    opacity: 0.72;
    background: #fff7ed !important;
}

.copy-status {
    color: #16a34a;
    font-size: 14px;
    min-width: 44px;
}

.quote-preview-toast {
    position: fixed;
    top: 78px;
    right: 24px;
    z-index: 1400;
    width: min(440px, calc(100vw - 48px));
    max-height: min(70vh, 560px);
    overflow: hidden;
    background: #fff;
    border: 2px solid #16a34a;
    border-radius: 8px;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.24);
}

.quote-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #16a34a;
    color: #fff;
    padding: 10px 12px;
}

.quote-preview-head strong {
    font-size: 16px;
}

.quote-preview-head span {
    font-size: 13px;
    opacity: 0.9;
}

.quote-preview-toast pre {
    max-height: calc(min(70vh, 560px) - 42px);
    overflow: auto;
    margin: 0;
    padding: 14px 16px;
    color: #111827;
    font-size: 15px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.passenger-hint {
    margin: 8px 0 14px;
    color: #475569;
    font-size: 15px;
}

.passenger-contact {
    display: inline-block;
    margin-left: 10px;
    color: #dc2626;
    font-weight: 800;
}

.passenger-guide {
    margin-top: 18px;
    border-left: 4px solid #cbd5e1;
    background: #fff;
    padding: 14px 22px 20px;
    color: #2b2f36;
    font-size: 18px;
    line-height: 1.85;
}

.passenger-guide h2 {
    margin: 0 0 14px;
    color: #1f2937;
    font-size: 28px;
    line-height: 1.35;
}

.passenger-guide h2::before {
    content: "✈ ";
}

.passenger-guide h3 {
    margin: 18px 0 8px;
    color: #1f2937;
    font-size: 22px;
}

.passenger-guide h3::before {
    content: "💡 ";
}

.passenger-guide p {
    margin: 0 0 12px;
}

.passenger-guide strong {
    color: #1f2937;
}

.passenger-guide-sub {
    padding-left: 24px;
}

.passenger-guide-sub::before {
    content: "• ";
    margin-left: -18px;
}

.passenger-code-help {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 2px 0 10px;
}

.passenger-code-help span {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #334155;
    padding: 7px 12px;
    font-size: 14px;
    line-height: 1.2;
}

.passenger-page .search-toolbar {
    gap: 12px;
}

.passenger-page .search-toolbar input {
    height: 46px;
    font-size: 17px;
}

.passenger-page .search-toolbar .airline-code-input {
    width: 210px;
}

.passenger-page .search-toolbar .route-search-input {
    width: 220px;
}

.passenger-page .search-toolbar button {
    height: 46px;
    font-size: 17px;
}

.passenger-table th,
.passenger-table td {
    font-size: 16px;
}

.passenger-table {
    table-layout: fixed;
}

.passenger-airline-col {
    width: 86px;
}

.passenger-place-col {
    width: 150px;
}

.passenger-transfer-col {
    width: 150px;
}

.passenger-price-col,
.passenger-price-cell {
    width: 210px;
}

.passenger-time-col {
    width: 170px;
    white-space: nowrap;
}

.passenger-price-cell {
    color: #2563eb;
    font-weight: 700;
    line-height: 1.65;
    white-space: normal;
}

.edit-layout {
    display: grid;
    grid-template-columns: minmax(520px, 680px) minmax(620px, 1fr);
    gap: 16px;
    position: fixed;
    inset: 22px;
    z-index: 1000;
    overflow: auto;
    align-content: start;
    background: #fff;
    border: 2px solid #2563eb;
    border-radius: 8px;
    box-shadow:
        0 18px 50px rgba(15, 23, 42, 0.34),
        0 0 0 9999px rgba(15, 23, 42, 0.42);
    margin-top: 0;
    padding: 58px 18px 18px;
}

.edit-modal-head {
    position: fixed;
    top: 24px;
    left: 24px;
    right: 24px;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    background: #1f2937;
    color: #fff;
    border-radius: 6px 6px 0 0;
    padding: 0 14px;
}

.edit-modal-head strong {
    font-size: 18px;
}

.edit-modal-head button {
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: #64748b;
    color: #fff;
    padding: 0 14px;
    cursor: pointer;
}

.edit-layout .price-form {
    margin-top: 0;
}

@media (max-width: 1180px) {
    .edit-layout {
        grid-template-columns: 1fr;
    }

    .bulk-price-field {
        grid-template-columns: 1fr;
    }

    .bulk-route-field {
        grid-template-columns: 1fr;
    }
}

.is-hidden {
    display: none;
}

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

.small-price-grid label {
    color: #333;
    font-size: 14px;
}

#importRecordsInput {
    display: none;
}

.history-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 12px;
}

.history-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
    color: #333;
    font-size: 14px;
    background: #fff;
}

.history-table th,
.history-table td {
    border: 1px solid #d8d8d8;
    padding: 9px 10px;
    vertical-align: top;
}

.history-table th {
    background: #eee;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) {
    width: 76px;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2),
.history-table th:nth-child(6),
.history-table td:nth-child(6) {
    width: 70px;
}

.history-table th:nth-child(3),
.history-table td:nth-child(3),
.history-table th:nth-child(4),
.history-table td:nth-child(4),
.history-table th:nth-child(5),
.history-table td:nth-child(5) {
    min-width: 90px;
}

.history-table th:nth-child(7),
.history-table td:nth-child(7) {
    width: 42px;
    min-width: 42px;
    text-align: center;
}

.history-table th:nth-child(8),
.history-table td:nth-child(8) {
    width: 52px;
    min-width: 52px;
    text-align: center;
}

.history-table th:nth-child(9),
.history-table td:nth-child(9) {
    min-width: 90px;
}

.history-table th:nth-child(10),
.history-table td:nth-child(10) {
    min-width: 140px;
}

.history-table th:nth-child(12),
.history-table td:nth-child(12) {
    min-width: 130px;
}

.history-table th:nth-child(11),
.history-table td:nth-child(11) {
    max-width: 120px;
}

.history-table th:nth-child(13),
.history-table td:nth-child(13) {
    width: 230px;
    min-width: 230px;
}

.history-table tbody tr:nth-child(even) {
    background: #f7f7f7;
}

.passenger-page .history-table-wrap {
    overflow-x: visible;
}

.passenger-page .history-table {
    width: auto;
    min-width: 0;
    table-layout: fixed;
}

.passenger-page .history-table th,
.passenger-page .history-table td {
    padding: 9px 12px;
}

.passenger-page .history-table th:nth-child(1),
.passenger-page .history-table td:nth-child(1) {
    width: 86px;
    min-width: 86px;
}

.passenger-page .history-table th:nth-child(2),
.passenger-page .history-table td:nth-child(2),
.passenger-page .history-table th:nth-child(3),
.passenger-page .history-table td:nth-child(3),
.passenger-page .history-table th:nth-child(4),
.passenger-page .history-table td:nth-child(4) {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

.passenger-page .history-table th:nth-child(5),
.passenger-page .history-table td:nth-child(5) {
    width: 285px;
    min-width: 285px;
    max-width: 285px;
}

.passenger-page .history-table th:nth-child(6),
.passenger-page .history-table td:nth-child(6) {
    width: 170px;
    min-width: 170px;
    max-width: 170px;
    white-space: nowrap;
}

.history-prices {
    white-space: pre-wrap;
    color: #2563eb;
    line-height: 1.5;
}

.piece-cell {
    color: #16a34a;
    font-weight: bold;
}

.rate-cell {
    color: #be123c;
    font-weight: bold;
}

.history-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    max-width: 220px;
}

.history-actions button {
    background: #334155;
    color: #e2e8f0;
    border: 0;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 12px;
    cursor: pointer;
}

.history-actions button:last-child {
    background: #7f1d1d;
}

.output-actions button {
    background: #2563eb;
    padding: 5px 7px;
}

.output-actions button:last-child {
    background: #16a34a;
}

.note-cell {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.muted {
    color: #777;
}

.admin-page {
    max-width: 1500px;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.admin-nav-button {
    background: #334155;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    cursor: pointer;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(420px, 0.8fr);
    gap: 16px;
}

.admin-settings-panel {
    margin-bottom: 16px;
}

.settings-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.airline-rule-form {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px 10px;
    padding: 10px;
}

.airline-rule-form label {
    gap: 3px;
    font-size: 13px;
}

.airline-rule-form input,
.airline-rule-form select {
    height: 34px;
    padding: 6px 8px;
    font-size: 14px;
}

.airline-rule-form textarea {
    min-height: 68px;
    max-height: 150px;
    padding: 6px 8px;
    font-size: 14px;
    line-height: 1.45;
}

.airline-rule-form .wide-field {
    grid-column: span 2;
}

.airline-rule-form label:nth-of-type(29),
.airline-rule-form label:nth-of-type(30) {
    grid-column: span 3;
}

.airline-rule-form .inline-check {
    align-self: end;
    min-height: 34px;
}

.airline-rule-form .admin-actions {
    align-self: end;
    grid-column: span 2;
    margin-top: 0;
    padding: 0;
    border-top: 0;
    position: static;
}

.admin-panel {
    border: 1px solid #cfcfcf;
    background: #fff;
}

.admin-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #eee;
    border-bottom: 1px solid #cfcfcf;
}

.admin-panel h2 {
    color: #222;
    font-size: 18px;
    padding: 10px 12px;
}

.article-editor-head-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 10px;
}

.article-editor-head-actions button {
    height: 34px;
    border: 0;
    border-radius: 6px;
    background: #ff6a2a;
    color: #fff;
    padding: 0 12px;
    font-size: 14px;
    cursor: pointer;
}

.article-editor-head-actions .secondary-button {
    background: #64748b;
}

.admin-count {
    color: #666;
    font-size: 13px;
    font-weight: normal;
}

.admin-toggle {
    height: 30px;
    margin-right: 10px;
    border: 1px solid #bbb;
    border-radius: 5px;
    background: #fff;
    color: #333;
    padding: 0 10px;
    cursor: pointer;
}

.admin-panel.is-collapsed .admin-panel-body {
    display: none;
}

.admin-tools {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #cfcfcf;
}

.admin-tools input {
    flex: 1;
    min-width: 160px;
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    color: #222;
    background: #fff;
    padding: 8px 10px;
    font-size: 15px;
    outline: none;
}

.admin-tools button {
    height: 36px;
    background: #334155;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 14px;
    cursor: pointer;
}

.admin-file-button {
    display: inline-flex;
    align-items: center;
    height: 36px;
    background: #64748b;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 14px;
    cursor: pointer;
}

#importConfigInput {
    display: none;
}

.admin-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #cfcfcf;
}

.admin-summary div {
    border: 1px solid #d8d8d8;
    background: #f7f7f7;
    padding: 10px 12px;
}

.admin-summary b {
    display: block;
    color: #111827;
    font-size: 20px;
    line-height: 1.3;
}

.admin-summary span {
    color: #666;
    font-size: 13px;
}

.admin-note-box {
    padding: 12px 14px;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    background: #eff6ff;
    color: #1e3a8a;
    line-height: 1.7;
}

.admin-note-box p {
    margin: 0 0 6px;
}

.admin-note-box code {
    padding: 2px 5px;
    border-radius: 4px;
    background: #fff;
    color: #0f172a;
}

.admin-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #cfcfcf;
}

.admin-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #333;
    font-size: 14px;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
    width: 100%;
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    color: #222;
    background: #fff;
    padding: 8px 10px;
    font-size: 15px;
    outline: none;
}

.admin-form textarea {
    resize: vertical;
    min-height: 120px;
}

.admin-form .wide-field {
    grid-column: 1 / -1;
}

.admin-form .inline-check {
    flex-direction: row;
    align-items: center;
}

.admin-form .inline-check input {
    width: auto;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    position: sticky;
    bottom: 0;
    z-index: 2;
    grid-column: 1 / -1;
    margin-top: 4px;
    border-top: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.96);
    padding: 10px 0 0;
}

.admin-actions button {
    height: 38px;
    background: #ff6a2a;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 0 14px;
    font-size: 15px;
    cursor: pointer;
}

.admin-actions .secondary-button {
    background: #64748b;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    color: #333;
    font-size: 14px;
}

.admin-table th,
.admin-table td {
    border: 1px solid #d8d8d8;
    padding: 8px 9px;
    vertical-align: top;
}

.admin-table th {
    background: #f2f2f2;
    white-space: nowrap;
}

.admin-table tbody tr:nth-child(even) {
    background: #f7f7f7;
}

.admin-table .admin-warning-row td {
    background: #fff8e8;
}

.admin-preview {
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-health-samples {
    min-width: 360px;
}

.admin-record-link {
    display: block;
    color: #2563eb;
    text-decoration: none;
    line-height: 1.6;
    white-space: nowrap;
}

.admin-record-link:hover {
    text-decoration: underline;
}

.article-page {
    max-width: 1600px;
}

.article-keyword-input {
    width: 240px;
}

.article-layout {
    display: block;
}

.article-list-panel,
.article-editor-panel {
    border: 1px solid #cfcfcf;
    background: #fff;
}

.article-editor-panel {
    margin-top: 14px;
}

.article-page:not(.is-editing) .article-editor-panel {
    display: none;
}

.article-page.is-editing .article-list-panel {
    display: none;
}

.article-table {
    table-layout: fixed;
}

.article-table th:nth-child(1),
.article-table td:nth-child(1) {
    width: 58px;
}

.article-table th:nth-child(2),
.article-table td:nth-child(2) {
    width: 60px;
}

.article-table th:nth-child(3),
.article-table td:nth-child(3) {
    width: 86px;
}

.article-table th:nth-child(4),
.article-table td:nth-child(4) {
    width: 120px;
}

.article-table th:nth-child(7),
.article-table td:nth-child(7) {
    width: 130px;
}

.article-table th:nth-child(8),
.article-table td:nth-child(8),
.article-table th:nth-child(9),
.article-table td:nth-child(9) {
    width: 110px;
}

.article-table th:nth-child(10),
.article-table td:nth-child(10) {
    width: 96px;
}

.article-title-cell,
.article-summary-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-link {
    display: block;
    color: #2563eb;
    line-height: 1.5;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.article-link:hover {
    text-decoration: underline;
}

.article-scope {
    color: #777;
    font-size: 12px;
}

.article-general-label {
    display: inline-block;
    color: #475569;
    line-height: 1.6;
    white-space: nowrap;
}

.article-pin,
.article-tag,
.article-status-badge,
.article-review-badge,
.article-review-due {
    display: inline-block;
    max-width: 100%;
    margin: 0 4px 4px 0;
    padding: 2px 6px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1e3a8a;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
}

.article-pin {
    background: #fff7ed;
    color: #9a3412;
    font-weight: 700;
}

.article-status-badge {
    background: #f1f5f9;
    color: #334155;
}

.article-review-badge {
    background: #ecfdf5;
    color: #047857;
}

.article-review-due {
    background: #fef2f2;
    color: #b91c1c;
    font-weight: 700;
}

.article-form {
    grid-template-columns: 180px 180px 180px minmax(260px, 1fr);
    border-bottom: 0;
}

.article-check-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.article-check-label input {
    width: auto;
}

.article-form textarea {
    min-height: 90px;
}

.article-form #articleContent {
    min-height: 520px;
}

.article-editor-tools {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 8px;
    padding: 8px;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    background: #f8fafc;
}

.article-tool-group {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 6px;
    min-height: 72px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    padding: 8px;
}

.article-tool-group span {
    flex: 1 1 100%;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.article-editor-tools button {
    height: 32px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
    color: #1f2937;
    padding: 0 10px;
    cursor: pointer;
}

.article-editor-tools input[type="file"] {
    display: none;
}

.article-rich-editor {
    min-height: 520px;
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    background: #fff;
    padding: 12px;
    line-height: 1.7;
    outline: none;
    overflow: auto;
}

.article-source-editor {
    min-height: 520px;
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px;
    line-height: 1.6;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    outline: none;
}

.article-rich-editor:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.article-rich-editor img,
.article-viewer-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
}

.article-rich-editor h3,
.article-viewer-content h3 {
    margin: 16px 0 8px;
    font-size: 18px;
    line-height: 1.4;
}

.article-rich-editor blockquote,
.article-viewer-content blockquote {
    margin: 10px 0;
    padding: 8px 12px;
    border-left: 4px solid #94a3b8;
    background: #f8fafc;
    color: #334155;
}

.article-rich-editor hr,
.article-viewer-content hr {
    border: 0;
    border-top: 1px solid #cbd5e1;
    margin: 16px 0;
}

.article-notice-text {
    color: #b91c1c;
    font-weight: 700;
}

.article-content-table,
.article-rich-editor table,
.article-viewer-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.article-content-table th,
.article-content-table td,
.article-rich-editor th,
.article-rich-editor td,
.article-viewer-content th,
.article-viewer-content td {
    border: 1px solid #cbd5e1;
    padding: 6px 8px;
    vertical-align: top;
}

.article-content-table th,
.article-rich-editor th,
.article-viewer-content th {
    background: #f1f5f9;
    font-weight: 700;
}

.article-rich-editor img {
    cursor: pointer;
}

.article-rich-editor img.is-selected-article-image {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
}

.article-image-small {
    width: 240px;
}

.article-image-medium {
    width: 480px;
}

.article-image-large {
    width: 760px;
}

.article-image-original {
    width: auto;
}

.airline-profile-page {
    max-width: 1600px;
}

.airline-profile-hero {
    margin-bottom: 14px;
}

.airline-profile-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
}

.airline-profile-summary div {
    border: 1px solid #d8d8d8;
    background: #f8fafc;
    padding: 12px;
}

.airline-profile-summary b {
    display: block;
    font-size: 22px;
    color: #111827;
}

.airline-profile-summary span {
    color: #666;
    font-size: 13px;
}

.airline-profile-grid {
    display: grid;
    grid-template-columns: minmax(360px, 0.55fr) minmax(0, 1fr) minmax(360px, 0.65fr);
    gap: 14px;
    margin-bottom: 14px;
}

.airline-link-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
}

.airline-quick-link {
    display: flex;
    align-items: center;
    min-height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #075985;
    background: #f8fafc;
    text-decoration: none;
    padding: 8px 10px;
    font-size: 14px;
}

.airline-quick-link:hover {
    background: #e0f2fe;
}

.airline-rule-list {
    padding: 12px;
}

.airline-rule-item {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.airline-rule-item b {
    color: #111827;
}

.airline-rule-item span {
    white-space: pre-wrap;
}

.airline-tail-box {
    padding: 12px;
    line-height: 1.7;
}

.airline-tail-box p {
    margin: 0 0 10px;
}

.airline-work-card {
    margin: 0;
    padding: 14px;
    min-height: 120px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    font-family: inherit;
    font-size: 14px;
    color: #1f2937;
}

.empty-state {
    color: #777;
    padding: 12px;
}

.airline-record-table th:nth-child(3),
.airline-record-table td:nth-child(3),
.airline-record-table th:nth-child(4),
.airline-record-table td:nth-child(4) {
    width: 160px;
}

.airline-notice-panel {
    border: 1px solid #f59e0b;
    background: #fffbeb;
    margin: 10px 0 14px;
}

.airline-notice-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid #fde68a;
}

.airline-notice-head strong {
    color: #7c2d12;
    font-size: 16px;
}

.airline-notice-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.airline-notice-actions a,
.airline-notice-actions button {
    border: 1px solid #f59e0b;
    border-radius: 6px;
    background: #fff;
    color: #92400e;
    padding: 6px 9px;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
}

.airline-notice-body {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 10px 12px;
}

.airline-notice-body div {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
    line-height: 1.5;
}

.airline-notice-body b {
    color: #78350f;
}

.airline-notice-body span {
    color: #333;
    white-space: pre-wrap;
}

.airline-notice-body .is-important {
    grid-column: span 3;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    padding: 6px 8px;
}

.article-viewer-panel {
    margin: 14px 0;
    background: #fff;
}

.article-viewer-meta,
.article-viewer-links,
.article-viewer-content {
    padding: 10px 14px;
    border-top: 1px solid #e5e7eb;
}

.article-viewer-meta {
    color: #666;
    font-size: 13px;
}

.article-viewer-tags {
    margin-bottom: 8px;
}

.article-internal-note {
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid #fde68a;
    border-radius: 6px;
    background: #fffbeb;
    color: #78350f;
    white-space: pre-wrap;
}

.article-internal-note b {
    display: block;
    margin-bottom: 4px;
}

.article-viewer-content {
    font-size: 15px;
    line-height: 1.8;
    min-height: 360px;
}

.article-viewer-content p {
    margin: 0 0 10px;
}

.danger-button {
    background: #991b1b !important;
}

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

    .article-layout {
        display: block;
    }

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

    .article-editor-tools {
        grid-template-columns: 1fr;
    }

    .article-editor-head-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .action-group-main {
        margin-left: 0;
    }

    .airline-profile-summary,
    .airline-profile-grid,
    .airline-notice-body {
        grid-template-columns: 1fr;
    }

    .airline-notice-body .is-important {
        grid-column: auto;
    }

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

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

}

@media (max-width: 1280px) {
    .airline-rule-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .airline-rule-form .wide-field,
    .airline-rule-form label:nth-of-type(29),
    .airline-rule-form label:nth-of-type(30),
    .airline-rule-form .admin-actions {
        grid-column: 1 / -1;
    }
}
