:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --success: #10b981;
    --warning: #ef4444;
    --border: #e2e8f0;
}

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

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

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.btn-dashboard {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-dashboard:hover {
    background: var(--primary-hover);
}

/* Typography & Utils */
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

/* Hero */
.hero {
    text-align: center;
    padding: 4rem 0;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-muted);
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title h2 {
    font-size: 1.875rem;
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--text-muted);
}

.page-header {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.back-link {
    display: inline-block;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--text);
}

/* Grids */
.grid {
    display: grid;
    gap: 1.5rem;
}

.kecamatan-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.desa-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Desa Card */
.desa-card {
    display: flex;
    flex-direction: column;
}

.card-img {
    height: 160px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border);
}

.desa-name {
    font-size: 1.25rem;
}

.desa-kec {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* Colorful Cards */
.kecamatan-grid .card:nth-child(5n+1), .desa-card:nth-child(5n+1) { background: #fee2e2; border-color: #fca5a5; }
.kecamatan-grid .card:nth-child(5n+2), .desa-card:nth-child(5n+2) { background: #dbeafe; border-color: #93c5fd; }
.kecamatan-grid .card:nth-child(5n+3), .desa-card:nth-child(5n+3) { background: #dcfce7; border-color: #86efac; }
.kecamatan-grid .card:nth-child(5n+4), .desa-card:nth-child(5n+4) { background: #fef9c3; border-color: #fde047; }
.kecamatan-grid .card:nth-child(5n+5), .desa-card:nth-child(5n+5) { background: #f3e8ff; border-color: #d8b4fe; }

/* Progress Bar */
.progress-section {
    margin-bottom: 1.5rem;
}

.progress-item {
    margin-bottom: 1rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.progress-bar {
    height: 0.5rem;
    background: rgba(0,0,0,0.1);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 1s ease-out;
}

.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }

.table-progress {
    height: 1.5rem;
    position: relative;
    background: var(--surface-hover);
    min-width: 150px;
}

.table-progress .progress-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    font-size: 1rem;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Forms & Polling */
.filter-bar {
    margin-bottom: 2rem;
}

.filter-bar input {
    width: 100%;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 0.5rem;
    font-size: 1rem;
    outline: none;
}

.filter-bar input:focus {
    border-color: var(--primary);
}

.polling-container {
    max-width: 800px;
    margin: 0 auto 4rem;
}

.desa-hero {
    height: 300px;
    border-radius: 1rem;
    background-size: cover;
    background-position: center;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.polling-form-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
}

.question-group {
    margin-bottom: 2.5rem;
}

.question-group h3 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.radio-label input {
    display: none;
}

.radio-card {
    background: var(--bg);
    border: 2px solid var(--border);
    padding: 1rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.radio-label input:checked + .radio-card {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.radio-card:hover {
    border-color: var(--text-muted);
}

/* Dashboard */
.stat-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    text-align: center;
}

.stat-card h3 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 1rem;
    overflow: hidden;
}

.dashboard-table th, .dashboard-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.dashboard-table th {
    background: rgba(0,0,0,0.2);
    font-weight: 600;
    color: var(--text-muted);
}

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

/* Kades Profile */
.kades-profile-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
}

.kades-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.kades-info h3 {
    margin-bottom: 0.25rem;
}

.kades-info p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Alasan Textarea */
.alasan-container {
    margin-top: 1rem;
    animation: fadeIn 0.3s forwards;
}

.alasan-container label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 0.5rem;
    font-size: 1rem;
    outline: none;
    resize: vertical;
    font-family: inherit;
}

.form-textarea:focus {
    border-color: var(--primary);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--warning);
    border: 1px solid var(--warning);
}

/* Animations */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; transform: translateY(0); }
    from { opacity: 0; transform: translateY(20px); }
}

/* Footer */
.footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .options { grid-template-columns: 1fr; }
    .hero h1 { font-size: 2rem; }
    .nav-content { flex-direction: column; height: auto; padding: 1rem 0; gap: 1rem; }
}
