:root {
--primary-color: #1a237e; /* Navy Blue /
--secondary-color: #283593; / Darker Navy Blue /
--text-color: #333; / Dark Gray for better readability on white /
--bg-color: #f5f5f5; / Light Gray background /
--glass-bg: rgba(255, 255, 255, 0.7); / More opaque white glass /
--border-color: #dcdcdc; / Light Gray border */
--success-color: #4caf50;
--danger-color: #f44336;
--font-family: 'Poppins', sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px; /* Slightly reduced max-width */
    margin: 2rem auto;
    padding: 2rem;
    background-color: #fff; /* White container background */
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

header {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr; /* Adjusting column proportions */
    gap: 1.5rem;
}

/* Form Styling */
.form-container h2 {
    margin-bottom: 1.5rem;
    font-weight: 500;
    color: var(--primary-color);
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 400;
    color: var(--text-color);
}

.input-with-icon {
    position: relative;
}

.input-with-icon .fas {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: #777;
    opacity: 0.7;
    font-size: 0.9rem;
}

.input-with-icon input,
.input-with-icon select {
    width: 100%;
    padding: 8px 10px 8px 30px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    font-family: var(--font-family);
    transition: border-color 0.3s ease;
}

.input-with-icon input::placeholder {
    color: #aaa;
}

.input-with-icon input:focus,
.input-with-icon select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(26, 35, 126, 0.3);
}

#togglePassword {
    right: 10px;
    left: auto;
    cursor: pointer;
}

/* Table Styling */
.table-container {
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.table-header h2 {
    color: var(--primary-color);
    font-weight: 500;
}

.search-box {
    position: relative;
}

.search-box .fas {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    color: #777;
    opacity: 0.7;
    font-size: 0.9rem;
}

#searchInput {
    padding: 6px 10px 6px 30px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    width: 200px;
    transition: all 0.3s ease;
}
#searchInput:focus {
    outline: none;
    border-color: var(--secondary-color);
    width: 250px;
}

.table-wrapper {
    max-height: 350px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background-color: #e0e0e0;
    color: var(--text-color);
    padding: 10px;
    text-align: left;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

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

tbody tr:hover {
    background-color: #f9f9f9;
}

tbody td {
    padding: 10px;
}

.status {
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

.status-aktif {
    background-color: #e8f5e9;
    color: #4caf50;
}

.status-tidak-aktif {
    background-color: #ffebee;
    color: #f44336;
}

/* Buttons */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.btn i {
    margin-right: 5px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    width: auto; /* Adjust width */
    display: inline-block; /* To control width */
    padding: 10px 20px; /* Adjust padding */
}
.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}
form#userForm .btn-primary {
    width: 100%; /* Make submit button full width in form */
}

.btn-edit, .btn-delete {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    margin-right: 5px;
}
.btn-edit:hover {
    background-color: #bbdefb;
    border-color: #bbdefb;
    color: var(--primary-color);
}
.btn-delete:hover {
    background-color: #ef9a9a;
    border-color: #ef9a9a;
    color: var(--danger-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4); /* Slightly less opaque */
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 350px;
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
}

#modalTitle {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 500;
}
#modalMessage {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}
.btn-danger {
    background-color: var(--danger-color);
    color: #fff;
}
.btn-secondary {
    background-color: #9e9e9e;
    color: #fff;
}
.empty-data-message {
    text-align: center;
    padding: 1.5rem;
    color: #777;
    display: none; /* Initially hidden */
}

/* Login Modal Styles */
#loginModal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
}

#loginModalContent {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 350px;
    width: 90%;
}

#loginModal h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

#loginPassword {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}
#loginPassword:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(26, 35, 126, 0.3);
}

#loginSubmit {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}
#loginSubmit:hover {
    background-color: var(--secondary-color);
}

#loginError {
    color: var(--danger-color);
    margin-top: 10px;
    font-size: 0.9rem;
}

/* Responsive */
@media(max-width: 768px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    #searchInput {
        width: 100%;
    }
    .table-wrapper {
        max-height: 300px;
    }
}