* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
}

.login-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 12px;
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: #2c3e50;
    color: white;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.3s ease, min-width 0.3s ease;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* Collapsed state */
.sidebar.collapsed {
    width: 0;
    min-width: 0;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    background: #1a252f;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-header h3 {
    margin-bottom: 10px;
}

.sidebar-menu {
    list-style: none;
    white-space: nowrap;
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1;
}

.sidebar-menu li {
    border-bottom: 1px solid #34495e;
}

.sidebar-menu li a {
    display: block;
    padding: 14px 20px;
    color: white;
    text-decoration: none;
    transition: 0.2s;
}

.sidebar-menu li a:hover {
    background: #34495e;
}

.menu-header {
    padding: 10px 20px;
    font-size: 12px;
    color: #95a5a6;
    text-transform: uppercase;
    font-weight: bold;
}

/* Sidebar Dropdown */
.sidebar-menu .menu-single {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    color: white;
    text-decoration: none;
    transition: background 0.2s, padding-left 0.2s;
}

.sidebar-menu .menu-single:hover {
    background: #34495e;
    padding-left: 28px;
}

.sidebar-menu .menu-logout {
    color: #e74c3c;
}

.sidebar-menu .menu-logout:hover {
    background: #3d1a1a;
}

.has-dropdown > .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.has-dropdown > .dropdown-toggle:hover {
    background: #34495e;
}

.has-dropdown > .dropdown-toggle .arrow {
    margin-left: auto;
    font-size: 18px;
    transition: transform 0.25s;
    line-height: 1;
}

.has-dropdown.open > .dropdown-toggle {
    background: #34495e;
}

.has-dropdown.open > .dropdown-toggle .arrow {
    transform: rotate(90deg);
}

.dropdown-menu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #1e2d3d;
}

.has-dropdown.open > .dropdown-menu {
    max-height: 300px;
}

.dropdown-menu li {
    border-bottom: 1px solid #243447;
}

.dropdown-menu li a {
    display: block;
    padding: 11px 20px 11px 44px;
    color: #bdc3c7;
    text-decoration: none;
    font-size: 13.5px;
    transition: background 0.2s, color 0.2s, padding-left 0.2s;
}

.dropdown-menu li a:hover {
    background: #2c3e50;
    color: white;
    padding-left: 52px;
}

.menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* ── Main Content ── */
.main-content {
    flex: 1;
    min-width: 0;
    background: #ecf0f1;
    transition: none;
}

/* ── Topbar ── */
.topbar {
    background: white;
    padding: 0 30px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar h2 {
    font-size: 18px;
    color: #2c3e50;
}

/* Hamburger toggle button */
.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: #f0f0f0;
}

.sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #2c3e50;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.content {
    padding: 30px;
}

/* Card */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 20px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.search-form {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.search-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Button */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    transition: 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-info {
    background: #16a085;
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

/* Table */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
}

.table tr:hover {
    background: #f8f9fa;
}

.text-right {
    text-align: right;
}

.total-row {
    background: #f8f9fa;
    font-weight: bold;
}

/* Alert */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Badge */
.badge {
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-pending, .badge-baru, .badge-rencana {
    background: #ffeaa7;
    color: #d63031;
}

.badge-disetujui, .badge-diproses, .badge-proses {
    background: #74b9ff;
    color: #0984e3;
}

.badge-selesai {
    background: #55efc4;
    color: #00b894;
}

.badge-ditolak {
    background: #fab1a0;
    color: #d63031;
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 40px;
}

.stat-info h3 {
    font-size: 28px;
    margin-bottom: 5px;
}

.stat-info p {
    color: #666;
    font-size: 14px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard-card h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 25px;
    background: #ecf0f1;
    border-radius: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    transition: width 0.3s;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #e74c3c;
}

/* Notifikasi pulse animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Layanan publik detail */
details summary::-webkit-details-marker { color: #3498db; }
