:root {
    --forest-dark: #1b3b22;
    --forest-primary: #2d5a27;
    --forest-secondary: #437c3a;
    --forest-light: #8abf7e;
    --forest-bg: #f2f7f2;
    --earth-brown: #8c6239;
    --text-dark: #2c3e2e;
    --white: #ffffff;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--forest-bg);
    color: var(--text-dark);
}

/* --- Login Page --- */
.login-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(rgba(27, 59, 34, 0.7), rgba(45, 90, 39, 0.8)), url('https://images.unsplash.com/photo-1448375240586-882707db888b?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    padding: 3rem 2rem;
    border-top: 5px solid var(--forest-primary);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header img {
    height: 70px;
    margin-bottom: 1rem;
}

.login-header h3 {
    font-weight: 700;
    color: var(--forest-dark);
}

.login-header p {
    color: #666;
    font-size: 0.9rem;
}

.form-control {
    border-radius: 6px;
    padding: 0.75rem 1rem;
    border: 1px solid #ced4da;
}

.form-control:focus {
    border-color: var(--forest-light);
    box-shadow: 0 0 0 0.2rem rgba(138, 191, 126, 0.25);
}

.btn-forest {
    background-color: var(--forest-primary);
    border-color: var(--forest-primary);
    color: var(--white);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-forest:hover {
    background-color: var(--forest-dark);
    border-color: var(--forest-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.2);
}

/* --- Dashboard --- */
.navbar-forest {
    background-color: var(--forest-dark);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-forest .navbar-brand, .navbar-forest .nav-link {
    color: var(--white) !important;
}

.navbar-brand {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header {
    background: url('https://images.unsplash.com/photo-1511497584788-876760111969?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80') no-repeat center 30%/cover;
    padding: 3rem 0;
    margin-bottom: 2rem;
    position: relative;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(27, 59, 34, 0.65);
    border-radius: 0 0 15px 15px;
}

.page-title-content {
    position: relative;
    z-index: 1;
    color: var(--white);
}

.page-title-content h2 {
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.card-custom {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    margin-bottom: 2rem;
}

.card-header-custom {
    background-color: var(--white);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.5rem;
    border-radius: 10px 10px 0 0 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header-custom h5 {
    margin: 0;
    font-weight: 600;
    color: var(--forest-primary);
}

.table-hover tbody tr:hover {
    background-color: rgba(138, 191, 126, 0.05);
}

.qr-thumbnail {
    width: 60px;
    height: 60px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 3px;
    background: #fff;
}

.action-btns {
    white-space: nowrap;
}

.action-btns .btn {
    padding: 0.25rem 0.5rem;
    margin: 0 2px;
    font-size: 0.875rem;
}

/* Modal Styling */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.modal-header {
    background-color: var(--forest-primary);
    color: var(--white);
    border-radius: 12px 12px 0 0;
    border-bottom: none;
}

.modal-title {
    font-weight: 600;
}

.modal-header .close {
    color: var(--white);
    text-shadow: none;
    opacity: 0.8;
}

.modal-header .close:hover {
    opacity: 1;
}

.ql-toolbar.ql-snow {
    border-color: #ced4da;
    border-radius: 6px 6px 0 0;
    background: #f8f9fa;
}

.ql-container.ql-snow {
    border-color: #ced4da;
    border-radius: 0 0 6px 6px;
    height: 200px;
}

/* Sweet Alert Customization (Confirmation) */
.swal2-confirm {
    background-color: #dc3545 !important;
}
.swal2-cancel {
    background-color: #6c757d !important;
}

/* Print Styles */
@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }
    body * {
        visibility: hidden;
    }
    #print-area, #print-area * {
        visibility: visible;
    }
    #print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: white;
        margin: 0;
    }
    .print-container {
        text-align: center;
        width: 100%;
        max-width: 18cm; /* large enough for A4 */
        padding: 2cm;
    }
    #print-qr-title {
        font-size: 2.5rem;
        margin-bottom: 2rem;
        color: black !important;
        display: block !important;
    }
    .print-qr-image {
        width: 100%;
        max-width: 14cm;
        height: auto;
        margin: 0 auto;
        display: block !important;
        border: 2px solid #ccc;
        padding: 10px;
    }
    .d-none {
        display: none !important;
    }
    #print-area.d-none {
        display: flex !important;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .card-header-custom {
        flex-direction: column;
        align-items: stretch;
    }
    .card-header-custom h5 {
        margin-bottom: 1rem !important;
        text-align: center;
    }
    .card-header-custom button {
        width: 100%;
    }
    .page-header {
        padding: 2rem 0;
    }
    .login-card {
        margin: 0 1rem;
        padding: 2rem 1.5rem;
    }
    .navbar-brand {
        font-size: 1.1rem;
    }
}
