/* ========================================================
   QUẢN LÝ GỬI BƯU ĐIỆN - WEBNDXQ
   ======================================================== */

.buudien-page {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Header toolbar */
.buudien-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

[data-theme="dark"] .buudien-header {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(51, 65, 85, 0.8);
}

.buudien-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.buudien-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

.buudien-title-main {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--medical-text, #0f172a);
    margin: 0;
}

.buudien-title-sub {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 2px;
}

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

/* Buttons */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary-gradient {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}
.btn-primary-gradient:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    transform: translateY(-1px);
}

.btn-sender-config {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}
.btn-sender-config:hover {
    background: #e2e8f0;
}

.btn-print-batch {
    background: #10b981;
    color: #fff;
}
.btn-print-batch:hover {
    background: #059669;
}

.btn-danger-outline {
    background: #fff;
    color: #ef4444;
    border: 1px solid #fca5a5;
}
.btn-danger-outline:hover {
    background: #fef2f2;
}

/* Sender Info Summary Card */
.sender-banner-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

[data-theme="dark"] .sender-banner-card {
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.25);
}

.sender-banner-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sender-tag {
    background: #0284c7;
    color: #fff;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.sender-details {
    font-size: 0.875rem;
    color: #0f172a;
}
[data-theme="dark"] .sender-details {
    color: #f1f5f9;
}
.sender-details strong {
    color: #0369a1;
}
[data-theme="dark"] .sender-details strong {
    color: #38bdf8;
}

/* Filter bar */
.filter-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
[data-theme="dark"] .filter-card {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(51, 65, 85, 0.8);
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s;
}
.search-input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}
[data-theme="dark"] .search-input {
    background: #1e293b;
    border-color: #475569;
    color: #f8fafc;
}

.status-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    font-size: 0.875rem;
    outline: none;
}
[data-theme="dark"] .status-select {
    background: #1e293b;
    border-color: #475569;
    color: #f8fafc;
}

/* Table Card */
.table-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}
[data-theme="dark"] .table-card {
    background: #1e293b;
    border-color: rgba(51, 65, 85, 0.8);
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.buudien-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.buudien-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
[data-theme="dark"] .buudien-table th {
    background: #0f172a;
    color: #94a3b8;
    border-color: #334155;
}

.buudien-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}
[data-theme="dark"] .buudien-table td {
    border-color: #334155;
    color: #cbd5e1;
}

.buudien-table tr:hover td {
    background: #f8fafc;
}
[data-theme="dark"] .buudien-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.badge-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-status.cho-in {
    background: #fef3c7;
    color: #92400e;
}
.badge-status.da-in {
    background: #e0f2fe;
    color: #0369a1;
}
.badge-status.da-gui {
    background: #dcfce7;
    color: #15803d;
}

.btn-tbl-action {
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 4px;
    color: #64748b;
    transition: all 0.15s;
}
.btn-tbl-action:hover {
    background: #f1f5f9;
    color: #0284c7;
}
.btn-tbl-action.delete:hover {
    color: #ef4444;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-dialog-content {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}
[data-theme="dark"] .modal-dialog-content {
    background: #1e293b;
    color: #f8fafc;
}

.modal-header-custom {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
[data-theme="dark"] .modal-header-custom {
    border-color: #334155;
}

.modal-title-custom {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.btn-close-custom {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #64748b;
    cursor: pointer;
}

.modal-body-custom {
    padding: 20px;
    overflow-y: auto;
}

.modal-footer-custom {
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
[data-theme="dark"] .modal-footer-custom {
    border-color: #334155;
}

/* Form controls */
.form-group-custom {
    margin-bottom: 14px;
}
.form-group-custom label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}
[data-theme="dark"] .form-group-custom label {
    color: #94a3b8;
}

.form-control-custom {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.875rem;
    outline: none;
}
.form-control-custom:focus {
    border-color: #0284c7;
}
[data-theme="dark"] .form-control-custom {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

/* Modal In Preview */
.modal-preview-dialog {
    max-width: 980px;
    width: 95%;
}

/* Live Paper Preview Screen */
.preview-sheet-wrapper {
    background: #334155;
    padding: 24px;
    border-radius: 8px;
    max-height: 75vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.preview-a4-page {
    width: 100%;
    max-width: 860px;
    aspect-ratio: 297 / 210;
    min-height: 480px;
    background: #fff;
    color: #000;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    border-radius: 4px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.phieu-container-landscape {
    border: 3.5px solid #000;
    border-radius: 8px;
    padding: 22px 26px;
    background: #fff;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    flex: 1;
}

.phieu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2.5px solid #000;
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.phieu-title {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #000;
    letter-spacing: 0.8px;
}

.phieu-code-box {
    text-align: right;
}

.phieu-code-text {
    font-family: monospace, Courier;
    font-size: 1.2rem;
    font-weight: 800;
    color: #000;
    border: 2px solid #000;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.phieu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    flex: 1;
    padding: 10px 0;
}

.box-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.box-col.nguoigui {
    border-right: 2px dashed #64748b;
    padding-right: 20px;
}

.box-col.nguoinhan {
    padding-left: 10px;
}

.section-label {
    font-size: 1.15rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #000;
    border-bottom: 2px solid #000;
    padding-bottom: 4px;
    margin-bottom: 6px;
}

.info-row {
    font-size: 1.05rem;
    line-height: 1.5;
    color: #000;
}

.info-label {
    font-weight: 800;
    color: #000;
    display: inline-block;
    min-width: 75px;
}

.info-val {
    font-weight: 500;
}

.highlight-name {
    font-size: 1.25rem;
    font-weight: 900;
    color: #000;
    text-transform: uppercase;
}

.highlight-phone {
    font-size: 1.15rem;
    font-weight: 800;
    color: #000;
}

.phieu-footer {
    border-top: 2.5px solid #000;
    padding-top: 12px;
    margin-top: 12px;
    display: flex;
    align-items: center;
}

.noidung-text {
    font-size: 1.2rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #000;
    letter-spacing: 0.5px;
}
