/* File: /assets/css/style.css */
/* Main stylesheet for the Application Portal */
/* Version: 1.9 - Final Login Page Layout Fix */

/* --- General Body & Layout --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    padding: 0;
    margin: 0;
    background-color: #f9f9f9;
    line-height: 1.6;
}

.content-wrapper {
    padding: 20px;
    max-width: 1200px;
    margin: auto;
    margin-top: 90px;
    padding-bottom: 80px;
}

/* --- Login & Install Page Specifics --- */
.install-page-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    margin-top: 0;
}

/* MODIFIED: The login page body no longer needs special alignment rules. */
.login-page-body {
    padding: 0;
    margin: 0;
}

/* MODIFIED: Removed 'display: inline-block'. The 'margin: auto' now correctly centers the form. */
.login-wrapper {
    background-color: #fff;
    padding: 40px 30px; 
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 380px;
    text-align: center;
    margin: 10vh auto 0 auto; /* Top margin, auto for left/right, no bottom margin */
}

.installer-container {
    max-width: 700px;
    margin: 40px auto;
}

#loginLogo {
    display: block;
    margin: 0 auto 20px auto;
    max-width: 180px;
    height: auto;
}

.login-wrapper h2, h1.page-main-title, h2.page-main-title, h3.page-main-title {
    text-align: center;
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.8em;
}

h3.page-main-title {
    font-size: 1.5em;
}

.login-wrapper p.login-notice {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 20px;
}

/* --- Headers and Banners --- */
/* ... (The rest of the file is identical to the last version) ... */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #343a40;
    color: #fff;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    box-sizing: border-box;
    height: 70px;
}

.site-header .site-title {
    font-size: 1.2em;
    font-weight: bold;
    white-space: nowrap;
}
.site-header .site-title a {
    color: #fff;
    text-decoration: none;
}

/* --- Tab Navigation in Header --- */
.header-tabs {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    height: 100%;
}
.header-tabs ul {
    display: flex;
    list-style-type: none;
    margin: 0;
    padding: 0;
    height: 100%;
}
.header-tabs li a {
    display: flex;
    align-items: center;
    color: #adb5bd;
    text-align: center;
    padding: 0 20px;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    height: 100%;
    border-bottom: 4px solid transparent;
    font-weight: normal;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}
.header-tabs li a:visited {
    color: #adb5bd;
}
.header-tabs li a:hover {
    color: #fff;
    background-color: #495057;
}
.header-tabs li.active a,
.header-tabs li.active a:visited {
    color: #fff;
    border-bottom-color: #007bff;
    cursor: default;
}
.header-tabs li.active a:hover {
    background-color: transparent;
}


/* --- Forms & Inputs --- */
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    text-align: left;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
}
.form-group input[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* --- Buttons --- */
input[type="submit"], .btn {
    display: inline-block;
    text-decoration: none;
    background-color: #007bff;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.2s ease-in-out;
}
input[type="submit"]:hover, .btn:hover {
    background-color: #0056b3;
    color: white;
}
.btn-success { background-color: #28a745; }
.btn-success:hover { background-color: #218838; }
.btn-secondary { background-color: #6c757d; }
.btn-secondary:hover { background-color: #5a6268; }
.btn-danger { background-color: #dc3545; }
.btn-danger:hover { background-color: #c82333; }


/* --- Message Boxes --- */
.form-group .help-block { color: red; font-size: 0.9em; margin-top: 5px; text-align: left; }
.form-group .info-block { color: #666; font-size: 0.85em; margin-top: 3px; }
.error-message, .success-message, .notice-message, .warning, .alert {
    text-align: center;
    margin: 15px 0;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid;
}
.error-message, .alert-danger { color: #D8000C; background-color: #FFBABA; border-color: #D8000C;}
.success-message, .alert-success { color: #4F8A10; background-color: #DFF2BF; border-color: #4F8A10;}
.notice-message { color: #856404; background-color: #fff3cd; border-color: #ffeeba; }
.warning { color: #9F6000; background-color: #FEEFB3; }


/* --- Tables --- */
.users-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.users-table th, .users-table td {
    border: 1px solid #ddd;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.9em;
}
.users-table thead {
    background-color: #f2f2f2;
    font-weight: bold;
}
.users-table tbody tr:nth-child(even) { background-color: #f9f9f9; }
.users-table tbody tr:hover { background-color: #f1f1f1; }

/* --- User Level & Action Specific Styles --- */
.level-super-admin { color: #dc3545; font-weight: bold; }
.level-admin { color: #ffc107; font-weight: bold; }
.level-user { color: #28a745; }
.level-blocked { color: #6c757d; text-decoration: line-through; }
.action-links a { margin-right: 15px; text-decoration: none; color: #007bff; white-space: nowrap; }
.action-links a:hover { text-decoration: underline; }
.link-danger { color: #dc3545 !important; }
.link-danger:hover { color: #c82333 !important; }
.action-links .permission-notice { color: #6c757d; font-style: italic; white-space: nowrap;}

/* --- Page Header Dropdown --- */
.user-info { display: flex; align-items: center; }
.user-info span { margin-right: 15px; }
.dropdown { position: relative; display: inline-block; }
.dropdown-button {
    background-color: #495057;
    color: white;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}
.dropdown-button:hover { background-color: #6c757d; }
.dropdown-button img {
    width: 24px;
    height: 24px;
}
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #f1f1f1;
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 4px;
    overflow: hidden;
}
.dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; font-size: 0.9em; }
.dropdown-content a:hover { background-color: #ddd; }
.dropdown:hover .dropdown-content { display: block; }

/* --- Site Settings Page Specifics --- */
.logo-preview {
    text-align: center;
    padding: 10px;
    border: 1px dashed #ccc;
    border-radius: 5px;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* --- Footer Links --- */
.nav-links-footer {
    width: 100%;
    text-align: center;
    background-color: #f9f9f9; 
    padding: 20px 0;
    border-top: 1px solid #eee;
    margin: 40px 0 1cm 0;
}
.nav-links-footer a { color: #007bff; text-decoration: none; margin: 0 10px; }
.nav-links-footer a:hover { text-decoration: underline; }

/* --- Manage User Page --- */
.input-with-button { display: flex; }
.input-with-button input { flex-grow: 1; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-with-button button { border-top-left-radius: 0; border-bottom-left-radius: 0; }

fieldset { border: 1px solid #ddd; padding: 20px; margin-bottom: 25px; border-radius: 5px; }
legend { padding: 0 10px; font-weight: bold; color: #555; }

.checkbox-label {
    display: block;
    padding: 5px 0;
}