:root {
    --bg: #0f172a;
    --card: #ffffff; /* Mengubah warna card menjadi putih solid */
    --text: #1e293b;
    --muted: #64748b;
    --border: rgba(255, 255, 255, 0.25);
    --accent: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    --accent-hover: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    --accent-solid: #4f46e5;
    --success: #2d8f69;
    --danger-soft: #fde7e7;
    --glass: rgba(255, 255, 255, 0.4);
}

body {
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    background: #f8fafc; /* Warna soft (Slate 50) */
    color: var(--text);
}

.bg-photo {
    background: linear-gradient(rgba(15, 23, 42, 0.65), rgba(15, 23, 42, 0.65)), 
                url('https://lh3.googleusercontent.com/p/AF1QipM89GBRhHhYg1eoDHd0fvshKvVu0SCgCvOVWGZc=s1360-w1360-h1020-rw?q=80&w=2070&auto=format&fit=crop') !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.card {
    background: var(--card);
    /* Menghapus backdrop-filter untuk tampilan yang lebih lembut */
    /* -webkit-backdrop-filter: blur(16px); */
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    margin-bottom: 24px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.3);
}

h1, h2 {
    margin: 0 0 16px;
}

/* Standardize header colors within cards for readability */
.card h1,
.card h2 {
    color: #111827; /* Very dark grey for main headers */
}

.card h3,
.card h4 {
    color: #334155; /* Slightly lighter dark grey for sub-headers */
}

.grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

input, select, button {
    width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-family: inherit;
    box-sizing: border-box;
}

input {
    background: #f2f6fb;
    color: var(--text);
}

select {
    background: #f7fafd;
}

input:focus,
select:focus,
button:focus {
    outline: none;
    border-color: rgba(124, 153, 201, 0.55);
    box-shadow: 0 0 0 4px rgba(124, 153, 201, 0.16);
}

button {
    background: var(--accent-solid);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover {
    background: #6882b5;
    transform: translateY(-1px);
}

button.secondary, a.secondary, .nav-btn {
    background: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    gap: 6px;
}

.nav-btn:hover {
    background: #f8fafc;
    color: var(--accent-solid);
}

.nav-btn.active {
    background: var(--accent-solid);
    color: #ffffff !important;
    border-color: var(--accent-solid);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.table-actions form {
    display: inline-flex;
    margin: 0;
}

.table-actions button,
.table-actions a.secondary {
    width: auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    line-height: 1.2;
    border-radius: 8px;
    box-shadow: none;
    font-weight: 600;
    border: none; /* Menghapus border agar ukurannya sama dengan button hapus */
    box-sizing: border-box; /* Memastikan perhitungan padding identik */
}

button.danger, .danger {
    background: #f87171;
    color: white;
    border-color: #ef4444;
}

button.danger:hover, .danger:hover {
    background: #ef4444;
}

.table-actions a.secondary, .table-actions form {
    margin: 0;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 40px;
    background: transparent;
}

.login-card {
    max-width: 350px;
    width: 100%;
    padding: 24px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(163, 179, 204, 0.28);
    backdrop-filter: blur(10px);
    box-shadow: 0 26px 60px rgba(92, 114, 153, 0.08);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 180px;
    height: 180px;
    background: rgba(124, 153, 201, 0.14);
    border-radius: 50%;
}

.login-brand {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.login-brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #7c99c9 0%, #c3d4ee 100%);
    box-shadow: 0 20px 40px rgba(124, 153, 201, 0.18);
}

.login-form {
    display: grid;
    gap: 12px;
}

.login-form label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

.login-form input {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 10px 14px;
    font-size: 0.9rem;
    border-radius: 10px;
    transition: border-color 0.2s ease;
}

.login-footer {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-footer a.secondary {
    justify-content: center;
}

.alert-danger {
    background: #fde8e8;
    color: #9b2c2c;
    border-color: #f7c8c8;
}

.logo-preview {
    margin-bottom: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    justify-content: center;
    background: #ffffff;
}

.logo-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    border: 1px solid #e2e8f0; /* Outer border for the table */
    border-radius: 12px; /* Rounded corners for the table */
    overflow: hidden; /* Ensures border-radius is applied to content */
    font-size: 0.85rem;
}

th, td {
    text-align: center;
    padding: 6px 8px;
    border-bottom: 1px solid #e2e8f0; /* Consistent border for rows */
    line-height: 1.3;
}

th {
    background-color: #f1f5f9; /* Soft slate 100 for header background */
    color: #475569; /* Slate 700 for header text */
    font-weight: 600;
}

tbody tr {
    background-color: #ffffff; /* White background for body rows */
}

tbody tr:last-child td {
    border-bottom: none; /* No border for the last row */
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

.master-data-grid {
    display: grid;
    grid-template-columns: minmax(280px, 320px) 1fr;
    gap: 20px;
    align-items: start;
}

.master-data-panel {
    padding: 16px 20px;
}

.master-data-form {
    display: grid;
    gap: 10px;
    max-width: 280px;
    margin: 0 auto;
}

.master-data-form label {
    margin-top: 0;
}

.master-data-form input,
.master-data-form button {
    width: 100%;
    max-width: 360px;
    box-sizing: border-box;
}

.master-data-form input {
    min-width: 0;
}

.master-data-form button {
    margin-top: 8px;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-actions form,
.table-actions a.secondary {
    margin: 0;
}

th {
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase; /* Membuat semua teks header tabel menjadi huruf kapital */
}

.status-present {
    color: var(--success);
    font-weight: 700;
}

.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    background: #dbeafe;
    color: #1e40af;
}

.report-filter-form {
    display: grid;
    gap: 18px;
}

.report-filter-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: start;
}

.report-filter-grid .filter-field {
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-filter-grid label {
    margin: 0;
}

.report-filter-grid input,
.report-filter-grid select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    box-sizing: border-box;
}

.report-filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.report-table-wrapper {
    max-height: 520px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.table-responsive table,
.report-table-wrapper table {
    margin-top: 0;
    min-width: 850px;
}

@media (max-width: 768px) {
    th, td {
        padding: 10px 8px;
        font-size: 0.8rem;
    }
    .card {
        padding: 16px;
    }
}

.report-table-wrapper thead th {
    position: sticky;
    top: 0;
    background-color: #f1f5f9; /* Ensure sticky header has the correct background */
    z-index: 1;
}

.main-footer {
    margin-top: 60px;
    padding: 30px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.05em;
}

@media (max-width: 640px) {
    .card {
        padding: 18px;
    }
}

/* Floating Logout Button */
.fab-logout {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #ffffff; /* Latar belakang putih */
    color: #ef4444;    /* Ikon warna merah */
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    z-index: 9999;
    transition: transform 0.2s ease, background-color 0.2s ease;
    border: none;
}

.fab-logout:hover {
    transform: scale(1.1);
    background: #f8fafc;
}
