* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1f2937;
    --gray-light: #f3f4f6;
    --gray-medium: #d1d5db;
    --gray-dark: #6b7280;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f9fafb;
    color: var(--dark);
    line-height: 1.6;
}

/* ========== NAVBAR ========== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
    stroke-width: 2;
    flex-shrink: 0;
}

.navbar-icon[src] {
    /* For img element */
    object-fit: contain;
    border-radius: 4px;
}

.navbar-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-right {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.navbar-link {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.navbar-link:hover {
    color: var(--primary);
    background: var(--gray-light);
}

/* ========== HOME PAGE ========== */
.home-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.content-box {
    text-align: center;
    color: white;
    max-width: 600px;
}

.content-text {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.btn-contact {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: white;
    color: var(--primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* ========== FOOTER ========== */
.footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

.footer p {
    margin: 0;
    font-size: inherit;
}

/* ========== LOGIN PAGE ========== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1.5rem;
}

.login-box {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    width: 60px;
    height: 60px;
    color: var(--primary);
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--gray-dark);
}

/* ========== FORM ELEMENTS ========== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.75rem;
    border: 2px solid var(--gray-medium);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ========== BUTTONS ========== */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-info,
.btn-add,
.btn-filter,
.btn-close,
.btn-search {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--dark);
    border: 2px solid var(--gray-medium);
}

.btn-secondary:hover {
    background: var(--gray-medium);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-info:hover {
    background: #2563eb;
}

.btn-add {
    background: var(--success);
    color: white;
    padding: 0.65rem 1rem;
}

.btn-add:hover {
    background: #059669;
}

.btn-filter {
    background: var(--warning);
    color: white;
    padding: 0.65rem 1rem;
}

.btn-filter:hover {
    background: #d97706;
}

.btn-close {
    background: transparent;
    color: var(--dark);
    padding: 0.5rem;
    font-size: 1.5rem;
}

.btn-close:hover {
    background: var(--gray-light);
}

.btn-search {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
}

.btn-danger-small {
    padding: 0.5rem 1rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-danger-small:hover {
    background: #dc2626;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    align-items: flex-end;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ========== ALERTS ========== */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #7f1d1d;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #78350f;
    border: 1px solid #fde68a;
}

/* ========== NOTA PAGE ========== */
.nota-page {
    background: var(--gray-light);
}

.nota-main {
    padding: 1.5rem;
    padding-top: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nota-container {
    width: 100%;
}

.nota-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--gray-medium);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.toolbar-actions {
    display: flex;
    gap: 0.75rem;
}

/* ========== FILTER MENU ========== */
.filter-menu {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.filter-section {
    margin-bottom: 1.5rem;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section h4 {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--dark);
}

.filter-section label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.filter-section input[type="radio"] {
    cursor: pointer;
}

/* ========== PINJAMAN LIST ========== */
.pinjaman-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.pinjaman-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.pinjaman-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.pinjaman-card.overdue {
    border-top: 4px solid var(--danger);
    order: -1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

.card-date {
    font-size: 0.85rem;
    color: var(--gray-dark);
    white-space: nowrap;
    margin-left: 0.5rem;
}

.card-name.overdue-text,
.card-date.overdue-text {
    color: var(--danger);
}

.card-body {
    margin-bottom: 1rem;
}

.card-alamat {
    font-size: 0.85rem;
    color: var(--gray-dark);
    margin-bottom: 0.75rem;
}

.card-jumlah {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--danger);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.empty-state p {
    font-size: 1.1rem;
    color: var(--gray-dark);
    margin-bottom: 1.5rem;
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.modal-form {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
}

.modal-detail {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-light);
    padding-bottom: 1rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

/* ========== DETAIL CONTENT ========== */
.detail-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-dark);
    margin-bottom: 0.25rem;
}

.detail-item p {
    font-size: 1rem;
    color: var(--dark);
}

.detail-item a {
    color: var(--primary);
    text-decoration: none;
}

.detail-item a:hover {
    text-decoration: underline;
}

.detail-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ========== RIWAYAT TABLE ========== */
.riwayat-content {
    margin-top: 1rem;
}

.riwayat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.riwayat-table thead {
    background: var(--gray-light);
}

.riwayat-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--gray-medium);
}

.riwayat-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-light);
}

.riwayat-table tbody tr:hover {
    background: var(--gray-light);
}

/* ========== DASHBOARD PAGE ========== */
.dashboard-page {
    background: var(--gray-light);
}

.dashboard-main {
    padding: 1.5rem;
    padding-top: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.dashboard-container h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--dark);
}

.dashboard-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dashboard-section h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
    border-bottom: 2px solid var(--gray-light);
    padding-bottom: 1rem;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.gradient-picker {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.gradient-picker input[type="color"] {
    width: 60px;
    height: 60px;
    border: 2px solid var(--gray-medium);
    border-radius: 8px;
    cursor: pointer;
}

.gradient-preview {
    width: 100%;
    height: 200px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.add-admin-form {
    background: var(--gray-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.admin-table thead {
    background: var(--gray-light);
}

.admin-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--gray-medium);
}

.admin-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-light);
}

.admin-table tbody tr:hover {
    background: var(--gray-light);
}

.badge-current {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--success);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.info-text {
    color: var(--gray-dark);
    font-style: italic;
    margin-bottom: 1rem;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }

    .navbar-title {
        font-size: 1.25rem;
    }

    .navbar-right {
        gap: 1rem;
    }

    .navbar-link {
        font-size: 0.85rem;
        padding: 0.5rem 0.5rem;
    }

    .content-text {
        font-size: 1.2rem;
    }

    .login-box {
        padding: 1.5rem;
    }

    .nota-toolbar {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .toolbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .toolbar-actions button {
        flex: 1;
    }

    .pinjaman-list {
        grid-template-columns: 1fr;
    }

    .modal-form {
        padding: 1.5rem;
        max-width: 100%;
    }

    .modal-detail {
        padding: 1.5rem;
        max-width: 100%;
    }

    .detail-actions {
        grid-template-columns: 1fr;
    }

    .dashboard-section {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .admin-table {
        font-size: 0.85rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.5rem;
    }

    .riwayat-table {
        font-size: 0.8rem;
    }

    .riwayat-table th,
    .riwayat-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .navbar {
        flex-direction: row;
        gap: 0;
        padding: 0.75rem 1rem;
    }

    .navbar-left {
        flex: 1;
        margin-right: auto;
        justify-content: flex-start;
    }

    .navbar-right {
        justify-content: flex-end;
        gap: 0.75rem;
    }

    .navbar-title {
        font-size: 1rem;
    }

    .navbar-icon {
        width: 24px;
        height: 24px;
    }

    .navbar-link {
        font-size: 0.75rem;
        padding: 0.4rem 0.5rem;
    }

    .content-text {
        font-size: 1rem;
    }

    .btn-contact {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    .login-box {
        padding: 1.25rem;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger,
    .btn-info {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }

    .btn-add,
    .btn-filter {
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
    }

    .modal-form,
    .modal-detail {
        padding: 1rem;
    }

    .dashboard-container h1 {
        font-size: 1.5rem;
    }

    .dashboard-section {
        padding: 1rem;
    }

    .dashboard-section h2 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .gradient-picker {
        flex-wrap: wrap;
    }

    .gradient-picker input[type="color"] {
        width: 50px;
        height: 50px;
    }

    .gradient-preview {
        height: 150px;
    }
}
