/* =========================================================
   Admin Login
   ========================================================= */

.admin-login-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem;
    background: #fffaf0;
}

.admin-login {
    width: 100%;
    display: flex;
    justify-content: center;
}

.admin-login-container {
    width: 100%;
    max-width: 480px;
    padding: 3rem;
    background: #ffffff;
    border: 1px solid #d8cab5;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(31, 42, 36, 0.08);
    text-align: center;
}

.admin-login-logo {
    margin-bottom: 1rem;
}

.admin-login-logo img {
    width: 72px;
    height: 72px;
    margin: 0 auto;
}

.admin-login-eyebrow {
    margin: 0 0 0.5rem;
    color: #2f6f4e;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.admin-login-container h1 {
    margin: 0 0 0.75rem;
    color: #1f2a24;
    font-size: 2.4rem;
    font-weight: 800;
}

.admin-login-intro {
    margin: 0 0 2rem;
    color: #5c695f;
    font-size: 1rem;
}

.admin-login-form {
    text-align: left;
}

.form-field {
    margin-bottom: 1.25rem;
}

.form-field label {
    display: block;
    margin-bottom: 0.5rem;
    color: #1f2a24;
    font-weight: 700;
}

.admin-input {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1rem;
    border: 1px solid #cfc2ae;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2a24;
    font-size: 1rem;
    box-sizing: border-box;
}

.admin-input:focus {
    border-color: #2f6f4e;
    outline: 3px solid rgba(47, 111, 78, 0.15);
}

.admin-login-button {
    width: 100%;
    min-height: 50px;
    margin-top: 0.5rem;
    border: 2px solid #214f38;
    border-radius: 6px;
    background: #2f6f4e;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.admin-login-button:hover,
.admin-login-button:focus {
    background: #214f38;
}

.admin-login-back {
    margin-top: 1.5rem;
}

.admin-back-link {
    color: #214f38;
    font-weight: 700;
    text-decoration: none;
}

.admin-back-link:hover {
    text-decoration: underline;
}


/* =========================================================
   Admin Portal Layout
   ========================================================= */

body.admin-layout {
    margin: 0;
    background: #fffaf0;
    color: #1f2a24;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}


/* =========================================================
   Admin Sidebar
   ========================================================= */

.admin-sidebar {
    width: 240px;
    min-height: 100vh;
    padding: 30px 20px;
    background: #2f6f4e;
    border-right: 1px solid #214f38;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.admin-brand {
    margin-bottom: 40px;
    padding: 0 10px;
}

.admin-brand h2 {
    margin: 0;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 800;
}

.admin-brand span {
    display: block;
    margin-top: 5px;
    color: #e8f1eb;
    font-size: 0.85rem;
}


/* =========================================================
   Admin Navigation
   ========================================================= */

.admin-navigation {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-nav-link {
    display: block;
    padding: 12px 15px;
    border-radius: 6px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
}

.admin-nav-link:hover,
.admin-nav-link:focus {
    background: #214f38;
    color: #ffffff;
}


/* =========================================================
   Admin Logout
   ========================================================= */

.admin-sidebar-footer {
    margin-top: auto;
}

.admin-logout-link {
    display: block;
    padding: 12px 15px;
    border-radius: 6px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
}

.admin-logout-link:hover,
.admin-logout-link:focus {
    background: #214f38;
    color: #ffffff;
}


/* =========================================================
   Admin Main Content
   ========================================================= */

.admin-main {
    flex: 1;
    min-width: 0;
    padding: 40px;
    background: #fffaf0;
    box-sizing: border-box;
}

.admin-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #d8cab5;
}

.admin-header h1 {
    margin: 0;
    color: #1f2a24;
    font-size: 2rem;
    font-weight: 800;
}

.admin-content {
    width: 100%;
    max-width: 1400px;
}

.admin-content p {
    color: #5c695f;
    font-size: 1rem;
    line-height: 1.6;
}
/* =========================================================
   Flash Messages
   ========================================================= */

.message {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 1rem;
    line-height: 1.5;
}

.message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* =========================================================
   Dashboard Cards
   ========================================================= */

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 25px;
}

.admin-card {
    padding: 25px;
    background: #ffffff;
    border: 1px solid #d8cab5;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(31, 42, 36, 0.05);
}

.admin-card h2 {
    margin: 0 0 10px;
    color: #1f2a24;
    font-size: 1.2rem;
}

.admin-card p {
    margin: 0 0 15px;
    color: #5c695f;
}

.admin-card-link {
    color: #2f6f4e;
    font-weight: 700;
    text-decoration: none;
}

.admin-card-link:hover,
.admin-card-link:focus {
    color: #214f38;
    text-decoration: underline;
}


/* =========================================================
   Admin Tables
   ========================================================= */

.admin-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #d8cab5;
    border-radius: 8px;
}

.admin-table th {
    padding: 14px 16px;
    background: #2f6f4e;
    color: #ffffff;
    text-align: left;
    font-weight: 700;
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e4ddd2;
    color: #1f2a24;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: #f5f1e9;
}


/* =========================================================
   Enquiries Table
   ========================================================= */

.enquiries-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #d8cab5;
    border-radius: 8px;
    overflow: hidden;
}

.enquiries-table th {
    padding: 14px 18px;
    background: #2f6f4e;
    color: #ffffff;
    text-align: left;
    font-weight: 700;
    white-space: nowrap;
}

.enquiries-table td {
    padding: 16px 18px;
    border-bottom: 1px solid #e4ddd2;
    color: #1f2a24;
    vertical-align: top;
    white-space: nowrap;
}

.enquiries-table tr:last-child td {
    border-bottom: none;
}

.enquiries-table tr:hover td {
    background: #f5f1e9;
}


/* Enquiries column widths */

.enquiries-table th:nth-child(1),
.enquiries-table td:nth-child(1) {
    width: 15%;
}

.enquiries-table th:nth-child(2),
.enquiries-table td:nth-child(2) {
    width: 20%;
}

.enquiries-table th:nth-child(3),
.enquiries-table td:nth-child(3) {
    width: 15%;
}

.enquiries-table th:nth-child(4),
.enquiries-table td:nth-child(4) {
    width: 30%;
}

.enquiries-table th:nth-child(5),
.enquiries-table td:nth-child(5) {
    width: 10%;
    white-space: nowrap;
}

.enquiries-table th:nth-child(6),
.enquiries-table td:nth-child(6) {
    width: 10%;
    white-space: nowrap;
}


/* =========================================================
   Admin Buttons
   ========================================================= */

.admin-button {
    display: inline-block;
    padding: 10px 18px;
    border: 2px solid #214f38;
    border-radius: 6px;
    background: #2f6f4e;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.admin-button:hover,
.admin-button:focus {
    background: #214f38;
    color: #ffffff;
}

.admin-button-secondary {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid #cfc2ae;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2a24;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.admin-button-secondary:hover,
.admin-button-secondary:focus {
    background: #f5f1e9;
}


/* =========================================================
   Forms inside Admin Portal
   ========================================================= */

.admin-form-field {
    margin-bottom: 20px;
}

.admin-form-field label {
    display: block;
    margin-bottom: 7px;
    color: #1f2a24;
    font-weight: 700;
}

.admin-form-field input,
.admin-form-field textarea,
.admin-form-field select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cfc2ae;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2a24;
    font-size: 1rem;
    box-sizing: border-box;
}

.admin-form-field input:focus,
.admin-form-field textarea:focus,
.admin-form-field select:focus {
    border-color: #2f6f4e;
    outline: 3px solid rgba(47, 111, 78, 0.15);
}

/* =========================================================
   Enquiry Filters
   ========================================================= */


.enquiry-filters {
    margin-bottom: 24px;
}

.filter-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Subject and Status rows */
.filter-field {
    margin: 0;
}

.filter-field .input {
    display: flex;
    align-items: center;
    margin: 0;
}

.filter-field label {
    width: 80px;
    flex: 0 0 80px;
    margin: 0 10px 0 0;
}

.filter-field select {
    width: 180px;
    margin: 0;
}

/* Date + Filter + Clear row */
.filter-date-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.filter-date-row .filter-field {
    display: flex;
    align-items: center;
}

.filter-date-row .filter-field .input {
    display: flex;
    align-items: center;
}

.filter-date-row .filter-field label {
    margin: 0 10px 0 0;
}

.filter-date-row input[type="date"] {
    width: 180px;
    margin: 0;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-actions .button {
    margin: 0;
}

/* =========================================================
   Responsive Design
   ========================================================= */

@media (max-width: 900px) {
    .admin-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .admin-container {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid #214f38;
    }

    .admin-navigation {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .admin-sidebar-footer {
        margin-top: 20px;
    }

    .admin-main {
        padding: 25px 20px;
    }

    .admin-dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Allow the enquiries table to scroll horizontally */
    .enquiries-table {
        min-width: 900px;
    }

    .admin-content {
        overflow-x: auto;
    }
}

@media (max-width: 560px) {

    .admin-login-page {
        padding: 2rem 1rem;
    }

    .admin-login-container {
        padding: 2rem 1.25rem;
    }

    .admin-login-container h1 {
        font-size: 2rem;
    }

    .admin-main {
        padding: 20px 15px;
    }

    .admin-header h1 {
        font-size: 1.6rem;
    }

    .password-field {
        margin-bottom: 20px;
    }

    .password-field label {
        display: block;
        margin-bottom: 6px;
    }

    .password-input {
        position: relative;
        width: 100%;
    }

    .password-input input {
        width: 100%;
        box-sizing: border-box;
        padding-right: 45px;
    }

    .password-input .password-toggle {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);

        color: #0066cc !important;
        cursor: pointer;
        font-size: 18px;
        line-height: 1;

        border: none;
        background: transparent;
        padding: 0;
        margin: 0;

        user-select: none;
    }

    .password-input .password-toggle:hover {
        color: #0066cc !important;
        text-decoration: underline !important;
    }


}
