*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #c0c0c0;
    color: #000;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px;
}

body {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px;
}

body.dashboard-page {
    display: block;
    padding: 0;
    background: #fff;
}

.app-window {
    width: 720px;
    max-width: 100%;
    background: #fff;
    border: 2px solid #000;
    box-shadow: 4px 4px 0 #000;
    display: flex;
    flex-direction: column;
    min-height: 560px;
}

.app-window--wide {
    width: 100%;
    min-height: 100vh;
    border: none;
    box-shadow: none;
}

.form-page .app-window--wide {
    width: 100%;
    max-width: none;
    margin: 0;
    min-height: auto;
    border: 2px solid #000;
    box-shadow: 4px 4px 0 #000;
}

.app-header {
    border-bottom: 2px solid #000;
    flex-shrink: 0;
}

.title-bar-app {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: #1e3a5f;
    color: #fff;
    padding: 10px 14px;
}

.title-bar-app-name {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.title-bar-app-meta {
    font-size: 11px;
    opacity: 0.9;
}

.menu-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: #e8e8e8;
    border-top: 1px solid #fff;
    border-bottom: 1px solid #b0b0b0;
}

.menu-bar-link {
    display: inline-block;
    padding: 6px 12px;
    color: #000;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    border: 1px solid transparent;
    border-radius: 2px;
}

.menu-bar-link:hover {
    background: #d0d0d0;
    border-color: #888;
}

.menu-bar-link.is-active {
    background: #fff;
    border-color: #000;
}

.menu-bar-link-right {
    margin-left: auto;
}

.menu-bar-user {
    margin-left: auto;
    padding: 6px 10px;
    font-weight: 600;
    font-size: 12px;
    color: #333;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-body {
    flex: 1;
    padding: 20px 24px 24px;
    background: #fff;
}

.status-bar {
    border-top: 2px solid #000;
    background: #f0f0f0;
    padding: 8px 14px;
    font-size: 11px;
    color: #000;
}

.panel-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid #000;
    padding-bottom: 8px;
}

.panel-heading {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.btn-link {
    border: none;
    background: transparent;
    color: #1e3a5f;
    text-decoration: underline;
    padding: 4px 0;
    font-weight: 600;
}

.btn-link:hover {
    background: transparent;
    color: #000;
}

.dashboard {
    max-width: 100%;
}

.dashboard-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
}

.dashboard-subtitle {
    margin: 0;
    color: #444;
    font-size: 13px;
}

.btn-add {
    white-space: nowrap;
}

.dashboard-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #f5f5f5;
    border: 1px solid #bbb;
}

.dashboard-count {
    font-size: 13px;
}

.dashboard-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.dash-search {
    min-width: 220px;
    flex: 1;
    max-width: 360px;
    border: 1px solid #bbb;
    padding: 8px 10px;
    font: inherit;
}

.dash-sort {
    border: 1px solid #bbb;
    padding: 7px 10px;
    font: inherit;
    font-weight: 600;
    background: #fff;
}

/* Searchable Combobox Dropdown */
.searchable-combo {
    position: relative;
    display: inline-block;
    width: 190px;
    margin-right: 8px;
}

.searchable-combo .combo-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #bbb;
    padding: 7px 28px 7px 10px;
    font: inherit;
    font-weight: 600;
    background: #fff;
    cursor: text;
}

.searchable-combo .combo-input::placeholder {
    color: #555;
    font-weight: 600;
}

.searchable-combo .combo-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 10px;
    color: #555;
}

.searchable-combo .combo-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 200;
    max-height: 350px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #999;
    border-top: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.searchable-combo .combo-list.open {
    display: block;
}

.searchable-combo .combo-item {
    padding: 7px 10px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.searchable-combo .combo-item:hover,
.searchable-combo .combo-item.active {
    background: #1a3a6b;
    color: #fff;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid #bbb;
    background: #fff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #ccc;
    vertical-align: top;
}

.data-table th {
    background: #e8e8e8;
    font-weight: 700;
    border-bottom: 1px solid #bbb;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: #f9f9f9;
}

.data-table-empty td {
    text-align: center;
    padding: 28px 16px;
    color: #444;
}

/* ── Grouped Dashboard — Company / Contact Rows ── */

.company-row {
    background: #f0f0f0;
    border-bottom: 1px solid #bbb;
    transition: background 0.15s;
}

.company-row:hover {
    background: #e4e4e4;
}

.company-row.is-expanded {
    background: #e8edf2;
    border-bottom-color: #8aa;
}

.company-row.is-expanded:hover {
    background: #dce3ea;
}

.company-name-cell {
    font-size: 13px;
    letter-spacing: 0.01em;
}

.address-cell {
    max-width: 250px;
    text-wrap: balance;
    word-wrap: break-word;
}

.toggle-cell {
    text-align: center;
    width: 36px;
    padding: 8px 4px !important;
}

.toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid #bbb;
    background: #fff;
    color: #000;
    cursor: pointer;
    padding: 0;
    transition: background 0.1s, color 0.1s;
}

.toggle-btn:hover {
    background: #000;
    color: #fff;
}

.contact-count-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    background: #1e3a5f;
    color: #fff;
    border-radius: 2px;
    letter-spacing: 0.02em;
}

.contact-row {
    background: #fafcff;
    border-bottom: 1px solid #e0e0e0;
}

.contact-row:hover {
    background: #f3f6fb;
}

.contact-detail-cell {
    padding: 12px 16px !important;
}

.contact-detail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    align-items: center;
    width: 100%;
}

.contact-field {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
}

.contact-field--wide {
    /* Flow natively in flex */
}

.contact-label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.contact-value {
    font-size: 12px;
    font-weight: 600;
    color: #111;
    word-break: break-word;
}

.contact-actions-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
    margin-left: auto;
}

.contact-action-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    color: #2c3e50;
    border-bottom: 1px dotted #2c3e50;
    padding: 2px 4px;
    cursor: pointer;
    transition: color 0.1s;
}

.contact-action-link:hover {
    color: #000;
    border-bottom-color: #000;
}

.contact-action-delete {
    color: #a93226;
    border-bottom-color: #a93226;
}

.contact-action-delete:hover {
    color: #6b1a13;
    border-bottom-color: #6b1a13;
}

.add-contact-row {
    background: #f5f7f9;
    border-bottom: 1px solid #bbb;
}

.add-contact-link {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #000;
    text-decoration: none;
    padding: 6px 12px;
    border: 1px dashed #000;
    background: #bbf7d0;
}

.add-contact-link:hover {
    color: #000;
    border-color: #000;
    background: #fff;
}

.edit-company-link {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: #000;
    text-decoration: none;
    padding: 2px 8px;
    border: 1px dashed #000;
    background: #ffcccc;
    cursor: pointer;
}

.edit-company-link:hover {
    color: #000;
    border-color: #000;
    background: #fff;
}

@media (max-width: 900px) {
    .contact-detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-field--wide {
        grid-column: span 2;
    }
}

@media (max-width: 550px) {
    .contact-detail-grid {
        grid-template-columns: 1fr;
    }

    .contact-field--wide {
        grid-column: span 1;
    }
}

.flash-message {
    margin-bottom: 14px;
}

.flash-message p {
    margin: 0;
}

.dash-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #000;
}

.dash-pagination-info {
    font-weight: 600;
    font-size: 13px;
}

.panel-note {
    margin: 0 0 16px;
    color: #333;
    line-height: 1.5;
}

.alert-box {
    border: 2px solid #000;
    background: #f5f5f5;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.alert-box ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.success-box p {
    margin: 0 0 8px;
}

.success-box p:last-child {
    margin-bottom: 0;
}

.entry-form {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px 16px;
    align-items: start;
}

.form-row {
    display: contents;
}

.form-row-wide {
    display: contents;
}

.form-row label,
.form-row-wide label {
    padding-top: 8px;
    font-weight: 600;
}

.form-row input,
.form-row select,
.form-row-wide textarea {
    width: 100%;
    border: 1px solid #bbb;
    background: #fff;
    color: #000;
    padding: 8px 14px;
    font: inherit;
}

.form-row-wide textarea {
    resize: vertical;
    max-width: 100%;
}

.form-row input:focus,
.form-row select:focus,
.form-row-wide textarea:focus {
    outline: 2px solid #999;
    outline-offset: 0;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #bbb;
}

.entry-form.entry-form--grouped {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

.entry-form--grouped .branch-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, max-content));
    justify-items: start;
    width: 100%;
    gap: 10px 90px;
    padding: 0;
    margin: 2px 0 0 0;
}

.entry-form--grouped .branch-summary-item {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.entry-form--grouped .branch-summary-label {
    font-weight: 700;
    white-space: nowrap;
}

.entry-form--grouped .branch-summary-value {
    color: #222;
    overflow-wrap: anywhere;
    max-width: 320px;
    min-width: 0;
}


.entry-form--grouped .entry-line {
    display: grid;
    gap: 14px 16px;
    align-items: start;
    width: 100%;
}

.entry-form--grouped .entry-line--three {
    grid-template-columns: 2fr 1fr 1fr;
}

.entry-form--grouped .entry-line--four {
    grid-template-columns: 1.8fr 1.1fr 1.1fr 1fr;
}

.entry-form--grouped .entry-line--four-contact {
    grid-template-columns: 2.4fr 1.8fr 1.3fr 1.2fr;
}

.entry-form--grouped .entry-line--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.entry-form--grouped .entry-line--address-remark {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
}

.entry-form--grouped .entry-line--reference {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
}

.entry-form--grouped .entry-line--reference .form-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 0.5fr);
    align-items: center;
    gap: 14px;
    grid-column: 1 / -1;
}

.entry-form--grouped .entry-line--reference .form-row label {
    white-space: nowrap;
    padding-top: 0;
}

.entry-form--grouped .entry-line--reference .form-row input {
    width: 100%;
    min-width: 0;
}

.entry-form--grouped .entry-line--contact-area {
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: start;
    width: 100%;
}

.entry-form--grouped .entry-line--contact-area .form-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    grid-column: 1 / -1;
}

.entry-form--grouped .entry-line--contact-area .form-row label {
    white-space: nowrap;
    padding-top: 0;
}

.entry-form--grouped .entry-line--contact-area textarea {
    min-height: 40px;
    resize: vertical;
}

.entry-form--grouped .entry-line--address-remark textarea {
    width: 100%;
    min-height: 62px;
    box-sizing: border-box;
    resize: vertical;
    max-width: 100%;
}

.entry-form--grouped .entry-line--five {
    grid-template-columns: 1.7fr 1.8fr 1fr 1.2fr 1.2fr;
}

.entry-form--grouped .entry-line--full {
    grid-template-columns: minmax(0, 1fr);
}

.entry-form--grouped .form-row,
.entry-form--grouped .form-row-wide {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Inline form fields for the first two rows and final row */
.entry-form--grouped .entry-line--four .form-row,
.entry-form--grouped .entry-line--five .form-row,
.entry-form--grouped .entry-line--final .form-row {
    flex-direction: row;
    align-items: center;
    gap: 14px;
}

.entry-form--grouped .entry-line--three .form-row {
    flex-direction: row;
    align-items: center;
    gap: 14px;
}

.entry-form--grouped .entry-line--three .form-row label {
    white-space: nowrap;
}

.entry-form--grouped .entry-line--three .form-row input,
.entry-form--grouped .entry-line--three .form-row select {
    flex: 1;
    min-width: 0;
}

.entry-form--grouped .entry-line--contact-row-secondary {
    grid-template-columns: 1.8fr 1.2fr;
    column-gap: 18px;
    margin-top: 12px;
}

.entry-form--grouped .entry-line--contact-row-secondary .form-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.entry-form--grouped .entry-line--contact-row-secondary .form-row label {
    white-space: nowrap;
}

.entry-form--grouped .entry-line--contact-row-secondary .form-row input,
.entry-form--grouped .entry-line--contact-row-secondary .form-row textarea {
    flex: 1;
    width: auto;
    min-width: 0;
}

.entry-form--grouped .entry-line--contact-row-secondary .form-row textarea {
    height: 38px;
    min-height: 38px;
    resize: horizontal;
    overflow-x: auto;
    overflow-y: hidden;
}

.entry-form--grouped .entry-line--four .form-row label,
.entry-form--grouped .entry-line--five .form-row label,
.entry-form--grouped .entry-line--final .form-row label {
    white-space: nowrap;
}

.entry-form--grouped .entry-line--four .form-row input,
.entry-form--grouped .entry-line--four .form-row select,
.entry-form--grouped .entry-line--four .form-row textarea,
.entry-form--grouped .entry-line--five .form-row input,
.entry-form--grouped .entry-line--final .form-row input {
    flex: 1;
    min-width: 0;
}

.entry-form--grouped .entry-line--four .form-row textarea {
    resize: vertical;
    min-height: 56px;
}

.entry-form--grouped .form-row label,
.entry-form--grouped .form-row-wide label {
    padding-top: 0;
}

.entry-form--grouped .form-actions {
    grid-column: auto;
    margin-top: 0;
}

.contact-repeater {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    border: 1px solid #bbb;
    background: #f8f8f8;
}

.contact-repeater-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.contact-repeater-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.contact-repeater-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.contact-repeater-note {
    margin: 4px 0 0;
    color: #555;
    font-size: 12px;
}

.contact-card {
    padding: 12px;
    border: 1px solid #c7c7c7;
    background: #d9edf7;
}

.contact-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.saved-contact-list {
    padding: 12px;
    border: 1px solid #b7c7d8;
    background: #f4f8fc;
}

.saved-contact-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 12px;
}

.saved-contact-col-sr {
    width: 60px;
}

.saved-contact-col-phone {
    width: 120px;
}

.saved-contact-col-area {
    width: 28%;
}

.saved-contact-col-actions {
    width: 98px;
}

.saved-contact-table th,
.saved-contact-table td {
    padding: 8px 10px;
    border: 1px solid #cfd8e3;
    text-align: left;
    vertical-align: top;
}

.saved-contact-table th:nth-child(4),
.saved-contact-table td:nth-child(4) {
    width: 120px;
    white-space: nowrap;
}

.saved-contact-table th:nth-child(3),
.saved-contact-table td:nth-child(3) {
    width: 220px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.saved-contact-table th:nth-child(5),
.saved-contact-table td:nth-child(5) {
    width: 140px;
}

.saved-contact-table th:nth-child(6),
.saved-contact-table td:nth-child(6) {
    width: 170px;
}

.saved-contact-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
    text-align: right;
    padding-right: 10px;
}

.saved-contact-row--highlight td {
    background: #fff6c8;
}

.saved-contact-table th {
    background: #e4edf7;
}

@media (max-width: 1100px) {

    .entry-form--grouped .entry-line--three,
    .entry-form--grouped .entry-line--four,
    .entry-form--grouped .entry-line--four-contact,
    .entry-form--grouped .entry-line--five,
    .entry-form--grouped .entry-line--address-remark,
    .entry-form--grouped .entry-line--reference {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {

    .entry-form--grouped .entry-line--three,
    .entry-form--grouped .entry-line--four,
    .entry-form--grouped .entry-line--four-contact,
    .entry-form--grouped .entry-line--two,
    .entry-form--grouped .entry-line--five,
    .entry-form--grouped .entry-line--address-remark,
    .entry-form--grouped .entry-line--reference {
        grid-template-columns: minmax(0, 1fr);
    }

    .entry-form--grouped .entry-line--four .form-row,
    .entry-form--grouped .entry-line--four-contact .form-row,
    .entry-form--grouped .entry-line--five .form-row,
    .entry-form--grouped .entry-line--final .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .entry-form--grouped .entry-line--four .form-row label,
    .entry-form--grouped .entry-line--four-contact .form-row label,
    .entry-form--grouped .entry-line--five .form-row label,
    .entry-form--grouped .entry-line--final .form-row label {
        white-space: normal;
    }
}

.btn {
    display: inline-block;
    border: 2px solid #000;
    background: #fff;
    color: #000;
    padding: 8px 16px;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background: #000;
    color: #fff;
}

.btn-primary {
    background: #000;
    color: #fff;
}

.btn-primary:hover {
    background: #fff;
    color: #000;
}

.btn-success {
    background: #198754;
    color: #fff;
    border-color: #000;
}

.btn-success:hover {
    background: #fff;
    color: #198754;
}

.btn-danger {
    background: #a93226;
    color: #fff;
    border-color: #000;
}

.btn-danger:hover {
    background: #fff;
    color: #a93226;
}

.summary-table {
    grid-column: 1 / -1;
    border: 1px solid #bbb;
    margin-bottom: 18px;
}

.summary-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    border-bottom: 1px solid #bbb;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row span {
    padding: 8px 10px;
}

.summary-row span:first-child {
    font-weight: 600;
    border-right: 1px solid #bbb;
    background: #f0f0f0;
}

/* ── Frozen Form Fields Styling ── */
.form-row input[readonly],
.form-row-wide textarea[readonly],
.form-row select[disabled],
.form-row input[disabled] {
    background: #e8e8e8;
    color: #555;
    cursor: not-allowed;
    border-color: #888;
}

/* ── Inline Form Actions Styling ── */
.entry-form--grouped .entry-line--three-buttons {
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
}

.entry-form--grouped .entry-line--three-buttons .form-actions-inline {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 2px;
}

@media (max-width: 900px) {
    .entry-form--grouped .entry-line--three-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .entry-form--grouped .entry-line--three-buttons .form-actions-inline {
        grid-column: span 2;
        justify-content: flex-start;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #000;
    }
}

/* ══ Dashboard Overview ══ */

.overview-section {
    max-width: 100%;
}

.overview-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.overview-heading h1 {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
}

.overview-heading p {
    margin: 0;
    color: #444;
    font-size: 13px;
}

.overview-date {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #bbb;
}

/* ── Stat Cards ── */

.stat-cards {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.stat-card {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.15s ease-in-out;
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.stat-card-label {
    font-size: 12px;
    font-weight: 500;
    color: #718096;
}

.stat-card-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card--default {
    background: #f8f9fa;
    border-color: #e2e8f0;
}

.stat-card--default .stat-card-value {
    color: #1a202c;
}

.stat-card--pending {
    background: #fffbeb;
    border-color: #fde68a;
}

.stat-card--pending .stat-card-label {
    color: #b45309;
}

.stat-card--pending .stat-card-value {
    color: #b45309;
}

.stat-card--completed {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.stat-card--completed .stat-card-label {
    color: #15803d;
}

.stat-card--completed .stat-card-value {
    color: #15803d;
}

.stat-card--today {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.stat-card--today .stat-card-label {
    color: #1d4ed8;
}

.stat-card--today .stat-card-value {
    color: #1d4ed8;
}

@media (max-width: 1100px) {
    .stat-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Pending Followups Section ── */

.overview-panel {
    margin-bottom: 28px;
}

.overview-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: #f5f5f5;
    border: 1px solid #bbb;
    border-bottom: none;
    font-size: 14px;
    font-weight: 700;
}

.overview-panel-header .badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    border-radius: 2px;
    margin-left: 6px;
}

.overview-panel-header .badge--orange {
    background: #e67e22;
}

.overview-panel-header .badge--navy {
    background: #1e3a5f;
}

.pending-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border: 1px solid #bbb;
}

.pending-table th,
.pending-table td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}

.pending-table th {
    background: #e8e8e8;
    font-weight: 700;
    border-bottom: 1px solid #bbb;
    white-space: nowrap;
    font-size: 12px;
}

.pending-table tbody tr:hover {
    background: #f9f9f9;
}

.pending-table .overdue-date {
    color: #a93226;
    font-weight: 700;
}

.pending-table .today-date {
    color: #e67e22;
    font-weight: 700;
}

.pending-table .upcoming-date {
    color: #1e3a5f;
    font-weight: 600;
}

.pending-table .overdue-row {
    background: #fdf5f4;
    border-left: 3px solid #a93226;
}

.pending-table .today-row {
    background: #fef9f0;
    border-left: 3px solid #e67e22;
}

.overview-action-btn {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #bbb;
    color: #1e3a5f;
    background: #fff;
    cursor: pointer;
    transition: background 0.1s;
}

.overview-action-btn:hover {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}

.overview-empty {
    padding: 24px;
    text-align: center;
    color: #666;
    border: 1px dashed #ccc;
    font-size: 13px;
}

/* ── Recent Entries ── */

.recent-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    border: 1px solid #bbb;
}

.recent-table th,
.recent-table td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}

.recent-table th {
    background: #e8e8e8;
    font-weight: 700;
    border-bottom: 1px solid #bbb;
    white-space: nowrap;
    font-size: 12px;
}

.recent-table tbody tr:hover {
    background: #f9f9f9;
}

@media (max-width: 760px) {
    .entry-form--grouped .entry-line--three-buttons {
        grid-template-columns: minmax(0, 1fr);
    }

    .entry-form--grouped .entry-line--three-buttons .form-actions-inline {
        grid-column: span 1;
        justify-content: flex-start;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #000;
    }
}