/* ==============================================
   SỔ TAY NÔNG NGHIỆP & MÔI TRƯỜNG - style.css
   Font: Be Vietnam Pro | Theme: Green Nature
   ============================================== */

:root {
    --primary: #1B6B2A;
    --primary-light: #2E7D32;
    --primary-dark: #0D4A1A;
    --accent: #F57F17;
    --accent-light: #FFF8E1;
    --bg-page: #F5F6F0;
    --bg-card: #FFFFFF;
    --bg-sidebar: #F0F4F0;
    --text-main: #1A2E1A;
    --text-muted: #5A6B5A;
    --border: #D4E0D4;
    --success-bg: #E8F5E9;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 8px rgba(27,107,42,0.10);
    --shadow-hover: 0 6px 20px rgba(27,107,42,0.16);
    --font: 'Be Vietnam Pro', sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-main);
    background: var(--bg-page);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ======= HEADER ======= */
.site-header {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.site-header .navbar {
    padding: 0.6rem 0;
    background: transparent;
}

.brand-icon {
    width: 42px; height: 42px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: #fff;
    flex-shrink: 0;
}

.brand-text {
    display: flex; flex-direction: column; line-height: 1.2;
}
.brand-main {
    font-size: 1.1rem; font-weight: 700; color: #fff; letter-spacing: 0.01em;
}
.brand-sub {
    color: rgba(255,255,255,0.8); font-weight: 400;
}

.site-header .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-size: 0.92rem; font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.85rem !important;
    transition: background 0.2s, color 0.2s;
}
.site-header .nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: #fff !important;
}
.site-header .navbar-toggler { color: #fff; }

.breadcrumb-bar {
    background: rgba(0,0,0,0.15);
    padding: 0.35rem 0;
    font-size: 0.82rem;
}
.breadcrumb-bar .breadcrumb {
    margin: 0; background: transparent;
}
.breadcrumb-bar .breadcrumb-item a { color: rgba(255,255,255,0.85); text-decoration: none; }
.breadcrumb-bar .breadcrumb-item.active { color: rgba(255,255,255,0.65); }
.breadcrumb-bar .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.5); }

/* ======= MAIN CONTENT ======= */
.main-content { flex: 1; }

/* ======= NHÓM CARD (DANH MỤC) ======= */
.group-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1rem;
    cursor: pointer;
    transition: all 0.22s ease;
    text-decoration: none;
    color: var(--text-main);
    display: flex; flex-direction: column;
    min-height: 110px;
    position: relative;
    overflow: hidden;
}
.group-card::before {
    content: '';
    position: absolute; top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--primary);
    border-radius: 4px 0 0 4px;
    transform: scaleY(0);
    transition: transform 0.22s ease;
}
.group-card:hover::before { transform: scaleY(1); }
.group-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    color: var(--primary-dark);
}

.group-card .card-icon {
    font-size: 1.8rem; margin-bottom: 0.5rem;
    width: 44px; height: 44px;
    background: var(--success-bg);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}
.group-card .card-title {
    font-size: 1rem; font-weight: 600; line-height: 1.4;
    margin-bottom: 0.25rem;
}
.group-card .card-desc {
    font-size: 0.8rem; color: var(--text-muted);
    margin-top: auto; margin-bottom: 0;
}
.group-card .card-arrow {
    position: absolute; right: 1rem; bottom: 1rem;
    color: var(--primary); font-size: 1.1rem;
    opacity: 0; transition: opacity 0.2s, right 0.2s;
}
.group-card:hover .card-arrow { opacity: 1; right: 0.75rem; }

/* ======= BẢNG DỮ LIỆU ======= */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table thead th {
    background: var(--primary);
    color: #fff; font-weight: 600;
    padding: 0.8rem 1rem; font-size: 0.88rem;
    position: sticky; top: 0; z-index: 1;
}
.data-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.data-table tbody tr:hover { background: var(--success-bg); }
.data-table tbody td { padding: 0.85rem 1rem; vertical-align: middle; font-size: 0.93rem; }
.data-table tbody tr:last-child td { border-bottom: none; }

.data-link {
    color: var(--primary-dark); font-weight: 600;
    text-decoration: none; font-size: 0.95rem;
}
.data-link:hover { color: var(--primary-light); text-decoration: underline; }

/* Badge trạng thái */
.badge-hieuluc {
    background: #E8F5E9; color: #1B6B2A;
    font-size: 0.72rem; padding: 0.2em 0.6em;
    border-radius: 20px; font-weight: 500;
}
.badge-hethieuluc {
    background: #FFF3E0; color: #E65100;
    font-size: 0.72rem; padding: 0.2em 0.6em;
    border-radius: 20px; font-weight: 500;
}
.badge-cofile {
    background: #E3F2FD; color: #1565C0;
    font-size: 0.72rem; padding: 0.2em 0.6em;
    border-radius: 20px; font-weight: 500;
}

/* ======= CHI TIẾT DỮ LIỆU ======= */
.detail-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    overflow: hidden;
}
.detail-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 1.5rem;
    color: #fff;
}
.detail-header h1 { font-size: 1.3rem; font-weight: 700; margin: 0; line-height: 1.4; }
.detail-body { padding: 1.5rem; }

.meta-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.meta-badge {
    background: rgba(255,255,255,0.2);
    border-radius: 20px; padding: 0.2em 0.8em;
    font-size: 0.78rem; color: rgba(255,255,255,0.95);
}

.content-area {
    font-size: 1.05rem; line-height: 1.85;
    color: var(--text-main);
}
.content-area img { max-width: 100%; height: auto; border-radius: 8px; }
.content-area table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.content-area table td, .content-area table th {
    border: 1px solid var(--border); padding: 0.5rem 0.75rem;
}
.content-area table thead th { background: var(--success-bg); }

.download-btn {
    background: var(--primary); color: #fff;
    border: none; border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem;
    font-size: 1rem; font-weight: 600;
    cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center; gap: 0.5rem;
    transition: background 0.2s, transform 0.1s;
}
.download-btn:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }

/* ======= TÌM KIẾM ======= */
.search-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1.5px solid var(--border);
    margin-bottom: 1.5rem;
}
.search-input-wrapper {
    display: flex; gap: 0.5rem;
}
.search-input {
    flex: 1; border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem; font-size: 1rem;
    font-family: var(--font);
    outline: none; transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--primary-light); }
.search-btn {
    background: var(--primary); color: #fff;
    border: none; border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem; font-size: 1rem;
    cursor: pointer; font-family: var(--font);
    display: flex; align-items: center; gap: 0.4rem;
    transition: background 0.2s;
}
.search-btn:hover { background: var(--primary-dark); }

.search-highlight { background: #FFF176; padding: 0 2px; border-radius: 2px; }

/* ======= PAGINATION ======= */
.pagination-wrapper { display: flex; justify-content: center; margin-top: 1.5rem; }
.page-btn {
    min-width: 40px; height: 40px;
    border: 1.5px solid var(--border);
    background: var(--bg-card); color: var(--text-main);
    border-radius: var(--radius-sm); margin: 0 2px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 0.9rem; text-decoration: none;
    transition: all 0.15s;
}
.page-btn:hover, .page-btn.active {
    background: var(--primary); color: #fff; border-color: var(--primary);
}
.page-btn.disabled { opacity: 0.4; pointer-events: none; }

/* ======= ADMIN ======= */
.admin-sidebar {
    background: var(--primary-dark);
    min-height: calc(100vh - 60px);
    width: 240px; flex-shrink: 0;
}
.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem; padding: 0.65rem 1.2rem;
    border-radius: 0; transition: all 0.15s;
    display: flex; align-items: center; gap: 0.6rem;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.admin-sidebar .nav-link i { width: 18px; text-align: center; }

.admin-header {
    background: var(--primary-dark);
    color: #fff; padding: 0.75rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
}

.admin-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow);
}
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* Bảng admin */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
    background: var(--bg-sidebar); padding: 0.7rem 1rem;
    text-align: left; font-size: 0.85rem; font-weight: 600;
    color: var(--text-muted); border-bottom: 2px solid var(--border);
}
.admin-table td {
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
    font-size: 0.92rem; vertical-align: middle;
}
.admin-table tr:hover td { background: var(--bg-sidebar); }

/* Form controls */
.form-label-vn { font-weight: 600; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.form-control, .form-select {
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 0.65rem 0.9rem; font-family: var(--font); font-size: 0.95rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(46,125,50,0.12);
}

/* Buttons */
.btn-primary-vn {
    background: var(--primary); color: #fff; border: none;
    border-radius: var(--radius-sm); padding: 0.65rem 1.5rem;
    font-family: var(--font); font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: background 0.2s;
}
.btn-primary-vn:hover { background: var(--primary-dark); }
.btn-danger-vn {
    background: #D32F2F; color: #fff; border: none;
    border-radius: var(--radius-sm); padding: 0.4rem 0.85rem;
    font-family: var(--font); font-size: 0.85rem; cursor: pointer;
}
.btn-danger-vn:hover { background: #B71C1C; }
.btn-secondary-vn {
    background: transparent; color: var(--primary); border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm); padding: 0.6rem 1.25rem;
    font-family: var(--font); font-size: 0.92rem; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
}
.btn-secondary-vn:hover { background: var(--primary); color: #fff; }

/* ======= FOOTER ======= */
.site-footer {
    background: var(--primary-dark); color: rgba(255,255,255,0.85);
    margin-top: 3rem;
}
.site-footer a { color: rgba(255,255,255,0.7); }
.site-footer a:hover { color: #fff; }
.site-footer .border-top { border-color: rgba(255,255,255,0.15) !important; }

/* ======= RESPONSIVE ======= */
@media (max-width: 1260px) {
   .brand-gioithieu {
        display: none;
    }
}
@media (max-width: 768px) {
    body { font-size: 15px; }
/*    .brand-sub { display: none; }
*/  .brand-gioithieu { display: none; }
    .brand-main { font-size: 1rem; }
    .group-card { min-height: 90px; }
    .detail-header h1 { font-size: 1.1rem; }
    .content-area { font-size: 1rem; }
    .data-table { display: block; overflow-x: auto; }
    .admin-sidebar { display: none; }
}

/* ======= LOADING ======= */
.loading-spinner {
    display: flex; justify-content: center; align-items: center;
    padding: 3rem; color: var(--primary);
}
.spinner {
    width: 40px; height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ======= ALERT ======= */
.alert-success-vn {
    background: #E8F5E9; border: 1px solid #A5D6A7;
    color: #1B5E20; border-radius: var(--radius-sm); padding: 0.75rem 1rem;
    font-size: 0.9rem;
}
.alert-danger-vn {
    background: #FFEBEE; border: 1px solid #FFCDD2;
    color: #B71C1C; border-radius: var(--radius-sm); padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

/* Empty state */
.empty-state {
    text-align: center; padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state h5 { font-size: 1.1rem; font-weight: 600; }
