/* Corporate Style: Navy Blue, White, Gold */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

header {
    background-color: #003366;
    color: white;
    padding: 0.75rem 1rem;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.nav-container h1 {
    font-size: 1.5rem;
    margin: 0;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.5rem;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 0.8rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    font-weight: 600;
}

nav a:hover,
nav a:focus {
    background-color: #FFD700;
    color: #003366;
}

.user-badge {
    font-size: 0.9rem;
    border: 1px solid #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

main {
    max-width: 1200px;
    margin: 1.75rem auto;
    padding: 0 1rem;
}

h1,
h2,
h3 {
    color: #003366;
    margin: 0.75rem 0;
}

h1 {
    font-size: 1.75rem;
}

h2 {
    font-size: 1.3rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.stat-card h3 {
    margin: 0;
    font-size: 1rem;
    color: #666;
}

.stat-card p {
    margin: 0.5rem 0 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: #003366;
}

.stat-card--pending p {
    color: #a05c00;
}

.stat-card--approved p {
    color: #1a7a3c;
}

/* Dashboard hero */
.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dashboard-kicker {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5e7087;
    margin: 0 0 0.2rem;
}

.dashboard-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.5rem 0 0.75rem;
}

.dashboard-section-header h2 {
    margin: 0;
}

.dashboard-view-all {
    font-size: 0.88rem;
    font-weight: 600;
    color: #003366;
    text-decoration: none;
}

.dashboard-view-all:hover {
    text-decoration: underline;
}

/* Relation badge */
.relation-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.relation-creator {
    background: #e8eef8;
    color: #003366;
}

.relation-cc {
    background: #e8f6ef;
    color: #1a7a3c;
}

.relation-to {
    background: #fef3e2;
    color: #b45309;
}

.relation-admin {
    background: #f0eaff;
    color: #5b21b6;
}

/* Empty state */
.empty-state {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: #5e7087;
}

.empty-state p {
    margin: 0 0 1rem;
    font-size: 1rem;
}

/* List filter bar */
.list-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    background: #fff;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
    margin-bottom: 1rem;
}

.list-filter-bar label {
    font-weight: 600;
    color: #003366;
    margin: 0;
}

.list-filter-bar select {
    padding: 0.45rem 0.6rem;
    border: 1px solid #c8d6e5;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #1a2e4a;
    background: #f7faff;
}

.list-filter-clear {
    font-size: 0.85rem;
    color: #e05555;
    font-weight: 600;
    text-decoration: none;
}

.list-filter-clear:hover {
    text-decoration: underline;
}

.list-total {
    margin-left: auto;
    font-size: 0.85rem;
    color: #5e7087;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    justify-content: center;
}

.page-btn {
    display: inline-block;
    min-width: 2.2rem;
    padding: 0.4rem 0.55rem;
    border-radius: 6px;
    border: 1px solid #c8d6e5;
    background: #fff;
    color: #003366;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.page-btn:hover {
    background: #003366;
    color: #fff;
    border-color: #003366;
}

.page-btn--active {
    background: #003366;
    color: #fff;
    border-color: #003366;
    cursor: default;
    pointer-events: none;
}

.pagination-info {
    margin-left: 0.5rem;
    font-size: 0.83rem;
    color: #5e7087;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

th,
td {
    padding: 0.9rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e3e8ee;
}

th {
    background: #003366;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
}

tr:nth-child(even) {
    background-color: #f9fafc;
}

a.button-link,
button,
input[type="submit"] {
    display: inline-block;
    border: none;
    background-color: #003366;
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

button:hover,
input[type="submit"]:hover,
a.button-link:hover {
    background-color: #FFD700;
    color: #003366;
    transform: translateY(-1px);
}

form {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

input,
select,
textarea {
    border: 1px solid #dfe5ef;
    border-radius: 6px;
    padding: 0.6rem;
    width: 100%;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    background: #fff;
}

textarea {
    min-height: 140px;
}

select[multiple] {
    min-height: 120px;
}

.memo-view {
    background: white;
    padding: 1.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.memo-details p {
    margin: 0.4rem 0;
}

.content {
    white-space: pre-wrap;
    border: 1px solid #dfe5ef;
    padding: 1rem;
    border-radius: 6px;
    background: #f7f9fc;
    margin-top: 0.5rem;
}

/* ===== Login Page ===== */
.login-page {
    background: linear-gradient(135deg, #0d2c54 0%, #184a86 60%, #1c6ab5 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    width: 100%;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
    padding: 2.5rem 2.25rem 2rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    margin-bottom: 0.4rem;
}

.login-logo-abbr {
    display: inline-block;
    background: linear-gradient(135deg, #0a3d75, #1c75d4);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    padding: 0.3rem 0.9rem;
    border-radius: 8px;
    margin-bottom: 0.35rem;
}

.login-logo-name {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0a2d58;
    letter-spacing: -0.01em;
}

.login-subtitle {
    font-size: 0.85rem;
    color: #6b7c91;
    margin: 0 0 1.6rem;
}

.login-error {
    background: #fff0ed;
    color: #b33b24;
    border: 1px solid #f0c2b7;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    text-align: left;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.login-field label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #17385f;
    letter-spacing: 0.04em;
}

.login-field input {
    padding: 0.65rem 0.9rem;
    border: 1px solid #ccd8e6;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #1a2e4a;
    background: #f8fafd;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.login-field input:focus {
    outline: none;
    border-color: #1f5ea8;
    box-shadow: 0 0 0 4px rgba(31, 94, 168, 0.12);
    background: #fff;
}

.login-btn {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #0f4c8a 0%, #1c75d4 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(15, 76, 138, 0.3);
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.login-btn:hover {
    background: linear-gradient(135deg, #0a3467 0%, #1460b5 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 76, 138, 0.38);
}

.login-btn:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 1.75rem;
    font-size: 0.78rem;
    color: #9baebe;
}

/* Legacy login-container (compat) */
.login-container {
    max-width: 420px;
    margin: 5rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    text-align: center;
}

.login-container h1 {
    margin-bottom: 1rem;
}

.login-container input {
    width: 100%;
    margin-bottom: 0.8rem;
}

.login-container button {
    width: 100%;
}

.error {
    color: #c0392b;
    margin-bottom: 1rem;
    font-weight: 700;
}

.message {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-weight: 600;
}

.message.success {
    background: #e9f7ef;
    color: #1e7a46;
    border: 1px solid #bfe4ca;
}

.message.error {
    background: #fff0ed;
    color: #b33b24;
    border: 1px solid #f0c2b7;
}

.memo-create-page {
    display: grid;
    gap: 1.25rem;
}

.memo-create-hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.75rem 1.9rem;
    border-radius: 22px;
    background: linear-gradient(135deg, #0d2c54 0%, #184a86 62%, #f4c74d 160%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 40px rgba(0, 33, 71, 0.18);
}

.memo-create-kicker {
    margin: 0 0 0.45rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.memo-create-hero h1 {
    color: #fff;
    font-size: 2.1rem;
    margin: 0;
}

.memo-create-stamp {
    min-width: 120px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.memo-create-stamp-logo {
    width: 90px;
    height: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
}

.memo-create-stamp span {
    display: block;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.memo-create-stamp strong {
    display: block;
    margin-top: 0.35rem;
    color: #fff;
    font-size: 1.2rem;
}

.memo-create-form {
    padding: 1.7rem;
    border-radius: 22px;
    border: 1px solid #d7e1ec;
    box-shadow: 0 16px 36px rgba(14, 31, 53, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 253, 0.98)),
        repeating-linear-gradient(180deg, transparent 0, transparent 31px, rgba(213, 222, 234, 0.35) 32px);
}

.memo-paper-header {
    padding: 0 0 1.25rem;
    margin-bottom: 1.2rem;
}

.memo-paper-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: linear-gradient(180deg, #fefefe 0%, #f7f9fc 100%);
    border: 2px solid #17385f;
    box-shadow: none;
}

.memo-paper-table td {
    border: 1px solid #17385f;
    padding: 0.55rem 0.8rem;
    vertical-align: middle;
    background: rgba(255, 255, 255, 0.96);
}

.memo-paper-fmms {
    width: 18%;
    text-align: center;
    vertical-align: middle;
    background: linear-gradient(135deg, #123761 0%, #1d4f86 100%) !important;
}

.memo-paper-logo {
    width: 64px;
    height: auto;
    display: block;
    object-fit: contain;
    margin: 0 auto;
}

.memo-paper-doc-title {
    width: 50%;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%) !important;
}

.memo-paper-doc-title strong,
.memo-paper-doc-title span {
    display: inline-block;
    vertical-align: baseline;
}

.memo-paper-doc-title strong {
    margin-right: 0.45rem;
    font-size: 1.2rem;
    color: #143a63;
}

.memo-paper-doc-title span {
    color: #5f6f82;
    font-size: 0.92rem;
}

.memo-paper-meta-cell {
    width: 32%;
    text-align: right;
    background: linear-gradient(180deg, #fffaf0 0%, #f9edd0 100%) !important;
}

.memo-paper-meta-label {
    color: #7d5a00;
    font-size: 0.9rem;
    margin-right: 0.45rem;
    font-weight: 700;
}

.memo-paper-meta-cell strong {
    font-size: 1.05rem;
    color: #17385f;
}

.memo-paper-issuer-cell {
    text-align: left;
    background: linear-gradient(180deg, #f9fbfe 0%, #eef3f8 100%) !important;
}

.memo-paper-issuer-cell strong,
.memo-paper-issuer-email {
    display: inline-block;
    vertical-align: baseline;
}

.memo-paper-issuer-cell strong {
    font-size: 1.05rem;
    color: #17385f;
    margin-right: 0.45rem;
}

.memo-paper-issuer-email {
    color: #5d6f86;
    font-size: 0.92rem;
}

.memo-paper-spacer {
    background: linear-gradient(180deg, #f9fbfd 0%, #f1f5f9 100%) !important;
}

.memo-paper-label {
    display: block;
    margin: 0 0 0.3rem;
    color: #71839a;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.memo-form-section {
    padding: 1rem 1.05rem;
    border: 1px solid #dce5ef;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
}

.memo-routing-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 1rem;
    align-items: start;
}

.memo-routing-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.field-caption,
.empty-note {
    color: #6b7c91;
    font-size: 0.86rem;
}

.empty-note {
    margin: 0.25rem 0 0;
}

.memo-form-section label {
    font-size: 0.96rem;
    color: #17385f;
}

/* ── CC Chip Picker ── */
.cc-section>label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #17385f;
    margin-bottom: 0.5rem;
}

.cc-section>label::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1f5ea8 0%, #3a9ad9 100%);
    flex-shrink: 0;
}

.cc-picker-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    flex-direction: column;
}

.cc-search-wrapper {
    position: relative;
}

#cc_search {
    padding: 0.6rem 0.9rem;
    border: 1px solid #ccd8e6;
    border-radius: 12px;
    background: #fff;
    font-size: 0.9rem;
    color: #1a2e4a;
    width: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#cc_search::placeholder {
    color: #8fa8c4;
}

#cc_search:focus {
    outline: none;
    border-color: #1f5ea8;
    box-shadow: 0 0 0 4px rgba(31, 94, 168, 0.12);
}

.cc-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #b8d0eb;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(15, 76, 138, 0.15);
    z-index: 200;
    max-height: 210px;
    overflow-y: auto;
}

.cc-suggestions.open {
    display: block;
}

.cc-suggestion-item {
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: #1a2e4a;
    border-bottom: 1px solid #f0f5fb;
    transition: background 0.12s ease;
}

.cc-suggestion-item:last-child {
    border-bottom: none;
}

.cc-suggestion-item:hover,
.cc-suggestion-item.active {
    background: #e8f2ff;
    color: #0d3560;
}

.cc-suggestion-empty {
    padding: 0.55rem 0.9rem;
    font-size: 0.85rem;
    color: #8fa8c4;
}

.cc-picker-controls {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.cc-picker-row select {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border: 1px solid #ccd8e6;
    border-radius: 12px;
    background: #fff;
    font-size: 0.9rem;
    color: #1a2e4a;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231f5ea8' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.2rem;
}

.cc-picker-row select:focus {
    outline: none;
    border-color: #1f5ea8;
    box-shadow: 0 0 0 4px rgba(31, 94, 168, 0.12);
}

#cc_add_btn {
    width: 42px;
    flex-shrink: 0;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #0f4c8a 0%, #1c75d4 100%);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(15, 76, 138, 0.25);
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

#cc_add_btn:hover {
    background: linear-gradient(135deg, #0a3467 0%, #1460b5 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(15, 76, 138, 0.32);
}

#cc_add_btn:active {
    transform: translateY(0);
}

.cc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.6rem;
    min-height: 0;
}

.cc-chips:not(:empty) {
    padding: 0.65rem 0.75rem;
    border: 1px dashed #b8d0eb;
    border-radius: 12px;
    background: #f5f9ff;
}

.cc-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.55rem 0.3rem 0.75rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #dbeeff 0%, #e8f3ff 100%);
    border: 1px solid #9ec4e8;
    font-size: 0.83rem;
    font-weight: 600;
    color: #0d3560;
    white-space: nowrap;
}

.cc-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: rgba(15, 76, 138, 0.12);
    color: #0d3560;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.cc-chip-remove:hover {
    background: rgba(200, 50, 50, 0.18);
    color: #a00;
}

.cc-chip-role {
    font-size: 0.5rem;
    margin-left: 0.2rem;
    color: #1c5ca3;
}

.memo-create-form input,
.memo-create-form select,
.memo-create-form textarea {
    margin-bottom: 0;
    border: 1px solid #ccd8e6;
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.follow-up-date-field {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
    max-width: 320px;
}

.follow-up-date-field input[type="date"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.follow-up-date-field input[readonly] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ccd8e6;
    border-radius: 12px;
    background: #fff;
    color: #1a2e4a;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11zm0-13H5V6h14v1zm-5 6h-4v4h4v-4z' fill='%231f5ea8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem 1.2rem;
}

.follow-up-date-field input[readonly]:focus {
    outline: none;
    border-color: #1f5ea8;
    box-shadow: 0 0 0 4px rgba(31, 94, 168, 0.12);
}

.memo-create-form input:focus,
.memo-create-form select:focus,
.memo-create-form textarea:focus {
    outline: none;
    border-color: #1f5ea8;
    box-shadow: 0 0 0 4px rgba(31, 94, 168, 0.12);
}

.memo-create-form textarea {
    line-height: 1.7;
}

.approver-section>label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0f4c8a;
}

.approver-section>label::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f4c8a 0%, #d0a321 100%);
    flex-shrink: 0;
}

.approver-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.approver-card {
    padding: 1rem 3rem 1rem 1.5rem;
    border-radius: 14px;
    border: 1px solid #b8d0eb;
    background: linear-gradient(125deg, #eef5ff 0%, #ffffff 55%, #fffef8 100%);
    box-shadow: 0 2px 12px rgba(15, 76, 138, 0.09);
    position: relative;
    transition: box-shadow 0.2s ease, transform 0.18s ease;
}

.approver-card:hover {
    box-shadow: 0 6px 20px rgba(15, 76, 138, 0.16);
    transform: translateY(-2px);
}

.approver-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #0f4c8a 0%, #d0a321 100%);
    border-radius: 14px 0 0 14px;
}

.approver-card::after {
    content: '✓';
    position: absolute;
    right: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.6rem;
    font-weight: 900;
    color: #0f4c8a;
    opacity: 0.10;
    line-height: 1;
    pointer-events: none;
}

.approver-card strong,
.approver-card small {
    display: block;
}

.approver-card strong {
    font-size: 1rem;
    font-weight: 700;
    color: #0d3560;
    letter-spacing: 0.01em;
}

.approver-card small {
    margin-top: 0.25rem;
    color: #4a6480;
    font-size: 0.82rem;
}

.memo-submit-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e4ecf5;
}

.memo-submit-row button {
    min-width: 220px;
    padding: 0.9rem 1.4rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #0a3d75 0%, #1c5ca3 100%);
    box-shadow: 0 14px 22px rgba(10, 61, 117, 0.16);
}

.memo-submit-row button:hover {
    background: linear-gradient(135deg, #d6ad34 0%, #f0ca59 100%);
}

/* ══════════════════════════════════════
   Memo View Page (read-only)
══════════════════════════════════════ */

/* read-only field replaces <input>/<textarea> */
.memo-view-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid #dce6f0;
    background: #f7fafd;
    color: #1a2e4a;
    font-size: 0.95rem;
    line-height: 1.6;
    min-height: 2.75rem;
    box-sizing: border-box;
}

.memo-view-content {
    min-height: 10rem;
    white-space: pre-wrap;
    line-height: 1.8;
}

/* CC chips without remove button (static) */
.cc-chips--static {
    padding: 0.65rem 0.75rem;
    border: 1px dashed #b8d0eb;
    border-radius: 12px;
    background: #f5f9ff;
    margin-top: 0.35rem;
}

.cc-chips--static .cc-chip {
    cursor: default;
}

/* CC read status list */
.cc-read-status-list {
    list-style: none;
    margin: 0.6rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cc-read-status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #e0e8f2;
    background: #f7faff;
}

.cc-read-status--read {
    border-color: #b6dfc8;
    background: #f0fbf4;
}

.cc-read-status--unread {
    border-color: #e0e8f2;
    background: #f7faff;
}

.cc-read-status-icon {
    font-size: 0.9rem;
    width: 1rem;
    text-align: center;
}

.cc-read-status--read .cc-read-status-icon {
    color: #1a7a3c;
}

.cc-read-status--unread .cc-read-status-icon {
    color: #aab8cc;
}

.cc-read-status-name {
    flex: 1;
    font-weight: 600;
    color: #1a2e4a;
}

.cc-read-status-time {
    font-size: 0.75rem;
    color: #5e7087;
}

.cc-read-status--read .cc-read-status-time {
    color: #1a7a3c;
    font-weight: 600;
}

/* Status badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.status-badge--lg {
    font-size: 0.95rem;
    padding: 0.45rem 1.1rem;
}

.status-pending {
    background: #fff3cd;
    color: #7a5200;
    border: 1px solid #f0c040;
}

.status-approved {
    background: #d4edda;
    color: #155724;
    border: 1px solid #6fc88a;
}

.status-rejected {
    background: #fde8e8;
    color: #7a1010;
    border: 1px solid #f0a0a0;
}

.status-cancelled {
    background: #f5c6cb;
    color: #721c24;
    border: 1px solid #f1a1aa;
}

.memo-view-status-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid #dce6f0;
    background: #f7fafd;
    margin-top: 0.25rem;
}

.memo-view-approved-date {
    font-size: 0.82rem;
    color: #5e7087;
    margin: 0;
}

/* Back + print row */
.memo-submit-row .button-link {
    min-width: 180px;
    text-align: center;
    padding: 0.9rem 1.4rem;
    border-radius: 14px;
}

/* ══════════════════════════════════════
   Approve Page
══════════════════════════════════════ */
.approve-page {
    max-width: 780px;
    margin: 0 auto;
}

/* Hero */
.approve-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.approve-hero h1 {
    font-size: 1.5rem;
    margin: 0.25rem 0 0;
}

.approve-kicker {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #b8860b;
    margin: 0;
}

.approve-approver-badge {
    text-align: right;
    flex-shrink: 0;
    background: linear-gradient(135deg, #eef5ff, #fffef8);
    border: 1px solid #b8d0eb;
    border-radius: 12px;
    padding: 0.6rem 1rem;
}

.approve-approver-badge span {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0f4c8a;
    margin-bottom: 2px;
}

.approve-approver-badge strong {
    font-size: 0.95rem;
    color: #0d3560;
}

/* Paper */
.approve-paper {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #d0dcea;
    box-shadow: 0 4px 24px rgba(10, 61, 117, 0.08);
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.approve-paper-header {
    background: linear-gradient(135deg, #0a3d75 0%, #1c5ca3 100%);
    padding: 1.1rem 1.5rem;
}

.approve-meta-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.approve-meta-table td {
    padding: 0.3rem 0.5rem;
    border: none;
    border-bottom: none;
    background: transparent;
    vertical-align: middle;
}

.approve-meta-table tr:nth-child(even) {
    background: transparent;
}

.approve-meta-fmms {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.05em;
    width: 80px;
}

.approve-paper-header .approve-meta-table td strong:not(.status-badge) {
    display: block;
    font-size: 1rem;
    color: #fff;
    font-weight: 700;
}

.approve-paper-header .approve-meta-table td span {
    display: block;
    font-size: 0.75rem;
    color: #a8c4e0;
}

.approve-meta-right {
    text-align: right;
    white-space: nowrap;
}

.approve-meta-right strong:not(.status-badge) {
    display: block;
    font-size: 0.95rem;
    color: #fff;
}

.approve-meta-label {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a8c4e0;
    margin-bottom: 2px;
}

.approve-meta-issuer strong {
    display: block;
    font-size: 0.95rem;
    color: #fff;
}

.approve-meta-email {
    font-size: 0.78rem;
    color: #a8c4e0;
}

.approve-paper-body {
    padding: 1.5rem;
    display: grid;
    gap: 1.25rem;
}

.approve-field label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0f4c8a;
    margin-bottom: 0.5rem;
}

.approve-field label::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f4c8a, #d0a321);
    flex-shrink: 0;
}

.approve-subject-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0d1f3c;
    margin: 0;
    line-height: 1.5;
}

.approve-content-box {
    background: #f5f9ff;
    border: 1px solid #dce6f0;
    border-left: 4px solid #1c5ca3;
    border-radius: 10px;
    padding: 1rem 1.1rem;
    font-size: 0.95rem;
    color: #1a2e4a;
    line-height: 1.8;
}

.approve-cc-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.approve-cc-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: #dbeeff;
    border: 1px solid #9ec4e8;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0d3560;
}

/* Action bar */
.approve-action-bar {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #d0dcea;
    box-shadow: 0 4px 20px rgba(10, 61, 117, 0.07);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    text-align: center;
}

.approve-action-note {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #5e7087;
    line-height: 1.5;
    max-width: 480px;
}

.approve-action-note span {
    font-size: 1.1rem;
    color: #b8860b;
    flex-shrink: 0;
    margin-top: 1px;
}

.approve-action-form {
    width: 100%;
}

.approve-btn-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.approve-confirm-panel {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    text-align: center;
    padding: 1rem;
    background: #fff8e6;
    border: 1.5px solid #e6c44a;
    border-radius: 12px;
    max-width: 420px;
}

.approve-confirm-label {
    font-size: 0.95rem;
    color: #5a3e00;
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.approve-confirm-btns {
    display: flex;
    gap: 0.65rem;
    justify-content: center;
    flex-wrap: wrap;
}

.approve-confirm-btn--sm {
    padding: 0.7rem 1.4rem;
    font-size: 0.95rem;
    max-width: none;
    width: auto;
}

.approve-confirm-btn {
    width: 100%;
    max-width: 360px;
    padding: 1rem 2rem;
    border-radius: 14px;
    background: #1a7a3c;
    box-shadow: 0 6px 20px rgba(26, 122, 60, 0.30);
    font-size: 1.1rem;
    letter-spacing: 0.03em;
}

.approve-confirm-btn:hover {
    background: #155f30;
}

.approve-cancel-btn {
    display: inline-block;
    padding: 0.8rem 1.25rem;
    border-radius: 12px;
    border: 1.5px solid #ccd8e6;
    background: #fff;
    color: #5e7087;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.approve-cancel-btn:hover {
    background: #f0f4f9;
    border-color: #9eb5cf;
}

.is-submitting {
    opacity: 0.78;
}

.form-loading-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(7, 24, 47, 0.52);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
    z-index: 9999;
}

.form-loading-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.form-loading-card {
    width: min(100%, 420px);
    padding: 1.5rem 1.4rem;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
    box-shadow: 0 24px 60px rgba(2, 15, 34, 0.28);
    text-align: center;
}

.form-loading-spinner {
    width: 52px;
    height: 52px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    border: 4px solid #d8e4f2;
    border-top-color: #0a3d75;
    animation: form-loading-spin 0.9s linear infinite;
}

.form-loading-title {
    margin: 0;
    color: #0a3d75;
    font-size: 1.15rem;
    font-weight: 700;
}

.form-loading-message {
    margin: 0.55rem 0 0;
    color: #52657d;
    font-size: 0.95rem;
    line-height: 1.6;
}

@keyframes form-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

/* State cards (success / error) */
.approve-state-card {
    text-align: center;
    padding: 3rem 2rem;
    border-radius: 20px;
    border: 1px solid #d0dcea;
    background: #fff;
    box-shadow: 0 4px 24px rgba(10, 61, 117, 0.08);
    max-width: 500px;
    margin: 2rem auto;
}

.approve-state-icon {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 1rem;
}

.approve-state-success .approve-state-icon {
    color: #1a7a3c;
}

.approve-state-error .approve-state-icon {
    color: #c0392b;
}

.approve-state-card h2 {
    font-size: 1.4rem;
    margin: 0 0 0.5rem;
}

.approve-state-success h2 {
    color: #1a7a3c;
}

.approve-state-error h2 {
    color: #c0392b;
}

.approve-state-memo-no {
    font-size: 1rem;
    font-weight: 700;
    color: #0a3d75;
    margin: 0.25rem 0;
}

.approve-state-subject {
    font-size: 0.9rem;
    color: #5e7087;
    margin: 0 0 0.75rem;
}

.approve-state-note {
    font-size: 0.85rem;
    color: #1a7a3c;
    background: #edf7f1;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    display: inline-block;
    margin-bottom: 1.25rem;
}

.approve-state-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.approve-back-btn {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #0a3d75 0%, #1c5ca3 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease;
}

.approve-back-btn:hover {
    background: linear-gradient(135deg, #d6ad34 0%, #f0ca59 100%);
    color: #0a3d75;
}

.approve-back-btn--ghost {
    background: transparent;
    border: 1.5px solid #ccd8e6;
    color: #5e7087;
}

.approve-back-btn--ghost:hover {
    background: #f0f4f9;
    color: #0a3d75;
    border-color: #9eb5cf;
}

footer {
    text-align: center;
    padding: 1rem;
    background-color: #003366;
    color: white;
    margin-top: 2rem;
}

@media (max-width: 900px) {
    .nav-container {
        flex-wrap: wrap;
    }

    nav ul {
        flex-wrap: wrap;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .memo-create-hero,
    .memo-paper-header {
        flex-direction: column;
    }

    .memo-routing-grid {
        grid-template-columns: 1fr;
    }

    .memo-paper-table,
    .memo-paper-table tbody,
    .memo-paper-table tr,
    .memo-paper-table td {
        display: block;
        width: 100%;
    }

    .memo-paper-meta-cell {
        text-align: left;
    }

    .memo-create-stamp {
        width: 100%;
    }
}

/* ─── Hamburger button (hidden on desktop) ─────────────────── */
.nav-hamburger {
    display: none;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    line-height: 1;
    margin-left: auto;
    box-shadow: none;
    transform: none;
    transition: background 0.2s;
}

.nav-hamburger:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
    transform: none !important;
}

/* ─── Tablet / Large phone (≤ 768px) ────────────────────────── */
@media (max-width: 768px) {

    /* Show hamburger, hide full nav by default */
    .nav-hamburger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-container {
        flex-wrap: wrap;
        align-items: center;
    }

    .nav-right {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        padding-top: 0.6rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        margin-top: 0.5rem;
    }

    .nav-right.open {
        display: flex;
    }

    .user-badge {
        width: 100%;
        font-size: 0.82rem;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0.2rem;
    }

    nav a {
        display: block;
        padding: 0.6rem 0.75rem;
    }

    /* Tables — horizontal scroll instead of overflow */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    th,
    td {
        white-space: normal;
        min-width: 90px;
    }

    /* Memo submit row — stack buttons */
    .memo-submit-row {
        flex-direction: column;
        align-items: stretch;
    }

    .memo-submit-row button,
    .memo-submit-row .button-link {
        width: 100%;
        text-align: center;
        min-width: unset;
    }

    /* Approve hero — stack */
    .approve-hero {
        flex-direction: column;
    }

    .approve-approver-badge {
        text-align: left;
        width: 100%;
    }

    /* Memo view padding */
    .memo-view {
        padding: 1rem;
    }

    /* Report filter — single column */
    .report-search-grid {
        grid-template-columns: 1fr;
    }

    /* List filter bar */
    .list-total {
        margin-left: 0;
        width: 100%;
    }

    /* Dashboard section header */
    .dashboard-section-header {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    /* Approve action bar */
    .approve-action-bar {
        padding: 1rem;
    }

    /* Executive approval box responsive */
    .exec-approval-btn-group {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .exec-submit-btn {
        width: 100% !important;
    }
}

/* ─── Small phone (≤ 480px) ─────────────────────────────────── */
@media (max-width: 480px) {
    main {
        margin: 0.75rem auto;
        padding: 0 0.75rem;
    }

    h1 {
        font-size: 1.35rem;
    }

    h2 {
        font-size: 1.1rem;
    }

    .nav-container h1 {
        font-size: 1.15rem;
    }

    /* Stats cards */
    .stat-card p {
        font-size: 1.3rem;
    }

    /* Form */
    form {
        padding: 0.85rem 1rem;
    }

    .memo-create-form {
        padding: 1rem;
        border-radius: 14px;
    }

    .memo-create-hero {
        padding: 1.1rem 1.2rem;
        border-radius: 14px;
    }

    .memo-create-hero h1 {
        font-size: 1.45rem;
    }

    /* Filter bar — fully stacked */
}
    .list-filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .list-filter-bar select {
        width: 100%;
    }

    /* Pagination — smaller buttons */
    .pagination {
        gap: 0.2rem;
    }

    .page-btn {
        min-width: 1.9rem;
        padding: 0.3rem 0.4rem;
        font-size: 0.8rem;
    }

    /* Approve page */
    .approve-page {
        max-width: 100%;
    }

    .approve-paper-body {
        padding: 1rem;
    }

    /* Status badges compact */
    .status-badge--lg {
        font-size: 0.85rem;
        padding: 0.35rem 0.8rem;
    }

    /* CC chips wrap fully */
    .cc-chip {
        font-size: 0.78rem;
    }
}

/* ─── Report page ──────────────────────────────────────────── */
.report-search-form {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
    padding: 1.25rem 1.25rem 0.75rem;
    margin-bottom: 1.25rem;
}

.report-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.report-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.report-field label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5e7087;
    margin: 0;
}

.report-field input,
.report-field select {
    padding: 0.45rem 0.6rem;
    border: 1px solid #c8d6e5;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #1a2e4a;
    background: #f7faff;
}

.report-search-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-bottom: 0.5rem;
}

/* Report print-only header: hidden on screen */
.report-print-header {
    display: none;
}

@media print {

    /* A4 single page */
    @page {
        size: A4 portrait;
        margin: 12mm 14mm;
    }

    /* Force black & white — no color printing required */
    * {
        -webkit-print-color-adjust: economy !important;
        print-color-adjust: economy !important;
        color-adjust: economy !important;
        box-sizing: border-box;
    }

    html,
    body {
        margin: 0;
        padding: 0;
        background: #fff !important;
        font-size: 10pt;
        font-family: 'Segoe UI', Arial, sans-serif;
        color: #000 !important;
    }

    /* hide everything except the print area */
    header,
    nav,
    footer,
    .memo-create-hero,
    .memo-submit-row,
    .no-print {
        display: none !important;
    }

    main {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
    }

    .memo-create-page {
        max-width: 100% !important;
    }

    .memo-create-form {
        background: #fff !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }

    /* Paper header — B&W: border outline instead of colored background */
    .memo-paper-header {
        background: #fff !important;
        border: 2px solid #000 !important;
        border-radius: 6px 6px 0 0 !important;
        padding: 8pt 10pt !important;
        margin-bottom: 0 !important;
        border-bottom: 3px solid #000 !important;
    }

    .memo-paper-fmms {
        font-size: 18pt !important;
        color: #000 !important;
    }

    .memo-paper-doc-title strong {
        font-size: 13pt !important;
        color: #000 !important;
    }

    .memo-paper-doc-title span,
    .memo-paper-meta-label {
        color: #444 !important;
        font-size: 7pt !important;
    }

    .memo-paper-meta-cell strong,
    .memo-paper-issuer-cell strong {
        color: #000 !important;
        font-size: 9pt !important;
    }

    .memo-paper-issuer-email {
        color: #333 !important;
        font-size: 7.5pt !important;
    }

    /* form sections */
    .memo-form-section {
        margin-bottom: 8pt !important;
        gap: 3pt !important;
    }

    .memo-form-section label,
    .cc-section>label,
    .approver-section>label {
        font-size: 7pt !important;
        color: #000 !important;
        margin-bottom: 2pt !important;
    }

    .memo-view-field {
        border: 1px solid #999 !important;
        border-radius: 4px !important;
        background: #fff !important;
        padding: 5pt 7pt !important;
        font-size: 9.5pt !important;
        color: #000 !important;
        min-height: auto !important;
    }

    .memo-view-content {
        min-height: auto !important;
        max-height: none !important;
        color: #000 !important;
    }

    /* routing grid -- side by side on print */
    .memo-routing-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8pt !important;
    }

    /* CC chips */
    .cc-chips--static {
        border: 1px solid #888 !important;
        background: #fff !important;
        padding: 4pt 6pt !important;
        border-radius: 4px !important;
    }

    .cc-chip {
        background: #eee !important;
        border: 1px solid #888 !important;
        color: #000 !important;
        font-size: 8pt !important;
        padding: 1pt 5pt !important;
    }

    /* status badge — all gray */
    .status-badge {
        font-size: 8pt !important;
        padding: 2pt 7pt !important;
        border-radius: 999px !important;
    }

    .status-pending,
    .status-approved,
    .status-rejected,
    .status-cancelled {
        background: #eee !important;
        color: #000 !important;
        border: 1px solid #888 !important;
    }

    .memo-view-status-block {
        border: 1px solid #888 !important;
        border-radius: 4px !important;
        background: #fff !important;
        padding: 5pt 7pt !important;
        font-size: 8.5pt !important;
        color: #000 !important;
    }

    .memo-view-approved-date {
        font-size: 7.5pt !important;
        color: #333 !important;
    }

    /* approver card */
    .approver-card {
        padding: 4pt 6pt 4pt 10pt !important;
        border-radius: 4px !important;
        border: 1px solid #888 !important;
        box-shadow: none !important;
        background: #fff !important;
    }

    .approver-card strong {
        font-size: 9pt !important;
        color: #000 !important;
    }

    .approver-card small {
        font-size: 7.5pt !important;
        color: #333 !important;
    }

    /* force single page */
    section,
    div {
        page-break-inside: avoid;
    }

    /* Report page print rules */
    .report-print-header {
        display: block !important;
        margin-bottom: 10pt;
        font-size: 11pt;
        font-weight: 700;
        color: #000;
        border-bottom: 2px solid #000;
        padding-bottom: 5pt;
    }

    .report-print-header span {
        display: block;
        font-size: 8pt;
        font-weight: 400;
        color: #444;
        margin-top: 2pt;
    }

    .report-print-filters {
        font-size: 7.5pt;
        color: #444;
        margin-top: 3pt;
    }

    /* On report page, allow multi-page print (not single-page restriction) */
    .report-search-form {
        display: none !important;
    }

    .pagination {
        display: none !important;
    }

    .dashboard-hero {
        display: none !important;
    }

    tr {
        page-break-inside: avoid;
    }
}