* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: #f4f6f8;
    color: #1f2937;
}

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

.header {
    background: #b6292f;
    color: #fff;
    padding: 14px 0;
    margin-bottom: 20px;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

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

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    height: 42px;
    width: auto;
    display: block;
    object-fit: contain;
}

nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

nav a,
.link-button {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.font-size-label {
    color: #fff;
    font-weight: 600;
}

.font-size-select {
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 6px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.95rem;
}

.font-size-select option {
    color: #111827;
}

.inline-form {
    margin: 0;
}

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
    padding: 20px;
    margin-bottom: 20px;
}

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

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

.input {
    width: 100%;
    border: 1px solid #c9d2dc;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
}

.html-editor {
    min-height: 220px;
    border: 1px solid #c9d2dc;
    border-radius: 6px;
    background: #fff;
    padding: 10px 12px;
    overflow: auto;
}

.html-editor:focus {
    outline: 2px solid #93c5fd;
    outline-offset: 1px;
}

.button {
    display: inline-block;
    border: 0;
    border-radius: 6px;
    background: #0b3558;
    color: #fff;
    text-decoration: none;
    padding: 9px 14px;
    cursor: pointer;
    font-weight: 600;
}

.button-secondary {
    background: #4b5563;
}

.button-light {
    background: #e5e7eb;
    color: #111827;
}

.button-danger {
    background: #b51b26;
}

.button-tab-active {
    background: #0b3558;
    color: #fff;
}

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

.order-search-form .form-group {
    margin-bottom: 0;
}

.order-search-form {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px;
    background: #f9fafb;
}

.order-search-order-number {
    flex: 0 1 170px;
}

.order-search-date {
    flex: 0 1 170px;
}

.order-search-fulltext {
    flex: 0 1 310px;
}

.details-title {
    margin: 0 0 12px 0;
}

.details-top-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    overflow-x: auto;
}

.details-actions-left,
.details-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.details-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 20px;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    background: #ffffff;
}

.details-meta-item strong {
    margin-right: 4px;
}

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

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

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    padding: 10px 6px;
    vertical-align: top;
}

.validation {
    color: #b91c1c;
    font-size: 13px;
}

.success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #14532d;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 12px;
}

.page-footer {
    margin: 20px 0 10px;
    color: #6b7280;
}

.page-footer .container {
    text-align: right;
}

@media (max-width: 900px) {
    .header .container {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .order-search-order-number,
    .order-search-date,
    .order-search-fulltext {
        flex: 1 1 100%;
    }

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