/**
 * Quản lý Công văn - Frontend Stylesheet v1.3.8
 * Tập trung sửa chiều cao ô tìm kiếm, nút bấm và khoảng cách.
 */

/* --- CSS Variables (Fallback values - Không dùng cho màu nữa) --- */
:root {
    /* Giữ lại biến RGB để tham khảo nếu cần */
    /* --qlcv-primary-rgb: 0, 123, 255; */
}

/* --- Reset & Base Styles --- */
.qlcv-cong-van-list-wrapper *, .qlcv-frontend-form-wrapper *,
.qlcv-cong-van-list-wrapper *::before, .qlcv-frontend-form-wrapper *::before,
.qlcv-cong-van-list-wrapper *::after, .qlcv-frontend-form-wrapper *::after { box-sizing: border-box; }

/* --- General Styles --- */
.qlcv-cong-van-list-wrapper, .qlcv-frontend-form-wrapper { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; margin-bottom: 2.5em; clear: both; line-height: 1.6; color: #444; }
.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important; }

/* Loading Indicator */
#qlcv-loading { text-align: center; padding: 40px 15px; color: #555; font-style: italic; font-size: 1.1em; }
#qlcv-loading .spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid rgba(0, 115, 170, 0.2); border-radius: 50%; border-top-color: #0073aa; animation: spin 1s linear infinite; -webkit-animation: spin 1s linear infinite; vertical-align: middle; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } } @-webkit-keyframes spin { to { -webkit-transform: rotate(360deg); } }
.spinner.is-active { display: inline-block; }

/* --- Styles for [danh_sach_cong_van] Shortcode --- */

/* Filter Form Layout */
.qlcv-filter-form { background-color: #ffffff; padding: 20px 25px; margin-bottom: 30px; border: 1px solid #e0e0e0; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.06); }
/* Hàng tìm kiếm */
.qlcv-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Khoảng cách giữa các item */
    align-items: center; /* Căn giữa các item theo chiều dọc */
    margin-bottom: 25px; /* === Khoảng cách với hàng lọc bên dưới === */
    padding-bottom: 20px;
    border-bottom: 1px dashed #d0d0d0;
}
/* Hàng lọc */
.qlcv-filter-row { display: flex; flex-wrap: wrap; gap: 15px; align-items: flex-end; }

/* Filter Form Items */
.qlcv-filter-item { display: flex; flex-direction: column; flex-grow: 1; }
.qlcv-filter-item.qlcv-search-item { flex-direction: row; /* Label và input cùng hàng */ align-items: center; /* Căn label và input */ flex-grow: 3; flex-basis: 300px; max-width: 550px; min-width: 250px; }
.qlcv-filter-item.qlcv-search-submit { flex-grow: 0; flex-basis: auto; align-self: center; /* Căn nút submit giữa theo chiều dọc */ margin-left: 15px; /* << Tăng khoảng cách với ô tìm kiếm */ }

/* Label chung */
.qlcv-filter-item label { font-weight: 500; margin-bottom: 5px; font-size: 0.8em; color: #555; text-transform: uppercase; letter-spacing: 0.6px; display: block; /* Đảm bảo label là block */ }
/* Label cho hàng tìm kiếm */
.qlcv-search-row .qlcv-filter-item.qlcv-search-item label {
    margin-bottom: 0; /* Không cần margin dưới khi nằm ngang */
    margin-right: 8px; /* Khoảng cách với input */
    flex-shrink: 0; /* Không co lại */
    white-space: nowrap;
    font-weight: 600;
    color: #333;
    font-size: 14px; /* << Cỡ chữ label tìm kiếm */
    text-transform: none;
    letter-spacing: normal;
}

/* === CSS CHÍNH CHO Ô TÌM KIẾM === */
.qlcv-search-row .qlcv-filter-item.qlcv-search-item input[type="search"] {
    padding: 2px 8px; /* << Giảm padding dọc tối đa */
    font-size: 14px; /* << Font size 14px như yêu cầu */
    height: auto;      /* << Để padding và font quyết định chiều cao */
    line-height: 1.4; /* << Line height phù hợp với font 14px */
    border: 1px solid #999; /* Border đậm hơn chút */
    border-radius: 3px;
    background-color: #fff;
    transition: border-color 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
    color: #333;
    flex-grow: 1; /* Cho input chiếm không gian */
    width: auto;
    min-height: 22px; /* Chiều cao tối thiểu */
    display: inline-block; /* Cần thiết khi bỏ flex */
    vertical-align: middle; /* Căn giữa */
}
/* === CSS CHÍNH CHO NÚT TÌM KIẾM === */
.qlcv-search-row .qlcv-filter-item.qlcv-search-submit button[type="submit"] {
    padding: 2px 12px; /* << Giảm padding dọc */
    font-size: 13px;   /* Font size hơi nhỏ hơn input */
    height: 26px;     /* << Chiều cao thấp hơn input một chút */
    line-height: 20px;
    border: 1px solid #006799;
    border-radius: 3px;
    background: #f6f7f7;
    color: #0073aa;
    cursor: pointer;
    font-weight: normal;
    transition: background .1s ease-in-out,border-color .1s ease-in-out,color .1s ease-in-out,box-shadow .1s ease-in-out;
    box-shadow: 0 1px 0 #006799;
    text-decoration: none;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle; /* Căn giữa */
}
.qlcv-search-row .qlcv-filter-item.qlcv-search-submit button[type="submit"]:hover { background: #f0f0f1; border-color: #016087; color: #016087; }
.qlcv-search-row .qlcv-filter-item.qlcv-search-submit button[type="submit"]:active { background: #e0e1e2; border-color: #016087; box-shadow: inset 0 2px 0 #006799; transform: translateY(1px); }

/* Style cho các input/select lọc khác (giữ nguyên chiều cao cũ hoặc điều chỉnh nếu muốn) */
.qlcv-filter-row .qlcv-filter-item input[type="date"],
.qlcv-filter-row .qlcv-filter-item select {
    padding: 4px 10px;
    font-size: 13px;
    height: 30px;
    line-height: 20px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: #fff;
    transition: border-color 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
    color: #333;
    display: block;
    width: 100%;
}
/* Focus styles */
.qlcv-filter-item input:focus, .qlcv-filter-item select:focus { border-color: #007cba !important; outline: 0; box-shadow: 0 0 0 1px #007cba !important; }

/* Data Table */
/* ... (Styles bảng giữ nguyên như phiên bản 1.3.5) ... */
.qlcv-cong-van-table-wrapper { border-radius: 5px; overflow: hidden; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); margin-bottom: 30px; border: 1px solid #ddd; min-height: 150px; background-color: #fff; }
.qlcv-cong-van-table { width: 100%; border-collapse: collapse; font-size: 14px; border: none; }
.qlcv-cong-van-table th, .qlcv-cong-van-table td { padding: 14px 18px; text-align: left; vertical-align: middle; border-bottom: 1px solid #eee; color: #333; } .qlcv-cong-van-table tr:last-child td { border-bottom: none; }
.qlcv-cong-van-table thead th { background-color: #f9fafb; font-weight: 600; color: #4b5563; white-space: nowrap; text-transform: uppercase; font-size: 11px; letter-spacing: 0.8px; border-bottom: 2px solid #e5e7eb; }
.qlcv-cong-van-table tbody tr { transition: background-color 0.25s ease-out, transform 0.15s ease-out; }
.qlcv-cong-van-table tbody tr:hover { background-color: #f0f8ff; transform: scale(1.005); z-index: 1; position: relative; box-shadow: 0 4px 8px rgba(0,0,0,0.05); }
.qlcv-cong-van-table td[data-label*="Số/Ký hiệu"] { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; color: #0e7490; font-weight: 500; background-color: rgba(207, 250, 254, 0.2); }
.qlcv-cong-van-table td[data-label*="Ngày ban hành"] { white-space: nowrap; color: #6b7280; font-size: 0.95em; }
.qlcv-cong-van-table td[data-label*="Trích yếu"] { font-weight: 500; color: #1f2937; line-height: 1.5; }
.qlcv-cong-van-table td[data-label*="Loại VB"], .qlcv-cong-van-table td[data-label*="ĐV Ban hành"], .qlcv-cong-van-table td[data-label*="Luồng"] { font-size: 0.9em; color: #4b5563; }
.qlcv-cong-van-table td[data-label*="Tệp tin"] a.qlcv-download-link { color: #007bff; text-decoration: none; transition: all 0.2s ease; display: inline-flex; align-items: center; margin-right: 10px; margin-bottom: 5px; padding: 3px 6px; background-color: #eff6ff; border-radius: 3px; border: 1px solid #dbeafe; }
.qlcv-cong-van-table td[data-label*="Tệp tin"] a.qlcv-download-link:hover { color: #0056b3; background-color: #dbeafe; border-color: #bfdbfe; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.qlcv-cong-van-table td[data-label*="Tệp tin"] a.qlcv-download-link .dashicons { font-size: 18px; line-height: 1; color: inherit; }

/* Pagination */
/* ... (Styles phân trang giữ nguyên như phiên bản 1.3.5) ... */
.qlcv-pagination { margin-top: 35px; text-align: center; clear: both; } .qlcv-pagination ul.page-numbers { display: inline-flex; gap: 6px; padding-left: 0; margin: 0; list-style: none; } .qlcv-pagination ul.page-numbers li { display: inline; margin: 0; }
.qlcv-pagination ul.page-numbers li .page-numbers { display: flex; justify-content: center; align-items: center; min-width: 36px; height: 36px; padding: 0 12px; border: 1px solid #d1d5db; color: #007bff; text-decoration: none; background-color: #fff; border-radius: 4px; transition: all 0.2s ease; font-weight: 500; font-size: 0.9em; cursor: pointer; }
.qlcv-pagination ul.page-numbers li span.page-numbers.current { background-color: #007bff; color: #fff; border-color: #007bff; cursor: default; font-weight: 600; }
.qlcv-pagination ul.page-numbers li a.page-numbers:hover { background-color: #0056b3; border-color: #0056b3; color: #fff; transform: translateY(-1px); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.qlcv-pagination ul.page-numbers li .page-numbers.dots { border: none; background: none; color: #9ca3af; cursor: default; padding: 0 5px; min-width: auto; }


/* No Results Message */
/* ... (Styles như cũ) ... */
.qlcv-no-results { background-color: #fef3c7; color: #92400e; border: 1px solid #fde68a; padding: 18px 25px; border-radius: 6px; margin-top: 20px; text-align: center; font-weight: 500; } .qlcv-no-results a { color: #92400e; font-weight: 600; text-decoration: underline; } .qlcv-no-results a:hover { text-decoration: none; }

/* --- Styles for [them_cong_van_form] Shortcode --- */
/* ... (Styles form frontend giữ nguyên như phiên bản 1.3.5) ... */
.qlcv-frontend-form-wrapper { background-color: #fff; padding: 25px 30px; border: 1px solid #e9ecef; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); margin-top: 2em; }
.qlcv-frontend-form-wrapper h2 { margin-top: 0; margin-bottom: 20px; font-size: 1.5em; color: #343a40; border-bottom: 1px solid #dee2e6; padding-bottom: 10px; }
.qlcv-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px 25px; margin-bottom: 25px; } .qlcv-form-group-full { grid-column: 1 / -1; }
.qlcv-form-group label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 0.9em; color: #495057; } .qlcv-form-group label .required { color: #dc3545; font-weight: bold; margin-left: 3px; }
.qlcv-form-group input[type="text"], .qlcv-form-group input[type="date"], .qlcv-form-group input[type="file"], .qlcv-form-group select, .qlcv-form-group textarea { display: block; width: 100%; padding: 10px 14px; border: 1px solid #ced4da; border-radius: 5px; background-color: #fff; transition: border-color 0.2s ease, box-shadow 0.2s ease; font-size: 1em; color: #495057; line-height: normal; }
.qlcv-form-group input[type="file"] { padding: 8px; background-color: #f8f9fa; cursor: pointer; } .qlcv-form-group input[type="file"]::file-selector-button { padding: 8px 12px; margin-right: 10px; background-color: #6c757d; color: white; border: none; border-radius: 4px; cursor: pointer; transition: background-color 0.2s ease; } .qlcv-form-group input[type="file"]::file-selector-button:hover { background-color: #5a6268; }
.qlcv-form-group textarea { min-height: 80px; resize: vertical; }
.qlcv-form-group input:focus, .qlcv-form-group select:focus, .qlcv-form-group textarea:focus { border-color: #007bff !important; outline: 0; box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) !important; }
.qlcv-form-group small { display: block; margin-top: 6px; font-size: 0.85em; color: #6c757d; }
ul.qlcv-selected-files-preview { list-style: none; margin: 10px 0 5px; padding: 8px 12px; font-size: 0.9em; color: #555; background-color: #f8f9fa; border: 1px dashed #ced4da; border-radius: 4px; }
ul.qlcv-selected-files-preview li { margin-bottom: 4px; padding: 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
ul.qlcv-selected-files-preview li .dashicons { margin-right: 5px; vertical-align: middle; font-size: 16px; color: #888; }
.qlcv-form-submit-area { margin-top: 15px; text-align: right; }
.qlcv-submit-button { display: inline-block; padding: 12px 25px; background-color: #16a34a; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 1.05em; font-weight: 600; text-align: center; transition: background-color 0.2s ease, transform 0.1s ease; }
.qlcv-submit-button:hover { background-color: #15803d; } .qlcv-submit-button:active { transform: translateY(1px); }
/* Form Messages */
.qlcv-message { padding: 15px 20px; margin-bottom: 20px; border-radius: 5px; border: 1px solid transparent; } .qlcv-message.qlcv-success { color: #0f5132; background-color: #d1e7dd; border-color: #badbcc; } .qlcv-message.qlcv-error { color: #842029; background-color: #f8d7da; border-color: #f5c2c7; } .qlcv-message.qlcv-error ul { margin-top: 10px; margin-bottom: 0; padding-left: 20px; } .qlcv-message a { color: inherit; font-weight: bold; text-decoration: underline; } .qlcv-message a:hover { text-decoration: none; }


/* --- Responsive Design --- */
@media screen and (max-width: 992px) { /* Tablet landscape */ .qlcv-filter-item.qlcv-search-item { flex-basis: auto; max-width: none; } .qlcv-form-grid { grid-template-columns: 1fr; } .qlcv-form-group-full { grid-column: auto; } }
@media screen and (max-width: 768px) { /* Tablet portrait and Mobile */ .qlcv-search-row { flex-direction: column; align-items: stretch; gap: 15px; border-bottom: none; padding-bottom: 0; margin-bottom: 15px; } .qlcv-filter-row { flex-direction: column; align-items: stretch; gap: 15px; } .qlcv-filter-item, .qlcv-filter-item.qlcv-search-item { min-width: 100%; } .qlcv-filter-item.qlcv-search-submit { flex-basis: auto; margin-top: 10px; /* Thêm khoảng cách trên mobile */ justify-content: center; margin-left: 0; /* Reset margin */ } .qlcv-filter-item.qlcv-search-submit button[type="submit"] { flex-grow: 1; } /* Data Table Responsive */ .qlcv-cong-van-table-wrapper { box-shadow: none; border: none; border-radius: 0; overflow: visible; background: none; } .qlcv-cong-van-table thead { display: none; } .qlcv-cong-van-table tbody tr { display: block; margin-bottom: 20px; border: 1px solid #e0e0e0; border-radius: 6px; background-color: #fff; box-shadow: 0 3px 6px rgba(0,0,0,0.07); padding: 15px; transition: transform 0.2s ease, box-shadow 0.2s ease; } .qlcv-cong-van-table tbody tr:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.1); } .qlcv-cong-van-table tbody td { display: block; text-align: right; border: none; border-bottom: 1px solid #f3f4f6; padding-left: 40%; padding-top: 12px; padding-bottom: 12px; padding-right: 10px; position: relative; white-space: normal; min-height: 24px; } .qlcv-cong-van-table tbody td:last-child { border-bottom: none; } .qlcv-cong-van-table tbody td::before { content: attr(data-label); position: absolute; left: 10px; width: calc(40% - 15px); font-weight: 600; text-align: left; white-space: nowrap; color: #6b7280; font-size: 0.85em; } .qlcv-cong-van-table tbody td[data-label*="Trích yếu"] { font-weight: 600; font-size: 1em; color: #111827; text-align: left; padding-left: 10px; } .qlcv-cong-van-table tbody td[data-label*="Trích yếu"]::before { display: none; } .qlcv-cong-van-table tbody td[data-label*="Tệp tin"] a.qlcv-download-link { margin-bottom: 3px; } .qlcv-cong-van-table tbody td[data-label*="Tệp tin"] { text-align: right; padding-top: 8px; padding-bottom: 8px; } /* Frontend Form Responsive */ .qlcv-frontend-form-wrapper { padding: 20px; } .qlcv-form-grid { grid-template-columns: 1fr; gap: 15px; } .qlcv-form-submit-area { text-align: center; } .qlcv-submit-button { width: 100%; } /* Pagination Responsive */ .qlcv-pagination ul.page-numbers li .page-numbers { padding: 6px 10px; font-size: 0.9em; min-width: 32px; height: 32px; } }
/* --- End of Styles --- */