* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #1e3a8a;
    margin-bottom: 20px;
}

.logo-area img {
    max-width: 180px;
    height: 58px;
}

.title-area h1 {
    color: #1e3a8a;
    font-size: 20px;
}

.title-area p {
    color: #666;
    font-size: 14px;
}

/* Collapsible sections */
.collapsible-section {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    background: #fafafa;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f0f0f0;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
}

.section-header .toggle-icon {
    font-size: 14px;
    font-weight: bold;
    transition: transform 0.2s;
}

.section-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.section-header h3 {
    flex: 1;
    margin: 0;
    font-size: 16px;
}

.section-content {
    padding: 15px;
    border-top: 1px solid #ddd;
}

.section-header.collapsed + .section-content {
    display: none;
}

/* Form fields */
.form-field {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.form-field label {
    font-weight: bold;
    width: 180px;
    font-size: 13px;
    padding-top: 8px;
}

.form-field input, .form-field textarea {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.form-field textarea {
    resize: vertical;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-info, .btn-print, .btn-warning, .btn-reset {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin: 0 5px;
}

.btn-primary { background: #1e3a8a; color: white; }
.btn-primary:hover { background: #2e4a9a; }

.btn-secondary { background: #6c757d; color: white; }
.btn-success { background: #28a745; color: white; }
.btn-danger { background: #dc3545; color: white; }
.btn-info { background: #17a2b8; color: white; }
.btn-print { background: #ff9800; color: white; }
.btn-warning { background: #ffc107; color: #333; }

.btn-reset { background: #6c757d; color: white; padding: 4px 12px; font-size: 12px; }
.btn-reset:hover { background: #5a6268; }

/* Nút Excel */
.btn-info { background: #17a2b8; color: white; }
.btn-info:hover { background: #138496; }

.btn-success { background: #28a745; color: white; }
.btn-success:hover { background: #218838; }

/* Modal cảnh báo */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}
.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    text-align: center;
}
.modal-content button {
    margin: 10px;
    padding: 8px 20px;
}


/* Input section */
.input-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

#manualIndex {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Table section */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

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

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

th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    font-size: 13px;
}

th {
    background: #1e3a8a;
    color: white;
}

tr:hover {
    background: #f5f5f5;
}

/* Editable cells */
[contenteditable="true"] {
    background-color: #fff3cd;
    cursor: text;
}

[contenteditable="true"]:focus {
    outline: 2px solid #ffc107;
    background-color: #fff9e6;
}

/* Xử lý chọn hoặc bỏ chọn cho dòng trong bảng trước khi in */
.row-dimmed {
    opacity: 0.6;
    background-color: #f0f0f0;
}
#toggleSelectHeader {
    cursor: pointer;
    user-select: none;
}
#toggleSelectHeader:hover {
    background-color: #2e4a9a;
}



/* Warning message */
.warning-message {
    margin-top: 15px;
    padding: 10px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
    font-size: 13px;
}

.modified-icon {
    font-weight: bold;
    color: #dc3545;
}

small {
    color: #666;
    font-size: 11px;
}




/* ============================================
   THANH TRẠNG THÁI EXCEL
   ============================================ */
.excel-status {
    background: #e3f2fd;
    border-left: 4px solid #2196F3;
    padding: 10px 15px;
    margin: 15px 0;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.excel-status.inactive {
    background: #f5f5f5;
    border-left-color: #9e9e9e;
    color: #666;
}

.excel-status.active {
    background: #e8f5e9;
    border-left-color: #4caf50;
}

.btn-clear-excel {
    background: #ff9800;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: normal;
    transition: background 0.2s;
}

.btn-clear-excel:hover {
    background: #e68900;
}


/* ============================================
   DÒNG CHÚ Ý QUAN TRỌNG
   ============================================ */
.notice-box {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 10px 15px;
    margin: 15px 0;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Segoe UI', Arial, sans-serif;
    /* box-shadow: 0 1px 3px rgba(0,0,0,0.05); */
}

.notice-icon {
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notice-text {
    font-size: 13px;
    font-weight: normal;
    color: #e65100;
    flex: 1;
}

/* Tùy chọn: Hiệu ứng nhấp nháy nhẹ (có thể bỏ nếu không thích) */
@keyframes gentlePulse {
    0% { background: #fff3e0; }
    50% { background: #ffe0b3; }
    100% { background: #fff3e0; }
}

.notice-box {
    animation: gentlePulse 2s ease-in-out 1;
}



/* Responsive cho mobile */

@media (max-width: 768px) {
    .input-section {
        grid-template-columns: 1fr;
    }
    .form-field {
        flex-direction: column;
        gap: 5px;
    }
    .form-field label {
        width: auto;
    }
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }
    .container {
        padding: 10px;
    }
	.excel-status {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .notice-box {
        padding: 10px 12px;
        gap: 8px;
    }
    .notice-icon {
        font-size: 18px;
    }
    .notice-text {
        font-size: 12px;
    }
}