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

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

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

h1 {
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
}

.header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header-info h1 {
    margin-bottom: 0;
}

.header-nav {
    display: flex;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #666;
    font-size: 14px;
}

.btn-logout {
    background-color: #f44336;
    color: white;
}

.btn-logout:hover {
    background-color: #da190b;
}

.btn-nav {
    background-color: #6c757d;
    color: white;
}

.btn-nav:hover {
    background-color: #5a6268;
}

.btn-nav.btn-active {
    background-color: #4CAF50;
}

.btn-nav.btn-active:hover {
    background-color: #45a049;
}

/* Search Box */
.search-box {
    margin-bottom: 20px;
}

.search-box form {
    display: flex;
    gap: 10px;
}

.search-box input[type="text"] {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-box button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.search-box button:hover {
    background-color: #45a049;
}

.search-box a {
    padding: 10px 20px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
    transition: background-color 0.3s;
}

.btn-add {
    background-color: #4CAF50;
    color: white;
}

.btn-add:hover {
    background-color: #45a049;
}

.btn-edit {
    background-color: #2196F3;
    color: white;
    margin-right: 5px;
}

.btn-edit:hover {
    background-color: #0b7dda;
}

.btn-delete {
    background-color: #f44336;
    color: white;
}

.btn-delete:hover {
    background-color: #da190b;
}

.btn-view {
    background-color: #00bcd4;
    color: white;
    margin-right: 5px;
}

.btn-view:hover {
    background-color: #008ba3;
}

.btn-back {
    background-color: #9e9e9e;
    color: white;
    margin-bottom: 20px;
    display: inline-block;
}

.btn-back:hover {
    background-color: #7b7b7b;
}

.btn-submit {
    background-color: #4CAF50;
    color: white;
}

.btn-submit:hover {
    background-color: #45a049;
}

.btn-cancel {
    background-color: #f44336;
    color: white;
}

.btn-cancel:hover {
    background-color: #da190b;
}

.btn-copy {
    background-color: #9C27B0;
    color: white;
}

.btn-copy:hover {
    background-color: #7B1FA2;
}

.actions {
    margin-bottom: 20px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

table th, table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

table tr:hover {
    background-color: #f5f5f5;
}

/* Badge */
.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background-color: #4CAF50;
    color: white;
}

.badge-warning {
    background-color: #ff9800;
    color: white;
}

/* Pagination */
.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a, .pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    margin: 0 2px;
    display: inline-block;
}

.pagination a:hover {
    background-color: #4CAF50;
    color: white;
}

.pagination span.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* Total Records */
.total-records {
    margin-top: 20px;
    text-align: center;
    color: #666;
}

/* Form */
form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Detail View */
.detail-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.detail-group {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.detail-group label {
    display: block;
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
    font-size: 13px;
}

.detail-group span {
    display: block;
    color: #333;
    font-size: 15px;
}

.detail-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

/* Success Message */
.success {
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .search-box form {
        flex-direction: column;
    }

    .search-box input[type="text"],
    .search-box button,
    .search-box a {
        width: 100%;
    }

    table {
        font-size: 12px;
    }

    form {
        grid-template-columns: 1fr;
    }

    .header-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
    }
}

/* Dashboard Styles */
.dashboard-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Dashboard Table Styles */
.dashboard-table-container {
    margin-top: 30px;
}

.dashboard-table-container h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 24px;
}

.dashboard-table-container > p {
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-table thead th {
    background-color: #4CAF50;
    color: white;
    font-weight: 600;
    padding: 12px 8px;
    border: 1px solid #45a049;
    text-align: center;
    vertical-align: middle;
}

.dashboard-table .cv-header {
    background-color: #2196F3;
    font-size: 14px;
    min-width: 60px;
}

.dashboard-table .dibelanjakan-header {
    background-color: #4CAF50;
    font-size: 14px;
}

.dashboard-table .belum-dibelanjakan-header {
    background-color: #ff9800;
    font-size: 14px;
}

.dashboard-table .jenis-hewan-header {
    background-color: #66bb6a;
    font-size: 13px;
}

.dashboard-table .kelas-header {
    background-color: #81c784;
    font-size: 11px;
    min-width: 70px;
}

.dashboard-table tbody td {
    padding: 10px 8px;
    border: 1px solid #ddd;
    text-align: center;
    vertical-align: middle;
}

.dashboard-table .cv-cell {
    background-color: #f5f5f5;
    font-weight: bold;
    font-size: 14px;
}

.dashboard-table .data-cell {
    font-size: 13px;
}

.dashboard-table .total-cell {
    background-color: #fff3e0;
    color: #e65100;
}

.dashboard-table tbody tr:hover {
    background-color: #e8f5e9;
}

/* Styling khusus untuk tabel Belum Dibelanjakan */
.dashboard-table-container:nth-of-type(2n+2) .dashboard-table tbody tr:hover {
    background-color: #fff3e0;
}

.dashboard-table-container:nth-of-type(2n+2) .dashboard-table .jenis-hewan-header {
    background-color: #ffb74d;
}

.dashboard-table-container:nth-of-type(2n+2) .dashboard-table .kelas-header {
    background-color: #ffcc80;
}

.dashboard-table .total-row {
    background-color: #4CAF50 !important;
    color: black;
}

.dashboard-table .total-row .cv-cell {
    background-color: #45a049;
    color: black;
}

.dashboard-table .total-row .data-cell {
    color: black;
}

.dashboard-table .total-row:hover {
    background-color: #45a049 !important;
}

.dashboard-table .total-row-warning {
    background-color: #ff9800 !important;
    color: black;
}

.dashboard-table .total-row-warning .cv-cell {
    background-color: #f57c00;
    color: black;
}

.dashboard-table .total-row-warning .data-cell {
    color: black;
}

.dashboard-table .total-cell-warning {
    background-color: #ffe0b2;
    color: #e65100;
}

.dashboard-table .total-row-warning:hover {
    background-color: #f57c00 !important;
}

.dashboard-legend {
    background-color: #e3f2fd;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #2196F3;
    margin-bottom: 20px;
}

.dashboard-legend p {
    margin: 0;
    color: #1565c0;
    font-size: 13px;
}

.dashboard-legend-warning {
    background-color: #fff3e0;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #ff9800;
    margin-bottom: 20px;
}

.dashboard-legend-warning p {
    margin: 0;
    color: #e65100;
    font-size: 13px;
}

.dashboard-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

/* Responsive dashboard table */
@media (max-width: 1024px) {
    .dashboard-table {
        font-size: 10px;
    }

    .dashboard-table thead th {
        padding: 8px 4px;
    }

    .dashboard-table tbody td {
        padding: 8px 4px;
    }

    .dashboard-table .kelas-header {
        font-size: 9px;
        min-width: 50px;
    }
}

@media (max-width: 768px) {
    .dashboard-table-container {
        overflow-x: auto;
    }

    .dashboard-actions {
        flex-direction: column;
    }

    .dashboard-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* QC Tadhiyah Styles */
.qc-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.qc-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 10px;
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.qc-card:hover {
    transform: translateY(-5px);
}

.qc-card-jiwa {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.qc-card-nominal {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.qc-card-icon {
    font-size: 50px;
}

.qc-card-info h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 500;
    opacity: 0.9;
}

.qc-card-value {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
}

.qc-table-container {
    margin-top: 30px;
}

.qc-table-container h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.qc-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.qc-table thead th {
    background-color: #667eea;
    color: white;
    font-weight: 600;
    padding: 15px;
    border: 1px solid #5568d3;
    text-align: center;
}

.qc-table tbody td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: center;
}

.qc-table tbody tr:hover {
    background-color: #f5f5f5;
}

.qc-table .qc-total-row {
    background-color: #667eea !important;
    color: white;
    font-weight: 600;
}

.qc-table .qc-total-row:hover {
    background-color: #5568d3 !important;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 20px;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.modal-body .form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.modal-body .form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal-body .form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-body .form-actions .btn {
    flex: 1;
    text-align: center;
}

/* Error and Success Messages */
.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.info-notice {
    background-color: #e3f2fd;
    border: 1px solid #bbdefb;
    color: #0d47a1;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.info-notice p {
    margin: 0;
}

.copy-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.copy-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.copy-checkbox:hover {
    background-color: #f0f0f0;
}

.copy-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.copy-checkbox span {
    font-size: 14px;
    cursor: pointer;
}

.copy-info {
    background-color: #fff3e0;
    padding: 12px;
    border-radius: 4px;
    border-left: 4px solid #ff9800;
    margin-bottom: 20px;
}

.copy-info p {
    margin: 0;
    font-size: 13px;
    color: #e65100;
}
