/* =================================
   Basic Reset & Global Styles
   ================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1; /* Sedikit dirapatkan dari 1.6 */
    background-color: #ffffff; /* White background */
    color: #333333; /* Dark grey text */
}

/* =================================
   Layout & Container
   ================================= */
.container {
    width: 100%; /* Full width */
    max-width: 1200px; /* Optional: Max width for readability on large screens */
    margin: 0 auto; /* Center content horizontally */
    padding: 25px;
    background-color: #ffffff; /* Ensure container is white */
}

/* =================================
   Header & Navigation
   ================================= */
header {
    background-color: #f8f9fa; /* Light grey header */
    padding: 10px 25px;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

header h1 {
    font-size: 1.8em;
    color: #495057;
    margin: 0;
}

/* General link styling for navs */
header nav a, .admin-nav a, .user-nav a {
    color: #007bff; /* Blue links */
    text-decoration: none;
    margin-left: 15px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

header nav a:hover, .admin-nav a:hover, .user-nav a:hover {
    background-color: #e9ecef; /* Light hover background */
    text-decoration: none;
}

/* User Nav specific (index.php) */
.user-nav span {
    margin-right: 15px;
    color: #495057;
}

.logout-link {
    color: #dc3545 !important; /* Red for logout, !important to override general nav style if needed */
}
.logout-link:hover {
    background-color: #f8d7da !important;
}

/* Admin Nav Specific (admin pages) */
.admin-nav {
    margin-bottom: 30px; /* More space after admin nav */
    padding: 15px;
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}
.admin-nav strong {
    margin-right: 15px;
    color: #495057;
}

/* =================================
   Main Content Area
   ================================= */
main {
    margin-top: 0px;
}

h2 {
    font-size: 1.6em;
    color: #343a40;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
    margin-top: 30px; /* Space before sections */
    margin-bottom: 20px;
}

h2:first-child {
    margin-top: 0; /* No top margin for the very first h2 */
}

h3 {
    font-size: 1.4em;
    color: #495057;
    margin-bottom: 15px;
}

/* =================================
   Document Listing (Index Page)
   ================================= */
.category-group {
    margin-bottom: 25px; /* Space between category blocks */
    padding: 0px;
    border: 1px solid #e9ecef; /* Lighter border */
    border-radius: 5px;
    background-color: #fdfdfd; /* Very light background for category group */
}

.category-group h3 {
    margin-bottom: 10px; /* Reduced space between category title and list */
    font-size: 1.3em; /* Slightly smaller category title */
    color: #343a40;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee; /* Subtle line under category title */
}

/* --- Styles for the Document List (Modified for rapat spacing) --- */
.document-list {
    list-style: decimal;   /* Use standard bullet points */
    padding-left: 25px; /* Indent the list to make room for bullets */
    margin-top: 10px;   /* Add a little space below the category title */
}

.document-list li {
    margin-bottom: 4px; /* << KEY CHANGE: Reduced space between list items */
    padding: 2px 0;     /* << KEY CHANGE: Reduced vertical padding inside items */
    /* Optional: Lighter or no border */
    border-bottom: 1px dotted #f0f0f0; /* Very light dotted line */
    /* Uncomment below to remove the line completely */
    /* border-bottom: none; */
	    line-height: 1; /* Adjust line-height within the link if needed */

}

.document-list li:last-child {
    border-bottom: none; /* No border on the last item */
    margin-bottom: 0;   /* No margin below the last item */
}

.document-list a {
    color: #0056b3; /* Standard link blue */
    text-decoration: none;
    font-weight: normal; /* Use normal weight for less density */
    display: inline; /* Ensure link behaves as inline text */
    line-height: 1; /* Adjust line-height within the link if needed */
}

.document-list a:hover {
    text-decoration: none; font-size:120%; background-color:#CCFF33
}
/* --- End of Document List Styles --- */


/* =================================
   Forms
   ================================= */
form {
    margin-bottom: 30px; /* More space below forms */
    padding: 25px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    background-color: #f8f9fa;
}

form h3 {
    margin-top: 0; /* No top margin for heading inside form */
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}
.form-group label input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
}
.form-group input[type="checkbox"] {
     width: auto; /* Override default width for checkbox */
     margin-right: 5px;
     vertical-align: baseline;
}


.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="file"],
.form-group input[type="number"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1em;
    line-height: 1.5;
    background-color: #fff; /* Ensure white background */
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 0.875em;
    color: #6c757d;
}

/* =================================
   Buttons
   ================================= */
button[type="submit"], .btn {
    background-color: #007bff; /* Blue button */
    color: #ffffff;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    text-decoration: none; /* For <a> styled as button */
    display: inline-block; /* For <a> styled as button */
    margin-right: 5px; /* Space between buttons */
    line-height: 1.5;
    vertical-align: middle; /* Align buttons nicely if on same line */
}
button[type="submit"]:last-child, .btn:last-child {
    margin-right: 0;
}


button[type="submit"]:hover, .btn:hover {
    background-color: #0056b3; /* Darker blue on hover */
    text-decoration: none;
     color: #ffffff;
}

.btn-danger {
    background-color: #dc3545; /* Red button */
}
.btn-danger:hover {
    background-color: #c82333;
}

.btn-secondary {
    background-color: #6c757d; /* Grey button */
    color: #ffffff;
}
.btn-secondary:hover {
    background-color: #5a6268;
     color: #ffffff;
}


/* =================================
   Tables (Admin pages)
   ================================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #fff; /* Ensure table background is white */
}

th, td {
    padding: 12px 15px; /* Slightly more padding */
    text-align: left;
    border: 1px solid #dee2e6; /* Use border for all cells */
    vertical-align: middle; /* Align content vertically */
}

th {
    background-color: #e9ecef; /* Light grey header */
    font-weight: 600;
    color: #495057;
}

/* Remove zebra striping for a cleaner look */
/* tr:nth-child(even) {
    background-color: #f8f9fa;
} */

tr:hover {
    background-color: #f1f1f1; /* Keep subtle hover effect */
}

td a.btn {
    margin-right: 5px; /* Space between action buttons in table */
    padding: 5px 10px; /* Smaller buttons in tables */
    font-size: 0.9em;
}
td button.btn {
    margin-right: 5px; /* Space between action buttons in table */
    padding: 5px 10px; /* Smaller buttons in tables */
    font-size: 0.9em;
}

td a:not(.btn) { /* Style normal links in tables differently */
     color: #007bff;
     text-decoration: none;
}
td a:not(.btn):hover {
     text-decoration: underline;
}


/* =================================
   Messages & Alerts
   ================================= */
.message {
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: 500;
}
.message.success {
    background-color: #d4edda; /* Green success */
    color: #155724;
    border-color: #c3e6cb;
}
.message.error {
    background-color: #f8d7da; /* Red error */
    color: #721c24;
    border-color: #f5c6cb;
}
.message.info {
    background-color: #cce5ff; /* Blue info */
    color: #004085;
    border-color: #b8daff;
}

/* =================================
   Utility Classes
   ================================= */
.text-center {
    text-align: center;
}
.mt-20 {
    margin-top: 20px;
}
.mb-20 {
    margin-bottom: 20px;
}
hr {
    border: 0;
    height: 1px;
    background-color: #dee2e6;
    margin-top: 30px;
    margin-bottom: 30px;
}