* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
    background: #f0f4fb;
    min-height: 100vh;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a1e33, #1a3d66);
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-box h1 {
    font-size: 28px;
    color: #0a1e33;
    text-align: center;
}

.login-box .subtitle {
    text-align: center;
    color: #5f7fa0;
    margin-bottom: 24px;
}

.login-box label {
    display: block;
    font-weight: 600;
    margin: 12px 0 4px;
    font-size: 14px;
    color: #1d3d61;
}

.login-box input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1.5px solid #d6e2f0;
    font-size: 14px;
}

.login-box input:focus {
    border-color: #1a5b9c;
    outline: none;
}

.btn-block {
    width: 100%;
    margin-top: 20px;
    padding: 13px;
    font-size: 16px;
}

.login-info {
    margin-top: 20px;
    padding: 16px;
    background: #f7faff;
    border-radius: 12px;
    font-size: 13px;
    color: #5f7fa0;
}

.login-info ul {
    list-style: none;
    margin-top: 6px;
}

.login-info ul li {
    padding: 2px 0;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #0a1e33;
    padding: 24px 18px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .logo {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 28px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    color: #b6cbeb;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
    margin: 4px 0;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: #1a385a;
    color: white;
}

.sidebar nav a span {
    width: 24px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 28px 34px;
}

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

.header h1 {
    font-size: 24px;
    color: #091b30;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge {
    background: #1a385a;
    color: white;
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
}

.badge-danger {
    background: #e74c3c;
}

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

.badge-info {
    background: #1a5b9c;
    color: white;
}

.status-aktif {
    background: #d4edda;
    color: #0b6b3d;
}

.status-rusak {
    background: #f8d7da;
    color: #a1302a;
}

.status-tidak_digunakan {
    background: #f0e6d3;
    color: #7a5d2b;
}

.status-belum_terpasang {
    background: #e2e7f0;
    color: #3d4f6b;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #e9eff7;
}

.card .card-icon {
    font-size: 32px;
    background: #f7faff;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.card .card-content h3 {
    font-size: 13px;
    color: #5f7fa0;
    font-weight: 500;
}

.card .card-content .value {
    font-size: 28px;
    font-weight: 700;
    color: #091b30;
}

.panel {
    background: white;
    border-radius: 16px;
    padding: 20px 24px;
    border: 1px solid #e9eff7;
    margin-bottom: 24px;
}

.panel h3 {
    font-size: 16px;
    color: #091b30;
    margin-bottom: 16px;
}

.table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    border: 1px solid #e9eff7;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    background: #f7faff;
    color: #1a3a5e;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e0e9f4;
}

td {
    padding: 11px 16px;
    border-bottom: 1px solid #eef3fb;
    color: #1b2d47;
}

tr:last-child td {
    border-bottom: none;
}

.btn-primary {
    background: #1a5b9c;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background: #0f4a82;
}

.btn-outline {
    background: transparent;
    color: #1a5b9c;
    border: 1.5px solid #1a5b9c;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-outline:hover {
    background: #e9f0fa;
}

.btn-success {
    background: #2b7a4b;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-success:hover {
    background: #1e5f38;
}

.btn-warning {
    background: #f39c12;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.alert {
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.alert-success {
    background: #d4edda;
    color: #0b6b3d;
    border: 1px solid #b7dfb9;
}

.alert-error {
    background: #f8d7da;
    color: #a1302a;
    border: 1px solid #f5c6cb;
}

label {
    display: block;
    font-weight: 600;
    margin: 12px 0 4px;
    font-size: 14px;
    color: #1d3d61;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1.5px solid #d6e2f0;
    font-size: 14px;
    transition: 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #1a5b9c;
    outline: none;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: flex-end;
}

.search-box {
    background: white;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #e9eff7;
    margin-bottom: 24px;
}

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

.search-box input {
    flex: 1;
}

.filter-bar {
    background: white;
    padding: 14px 22px;
    border-radius: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 20px;
    margin-bottom: 24px;
    border: 1px solid #e6edf6;
}

.filter-bar label {
    margin: 0;
}

.filter-bar select {
    width: auto;
    min-width: 120px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 16px;
    color: #091b30;
}

.wilayah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.wilayah-item {
    background: white;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid #e9eff7;
    text-align: center;
}

.wilayah-item .nama {
    font-weight: 600;
    color: #091b30;
}

.wilayah-item .jumlah {
    font-size: 13px;
    color: #5f7fa0;
    margin-top: 4px;
}

.wilayah-item .status-wilayah {
    font-size: 12px;
    margin-top: 6px;
}

.survei-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.survei-stats .stat-item {
    background: #f7faff;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e9eff7;
}

.row-2col {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 24px;
    margin-bottom: 32px;
}

.chart-container {
    height: 210px;
    max-width: 100%;
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        padding: 16px 8px;
    }
    .sidebar .logo {
        font-size: 16px;
        text-align: center;
    }
    .sidebar nav a span:not(:first-child) {
        display: none;
    }
    .main-content {
        margin-left: 60px;
        padding: 16px;
    }
    .cards {
        grid-template-columns: 1fr 1fr;
    }
    .search-box form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .cards {
        grid-template-columns: 1fr;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    .modal-content {
        margin: 16px;
        padding: 20px;
    }
}
/* ============================================================
   RESPONSIVE - TABLET (max-width: 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .row-2col {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cards {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .survei-stats {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================================
   RESPONSIVE - MOBILE (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {
    /* Sidebar menjadi lebih kecil */
    .sidebar {
        width: 60px;
        padding: 16px 8px;
    }
    
    .sidebar .logo {
        font-size: 14px;
        text-align: center;
        margin-bottom: 16px;
    }
    
    .sidebar nav a {
        padding: 10px 8px;
        justify-content: center;
        font-size: 12px;
    }
    
    .sidebar nav a span:not(:first-child) {
        display: none;
    }
    
    .sidebar nav a span:first-child {
        font-size: 20px;
        width: auto;
    }
    
    /* Main content */
    .main-content {
        margin-left: 60px;
        padding: 16px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    /* Cards */
    .cards {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .card {
        padding: 14px;
        flex-direction: column;
        text-align: center;
    }
    
    .card .card-icon {
        width: 44px;
        height: 44px;
        font-size: 22px;
    }
    
    .card .card-content .value {
        font-size: 22px;
    }
    
    .card .card-content h3 {
        font-size: 11px;
    }
    
    /* Table */
    .table-wrapper {
        margin: 0 -4px;
        border-radius: 8px;
    }
    
    table {
        font-size: 12px;
        min-width: 480px;
    }
    
    th, td {
        padding: 8px 10px;
    }
    
    /* Panel */
    .panel {
        padding: 14px 16px;
    }
    
    .panel h3 {
        font-size: 15px;
    }
    
    /* Filter */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 14px;
        gap: 10px;
    }
    
    .filter-bar select {
        width: 100%;
        min-width: auto;
    }
    
    .filter-bar .btn-primary,
    .filter-bar .btn-outline {
        width: 100%;
        text-align: center;
    }
    
    /* Search */
    .search-box form {
        flex-direction: column;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .search-box .btn-primary {
        width: 100%;
        text-align: center;
    }
    
    /* Modal */
    .modal-content {
        padding: 20px;
        margin: 16px;
        width: 90%;
        max-width: 100%;
        border-radius: 16px;
    }
    
    .modal-content h2 {
        font-size: 18px;
    }
    
    /* Form actions */
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .btn-primary, .btn-outline, .btn-success {
        padding: 10px 16px;
        font-size: 13px;
        width: 100%;
        text-align: center;
    }
    
    /* User info */
    .user-info {
        font-size: 12px;
        gap: 6px;
    }
    
    .user-info .badge {
        font-size: 10px;
        padding: 2px 10px;
    }
    
    /* Wilayah grid */
    .wilayah-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .wilayah-item {
        padding: 12px;
    }
    
    .wilayah-item .nama {
        font-size: 13px;
    }
    
    /* Survei stats */
    .survei-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .survei-stats .stat-item {
        padding: 12px;
    }
    
    .survei-stats .stat-item .value {
        font-size: 20px;
    }
    
    /* Chart */
    .chart-container {
        height: 170px;
    }
    
    /* Action buttons di table */
    .action-btns {
        display: flex;
        gap: 4px;
        flex-wrap: wrap;
    }
    
    .btn-warning, .btn-danger {
        padding: 4px 10px;
        font-size: 11px;
    }
}

/* ============================================================
   RESPONSIVE - HP KECIL (max-width: 480px)
   ============================================================ */
@media (max-width: 480px) {
    .sidebar {
        width: 50px;
        padding: 12px 6px;
    }
    
    .sidebar .logo {
        font-size: 12px;
    }
    
    .sidebar nav a {
        padding: 8px 4px;
    }
    
    .sidebar nav a span:first-child {
        font-size: 16px;
    }
    
    .main-content {
        margin-left: 50px;
        padding: 12px 8px;
    }
    
    .header h1 {
        font-size: 17px;
    }
    
    .cards {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .card {
        padding: 10px;
    }
    
    .card .card-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .card .card-content .value {
        font-size: 18px;
    }
    
    .card .card-content h3 {
        font-size: 10px;
    }
    
    table {
        font-size: 11px;
        min-width: 380px;
    }
    
    th, td {
        padding: 6px 8px;
    }
    
    .badge {
        font-size: 10px;
        padding: 2px 8px;
    }
    
    .panel {
        padding: 12px 10px;
    }
    
    .modal-content {
        padding: 16px;
        margin: 8px;
        width: 95%;
        border-radius: 12px;
    }
    
    .survei-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .survei-stats .stat-item {
        padding: 10px;
    }
    
    .survei-stats .stat-item .value {
        font-size: 17px;
    }
    
    .survei-stats .stat-item .label {
        font-size: 11px;
    }
    
    .wilayah-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
    }
    
    .wilayah-item {
        padding: 10px;
    }
    
    .wilayah-item .nama {
        font-size: 12px;
    }
    
    .wilayah-item .jumlah {
        font-size: 11px;
    }
}