/* assets/css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* HEADER */
header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-header {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

header h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0;
}

header h1 small {
    font-size: 14px;
    font-weight: 300;
    opacity: 0.8;
    display: block;
    margin-top: 4px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 18px;
}

.user-info span {
    font-size: 14px;
}

.btn-logout {
    background: #e74c3c;
    color: white;
    padding: 8px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
}

/* SIDEBAR */
.sidebar {
    width: 240px;
    float: left;
    background: white;
    border-radius: 12px;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 20px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li {
    margin: 0;
}

.sidebar ul li a {
    display: block;
    padding: 12px 24px;
    color: #555;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.3s;
    font-size: 14px;
}

.sidebar ul li a:hover {
    background: #f8f9fa;
    border-left-color: #3498db;
    color: #2c3e50;
}

.sidebar ul li a.active {
    background: #e8f4f8;
    border-left-color: #3498db;
    color: #2c3e50;
    font-weight: 600;
}

.sidebar ul li a i {
    margin-right: 10px;
}

/* MAIN CONTENT */
main {
    margin-left: 270px;
    background: white;
    border-radius: 12px;
    padding: 25px 30px;
    min-height: 500px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

/* WATERMARK LOGO */
main::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('lopo.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 320px auto;
    opacity: 0.06;
    z-index: 0;
    pointer-events: none;
}

main>* {
    position: relative;
    z-index: 1;
}

main h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
    font-size: 24px;
}

/* DASHBOARD STATS */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid #e9ecef;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-card .icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.stat-card h3 {
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card p {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
}

.stat-card.blue p {
    color: #3498db;
}

.stat-card.green p {
    color: #27ae60;
}

.stat-card.orange p {
    color: #f39c12;
}

.stat-card.red p {
    color: #e74c3c;
}

/* TABLES */
.table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead {
    background: #34495e;
    color: white;
}

.table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid #ecf0f1;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.table tbody tr:nth-child(even):hover {
    background: #f1f3f5;
}

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    color: white;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    margin: 4px 2px;
}

.btn-primary {
    background: #3498db;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #d68910;
    transform: translateY(-2px);
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* FORMS */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ALERT */
.alert {
    padding: 14px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* =========================
   LOGIN PAGE
========================= */

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2c3e50, #1a252f);
}


/* LOGIN BOX */
.login-container {
    background: white;
    padding: 40px 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 380px;
}


/* =========================
   LOGO
========================= */

.login-container .logo {
    text-align: center;
    margin-bottom: 25px;
}

.login-container .logo img {
    width: 60px;
    height: auto;
    max-height: 60px;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px auto;
}


.login-container .logo h2 {
    color: #2c3e50;
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 5px 0;
}


.login-container .logo p {
    color: #7f8c8d;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}


/* =========================
   FORM
========================= */

.login-container .form-group {
    margin-bottom: 18px;
}


.login-container .form-group label {
    display: block;
    font-weight: 500;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}


.login-container .form-group label i {
    margin-right: 5px;
}


.login-container .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.3s;
}


.login-container .form-group input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}


/* =========================
   BUTTON LOGIN
========================= */

.login-container .btn-login {
    width: 100%;
    padding: 14px;

    background: linear-gradient(135deg, #3498db, #2980b9);

    color: white;
    border: none;
    border-radius: 8px;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;
    transition: all 0.3s;

    margin-top: 10px;
}


.login-container .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}


/* =========================
   FOOTER LOGIN
========================= */

.login-container .login-footer {
    text-align: center;
    margin-top: 20px;

    font-size: 13px;
    color: #7f8c8d;
}

/* RESULT BOX */
.result-box {
    background: linear-gradient(135deg, #e8f4f8, #d1ecf1);
    padding: 25px;
    border-radius: 12px;
    margin-top: 25px;
    border-left: 4px solid #3498db;
}

.result-box h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.result-box .prediction-number {
    font-size: 36px;
    font-weight: 700;
    color: #2980b9;
}

/* CHART CONTAINER */
.chart-container {
    margin-top: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.chart-container h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

/* LAPORAN */
.laporan-actions {
    margin: 20px 0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.laporan-summary {
    margin-top: 25px;
}

.laporan-summary h4 {
    color: #2c3e50;
    margin: 20px 0 10px 0;
    padding: 10px 0;
    border-bottom: 2px solid #ecf0f1;
}

/* FOOTER */
footer {
    clear: both;
    margin-top: 30px;
    padding: 20px 0;
    text-align: center;
    color: #95a5a6;
    font-size: 13px;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        float: none;
        margin-bottom: 20px;
        position: static;
    }

    main {
        margin-left: 0;
        padding: 20px;
    }

    header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    header h1 {
        font-size: 18px;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .login-container {
        width: 95%;
        padding: 30px 20px;
    }

    .container {
        padding: 10px;
    }
}

/* UTILITY */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-20 {
    padding: 20px;
}

.float-right {
    float: right;
}

.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: #3498db;
    color: white;
}

.badge-success {
    background: #27ae60;
    color: white;
}

.badge-warning {
    background: #f39c12;
    color: white;
}

.badge-danger {
    background: #e74c3c;
    color: white;
}

/* =========================
   KEPALA DESA - STYLE TAMBAHAN
========================= */

/* Badge secondary untuk status tambahan */
.badge-secondary {
    background: #95a5a6;
    color: white;
}

/* Link aktif di sidebar untuk Kepala Desa */
.sidebar ul li a .kd-badge {
    background: #e74c3c;
    color: white;
    font-size: 10px;
    padding: 1px 8px;
    border-radius: 20px;
    margin-left: 5px;
}

/* Print Styles untuk Laporan */
@media print {

    .sidebar,
    header .user-info,
    .laporan-actions,
    .btn-logout,
    .no-print {
        display: none !important;
    }

    .container {
        padding: 0 !important;
        max-width: 100% !important;
    }

    main {
        margin-left: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 20px !important;
    }

    main::before {
        opacity: 0.03 !important;
    }

    #laporan-content {
        padding: 0 !important;
    }

    .table thead {
        background: #2c3e50 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .badge {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .badge-danger {
        background: #e74c3c !important;
        color: white !important;
    }

    .badge-warning {
        background: #f39c12 !important;
        color: white !important;
    }

    .badge-primary {
        background: #3498db !important;
        color: white !important;
    }

    .badge-secondary {
        background: #95a5a6 !important;
        color: white !important;
    }

    .badge-success {
        background: #27ae60 !important;
        color: white !important;
    }

    .stat-card {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .stat-card.blue p {
        color: #3498db !important;
    }

    .stat-card.green p {
        color: #27ae60 !important;
    }

    .stat-card.orange p {
        color: #f39c12 !important;
    }

    .stat-card.red p {
        color: #e74c3c !important;
    }
}

/* Responsive untuk halaman Kepala Desa */
@media (max-width: 768px) {
    .stats {
        grid-template-columns: 1fr 1fr !important;
    }

    .sidebar {
        width: 100% !important;
        float: none !important;
        margin-bottom: 20px !important;
        position: static !important;
    }

    main {
        margin-left: 0 !important;
        padding: 15px !important;
    }

    header {
        flex-direction: column !important;
        text-align: center !important;
        gap: 15px !important;
    }

    .header-title {
        justify-content: center !important;
    }

    .user-info {
        justify-content: center !important;
    }

    .btn-logout {
        font-size: 12px !important;
        padding: 6px 14px !important;
    }

    /* Ranking & Rekomendasi grid menjadi 1 kolom */
    .container>div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr !important;
    }

    .container {
        padding: 10px !important;
    }

    main {
        padding: 10px !important;
    }

    .table th,
    .table td {
        padding: 8px 10px !important;
        font-size: 12px !important;
    }

    .stat-card p {
        font-size: 24px !important;
    }

    .stat-card .icon {
        font-size: 24px !important;
    }
}