/* =====================================================
   CARE N CURE CLINIC
   ADMIN DASHBOARD CSS
===================================================== */


/* =====================================================
   GLOBAL RESET
===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {
    font-family: "Poppins", sans-serif;
    background: #f4f8f7;
    color: #263a38;
    min-height: 100vh;
}


/* =====================================================
   ROOT
===================================================== */

:root {

    --primary: #164f49;
    --primary-light: #168574;
    --primary-soft: #e8f5f2;

    --success: #168574;
    --success-soft: #e8f7f2;

    --warning: #d99517;
    --warning-soft: #fff5dc;

    --danger: #d9534f;
    --danger-soft: #fdeceb;

    --text-dark: #263a38;
    --text-medium: #667875;
    --text-light: #8b9997;

    --white: #ffffff;

    --border: #e4ecea;

    --background: #f4f8f7;

    --shadow:
        0 8px 30px rgba(22, 79, 73, 0.08);

    --shadow-hover:
        0 12px 35px rgba(22, 79, 73, 0.13);

    --radius: 14px;
}


/* =====================================================
   ADMIN LAYOUT
===================================================== */

.admin-layout {

    display: flex;

    min-height: 100vh;

    width: 100%;

}


/* =====================================================
   SIDEBAR
===================================================== */

.admin-sidebar {

    width: 255px;

    min-width: 255px;

    min-height: 100vh;

    background:
        linear-gradient(
            180deg,
            #164f49 0%,
            #123f3a 100%
        );

    color: white;

    display: flex;

    flex-direction: column;

    padding: 28px 18px;

    position: fixed;

    top: 0;

    left: 0;

    bottom: 0;

    z-index: 100;

}


/* =====================================================
   SIDEBAR BRAND
===================================================== */

.sidebar-brand {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 0 8px 30px;

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.12);

}


.sidebar-brand h1 {

    font-size: 20px;

    font-weight: 700;

    line-height: 1.2;

}


.sidebar-brand p {

    font-size: 12px;

    opacity: 0.7;

    margin-top: 3px;

}


/* =====================================================
   LOGO ICON
===================================================== */

.logo-icon {

    width: 44px;

    height: 44px;

    border-radius: 12px;

    background: rgba(255, 255, 255, 0.14);

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 27px;

    font-weight: 500;

}


/* =====================================================
   SIDEBAR MENU
===================================================== */

.sidebar-menu {

    display: flex;

    flex-direction: column;

    gap: 8px;

    margin-top: 28px;

}


.menu-item {

    text-decoration: none;

    color: rgba(255, 255, 255, 0.72);

    padding: 13px 15px;

    border-radius: 10px;

    font-size: 14px;

    font-weight: 500;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;

}


.menu-item:hover {

    background:
        rgba(255, 255, 255, 0.09);

    color: white;

    transform: translateX(2px);

}


.menu-item.active {

    background:
        rgba(255, 255, 255, 0.15);

    color: white;

}


/* =====================================================
   LOGOUT
===================================================== */

.logout-button {

    margin-top: auto;

    border: 1px solid
        rgba(255, 255, 255, 0.15);

    background:
        rgba(255, 255, 255, 0.07);

    color: white;

    border-radius: 10px;

    padding: 13px;

    font-family: inherit;

    font-size: 14px;

    font-weight: 500;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;

}


.logout-button:hover {

    background:
        rgba(255, 255, 255, 0.14);

    transform: translateY(-1px);

}


/* =====================================================
   MAIN CONTENT
===================================================== */

.admin-main {

    margin-left: 255px;

    width: calc(100% - 255px);

    min-height: 100vh;

    padding: 30px;

}


/* =====================================================
   ADMIN HEADER
===================================================== */

.admin-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 28px;

}


.admin-header h2 {

    color: var(--primary);

    font-size: 28px;

    font-weight: 700;

}


.admin-header p {

    margin-top: 5px;

    color: var(--text-medium);

    font-size: 14px;

}


/* =====================================================
   ADMIN USER
===================================================== */

.admin-user {

    background: white;

    border:
        1px solid
        var(--border);

    padding: 10px 16px;

    border-radius: 12px;

    box-shadow: var(--shadow);

    display: flex;

    align-items: center;

    gap: 8px;

    white-space: nowrap;

}


.admin-user span {

    color: var(--text-light);

    font-size: 12px;

}


.admin-user strong {

    color: var(--primary);

    font-size: 13px;

}


/* =====================================================
   DASHBOARD STATISTICS
===================================================== */

.dashboard-stats {

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;

    margin-bottom: 25px;

}


.stat-card {

    background: white;

    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 22px;

    box-shadow: var(--shadow);

    position: relative;

    overflow: hidden;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;

}


.stat-card:hover {

    transform: translateY(-2px);

    box-shadow: var(--shadow-hover);

}


.stat-card::after {

    content: "";

    position: absolute;

    left: 0;

    top: 0;

    width: 4px;

    height: 100%;

    background: var(--primary-light);

}


.stat-card.pending::after {

    background: var(--warning);

}


.stat-card.approved::after {

    background: var(--success);

}


.stat-card.rejected::after {

    background: var(--danger);

}


.stat-card span {

    display: block;

    color: var(--text-medium);

    font-size: 13px;

    font-weight: 500;

    margin-bottom: 7px;

}


.stat-card strong {

    color: var(--primary);

    font-size: 30px;

    line-height: 1;

}


/* =====================================================
   APPOINTMENTS SECTION
===================================================== */

.appointments-section {

    background: white;

    border:
        1px solid
        var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    overflow: hidden;

}


/* =====================================================
   SECTION HEADER
===================================================== */

.section-header {

    padding: 22px 24px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    border-bottom:
        1px solid
        var(--border);

}


.section-header h2 {

    color: var(--primary);

    font-size: 19px;

    font-weight: 700;

}


.section-header p {

    color: var(--text-medium);

    font-size: 13px;

    margin-top: 4px;

}


/* =====================================================
   HEADER ACTIONS
===================================================== */

.header-actions {

    display: flex;

    align-items: center;

    gap: 10px;

    flex-wrap: wrap;

}


/* =====================================================
   SELECT
===================================================== */

.header-actions select,
.records-per-page select {

    border:
        1px solid
        var(--border);

    background: white;

    color: var(--text-dark);

    border-radius: 9px;

    padding: 10px 12px;

    font-family: inherit;

    font-size: 13px;

    outline: none;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;

}


.header-actions select:focus,
.records-per-page select:focus {

    border-color:
        var(--primary-light);

    box-shadow:
        0 0 0 3px
        rgba(22, 133, 116, 0.10);

}


/* =====================================================
   REFRESH BUTTON
===================================================== */

.refresh-button {

    border: 1px solid var(--border);

    background: white;

    color: var(--primary);

    border-radius: 9px;

    padding: 10px 15px;

    font-family: inherit;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;

}


.refresh-button:hover {

    background: var(--primary-soft);

    border-color:
        var(--primary-light);

    transform: translateY(-1px);

}


/* =====================================================
   EXCEL DOWNLOAD BUTTON
===================================================== */

.download-button {

    border: none;

    background:
        linear-gradient(
            135deg,
            #168574,
            #126b5f
        );

    color: white;

    border-radius: 9px;

    padding: 10px 16px;

    font-family: inherit;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    gap: 7px;

    box-shadow:
        0 5px 15px
        rgba(22, 133, 116, 0.18);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;

}


.download-button:hover {

    transform: translateY(-1px);

    box-shadow:
        0 8px 20px
        rgba(22, 133, 116, 0.25);

}


.download-button:active {

    transform: translateY(0);

}


.download-button:disabled {

    opacity: 0.55;

    cursor: not-allowed;

    transform: none;

}


/* =====================================================
   SEARCH
===================================================== */

.appointment-search {

    padding:
        18px 24px 0;

}


.appointment-search input {

    width: 100%;

    max-width: 430px;

    border:
        1px solid
        var(--border);

    background: #fbfdfc;

    color: var(--text-dark);

    border-radius: 10px;

    padding: 11px 14px;

    font-family: inherit;

    font-size: 13px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;

}


.appointment-search input::placeholder {

    color: #9ba8a5;

}


.appointment-search input:focus {

    background: white;

    border-color:
        var(--primary-light);

    box-shadow:
        0 0 0 3px
        rgba(22, 133, 116, 0.10);

}


/* =====================================================
   TABLE CONTAINER
===================================================== */

.table-container {

    width: 100%;

    overflow-x: auto;

    margin-top: 18px;

    scrollbar-width: thin;

    scrollbar-color:
        #c5d6d2
        transparent;

}


/* =====================================================
   TABLE
===================================================== */

table {

    width: 100%;

    min-width: 850px;

    border-collapse: collapse;

    background: white;

}


thead {

    background:
        #f5f9f8;

}


th {

    color: var(--text-medium);

    font-size: 12px;

    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: 0.25px;

    text-align: left;

    padding: 14px 12px;

    border-bottom:
        1px solid
        var(--border);

    white-space: nowrap;

}


td {

    color: var(--text-dark);

    font-size: 13px;

    padding: 15px 12px;

    border-bottom:
        1px solid
        #edf2f1;

    vertical-align: middle;

}


tbody tr {

    transition:
        background 0.15s ease;

}


tbody tr:hover {

    background:
        #f8fbfa;

}


tbody tr:last-child td {

    border-bottom: none;

}


/* =====================================================
   PATIENT NAME
===================================================== */

td:first-child {

    font-weight: 600;

    color: var(--primary);

}


/* =====================================================
   STATUS BADGES
===================================================== */

.status-badge {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding: 5px 10px;

    border-radius: 20px;

    font-size: 11px;

    font-weight: 600;

    white-space: nowrap;

}


.status-badge.pending {

    background:
        var(--warning-soft);

    color:
        #a86f00;

}


.status-badge.approved {

    background:
        var(--success-soft);

    color:
        #137563;

}


.status-badge.rejected {

    background:
        var(--danger-soft);

    color:
        #c33d39;

}


/* =====================================================
   APPOINTMENT ACTIONS
===================================================== */

.appointment-actions {

    display: flex;

    align-items: center;

    gap: 7px;

}


.approve-button,
.reject-button {

    border: none;

    border-radius: 7px;

    padding: 7px 10px;

    font-family: inherit;

    font-size: 11px;

    font-weight: 600;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease;

}


.approve-button:hover,
.reject-button:hover {

    transform: translateY(-1px);

}


.approve-button {

    background:
        var(--success-soft);

    color:
        #137563;

}


.reject-button {

    background:
        var(--danger-soft);

    color:
        #c33d39;

}


.approve-button:disabled,
.reject-button:disabled {

    opacity: 0.5;

    cursor: not-allowed;

    transform: none;

}


.action-complete {

    color: var(--text-light);

    font-size: 11px;

    font-weight: 500;

}


/* =====================================================
   EMPTY / ERROR / LOADING TABLE ROW
===================================================== */

.empty-row,
.error-row,
.loading-row {

    text-align: center;

    padding: 35px 20px;

    color: var(--text-medium);

}


.loading-row {

    color: var(--primary-light);

}


.error-row {

    color: var(--danger);

}


/* =====================================================
   PAGINATION CONTAINER
===================================================== */

.pagination-container {

    display: grid;

    grid-template-columns:
        1fr auto 1fr;

    align-items: center;

    gap: 20px;

    padding:
        18px 24px;

    border-top:
        1px solid
        var(--border);

    background:
        #fbfdfc;

}


/* =====================================================
   PAGINATION INFO
===================================================== */

.pagination-info {

    color: var(--text-medium);

    font-size: 12px;

    white-space: nowrap;

}


/* =====================================================
   PAGINATION CONTROLS
===================================================== */

.pagination-controls {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 6px;

}


.pagination-button {

    border:
        1px solid
        var(--border);

    background: white;

    color: var(--primary);

    min-height: 36px;

    padding:
        0 12px;

    border-radius: 8px;

    font-family: inherit;

    font-size: 12px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        opacity 0.2s ease;

}


.pagination-button:hover:not(:disabled) {

    background:
        var(--primary-soft);

    border-color:
        var(--primary-light);

}


.pagination-button:disabled {

    opacity: 0.45;

    cursor: not-allowed;

}


/* =====================================================
   PAGE NUMBERS
===================================================== */

.page-numbers {

    display: flex;

    align-items: center;

    gap: 4px;

}


.page-button {

    min-width: 34px;

    height: 34px;

    border:
        1px solid
        var(--border);

    background: white;

    color: var(--text-medium);

    border-radius: 8px;

    font-family: inherit;

    font-size: 12px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;

}


.page-button:hover {

    background:
        var(--primary-soft);

    color: var(--primary);

    border-color:
        var(--primary-light);

}


.page-button.active {

    background:
        var(--primary);

    color: white;

    border-color:
        var(--primary);

}


/* =====================================================
   PAGINATION ELLIPSIS
===================================================== */

.page-ellipsis {

    min-width: 25px;

    text-align: center;

    color: var(--text-light);

    font-size: 13px;

}


/* =====================================================
   RECORDS PER PAGE
===================================================== */

.records-per-page {

    display: flex;

    align-items: center;

    justify-content: flex-end;

    gap: 7px;

    color: var(--text-medium);

    font-size: 12px;

    white-space: nowrap;

}


.records-per-page select {

    padding:
        8px 10px;

}


/* =====================================================
   LOADING OVERLAY
===================================================== */

.admin-loading-overlay {

    position: fixed;

    inset: 0;

    background:
        rgba(17, 51, 47, 0.28);

    backdrop-filter: blur(3px);

    display: flex;

    align-items: center;

    justify-content: center;

    z-index: 9999;

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;

}


.admin-loading-overlay.show {

    opacity: 1;

    visibility: visible;

    pointer-events: all;

}


.admin-loading-card {

    background: white;

    border-radius: 14px;

    padding: 25px 30px;

    min-width: 220px;

    text-align: center;

    box-shadow:
        0 20px 50px
        rgba(0, 0, 0, 0.16);

}


.admin-loading-card p {

    margin-top: 12px;

    color: var(--primary);

    font-size: 13px;

    font-weight: 600;

}


/* =====================================================
   LOADING SPINNER
===================================================== */

.loading-spinner {

    width: 36px;

    height: 36px;

    margin: auto;

    border:
        3px solid
        #dcebe8;

    border-top-color:
        var(--primary-light);

    border-radius: 50%;

    animation:
        adminSpin 0.8s linear infinite;

}


@keyframes adminSpin {

    to {

        transform: rotate(360deg);

    }

}


/* =====================================================
   FOCUS ACCESSIBILITY
===================================================== */

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {

    outline:
        3px solid
        rgba(22, 133, 116, 0.25);

    outline-offset: 2px;

}


/* =====================================================
   DISABLED ELEMENTS
===================================================== */

button:disabled {

    cursor: not-allowed;

}


/* =====================================================
   SCROLLBAR
===================================================== */

.table-container::-webkit-scrollbar {

    height: 7px;

}


.table-container::-webkit-scrollbar-track {

    background: transparent;

}


.table-container::-webkit-scrollbar-thumb {

    background:
        #c5d6d2;

    border-radius: 20px;

}


.table-container::-webkit-scrollbar-thumb:hover {

    background:
        #9dbab4;

}



/* =====================================================
   GLOBAL UI / FORM IMPROVEMENTS
   ===================================================== */

html,
body {
    width: 100%;
    overflow-x: hidden;
}

button,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button,
a,
select,
input {
    touch-action: manipulation;
}

input,
select,
button {
    min-height: 42px;
}

button {
    -webkit-appearance: none;
    appearance: none;
}

::selection {
    background: rgba(22, 133, 116, 0.18);
    color: var(--text-dark);
}

/* Prevent long values from breaking layouts */
.admin-user,
.admin-header,
.section-header,
.pagination-container,
.stat-card,
.appointments-section {
    min-width: 0;
}

img,
svg {
    max-width: 100%;
}

/* =====================================================
   RESPONSIVE — 1000px
===================================================== */

@media (max-width: 1000px) {

    .dashboard-stats {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

    }


    .pagination-container {

        grid-template-columns:
            1fr;

        justify-items: center;

    }


    .pagination-info {

        order: 1;

    }


    .pagination-controls {

        order: 2;

    }


    .records-per-page {

        order: 3;

        justify-content: center;

    }

}


/* =====================================================
   RESPONSIVE — 760px
===================================================== */

@media (max-width: 760px) {

    .admin-sidebar {

        width: 100%;

        min-width: 0;

        min-height: auto;

        height: auto;

        position: relative;

        padding: 16px;

    }


    .admin-layout {

        display: block;

    }


    .sidebar-brand {

        padding-bottom: 16px;

    }


    .sidebar-menu {

        flex-direction: row;

        margin-top: 15px;

    }


    .menu-item {

        flex: 1;

        text-align: center;

    }


    .logout-button {

        margin-top: 15px;

    }


    .admin-main {

        width: 100%;

        margin-left: 0;

        padding: 20px 15px;

    }


    .admin-header {

        align-items: flex-start;

        flex-direction: column;

    }


    .admin-user {

        width: 100%;

        justify-content: space-between;

    }


    .section-header {

        align-items: flex-start;

        flex-direction: column;

    }


    .header-actions {

        width: 100%;

    }


    .header-actions select,
    .header-actions button {

        flex: 1;

    }


    .appointment-search {

        padding:
            15px 18px 0;

    }


    .appointment-search input {

        max-width: none;

    }


    .pagination-container {

        padding:
            16px;

    }

}


/* =====================================================
   RESPONSIVE — 500px
===================================================== */

@media (max-width: 500px) {

    .dashboard-stats {

        grid-template-columns:
            1fr;

    }


    .admin-main {

        padding:
            15px 10px;

    }


    .admin-header h2 {

        font-size: 23px;

    }


    .admin-header p {

        font-size: 12px;

    }


    .admin-user {

        align-items: flex-start;

        flex-direction: column;

        gap: 2px;

    }


    .section-header {

        padding:
            18px;

    }


    .section-header h2 {

        font-size: 17px;

    }


    .header-actions {

        display: grid;

        grid-template-columns:
            1fr 1fr;

        width: 100%;

    }


    .header-actions select {

        grid-column:
            1 / -1;

    }


    .header-actions button {

        width: 100%;

    }


    .download-button {

        padding:
            10px 8px;

    }


    .pagination-controls {

        width: 100%;

        flex-wrap: wrap;

    }


    .page-numbers {

        max-width: 100%;

        overflow-x: auto;

        padding-bottom: 3px;

    }


    .pagination-button {

        flex-shrink: 0;

    }


    .stat-card {

        padding: 18px;

    }


    .stat-card strong {

        font-size: 27px;

    }

}


/* =====================================================
   PRINT
===================================================== */

@media print {

    .admin-sidebar,
    .admin-header,
    .header-actions,
    .appointment-search,
    .pagination-container,
    .appointment-actions,
    .logout-button {

        display: none !important;

    }


    .admin-main {

        margin: 0;

        width: 100%;

        padding: 0;

    }


    .appointments-section {

        box-shadow: none;

        border: none;

    }


    table {

        min-width: 0;

    }

}


/* =========================================================
   CARE N CURE — ADMIN LOGIN PAGE
   FINAL CONSOLIDATED LOGIN STYLES
   ========================================================= */

/*
   IMPORTANT:
   This section intentionally replaces the previous login rules.
   It prevents the branding and login form from overlapping and
   keeps the page responsive on desktop, tablet and mobile.

   Supported structures:
   .login-page
   .login-container / .login-wrapper
   .login-brand
   .login-info
   .login-card
   .login-card-header
   .login-form
*/


/* =========================================================
   LOGIN PAGE BACKGROUND
   ========================================================= */

body.login-page {
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;

    overflow-x: hidden;

    background:
        radial-gradient(
            circle at 8% 8%,
            rgba(22, 133, 116, 0.08),
            transparent 30%
        ),
        radial-gradient(
            circle at 92% 92%,
            rgba(22, 79, 73, 0.06),
            transparent 32%
        ),
        linear-gradient(
            135deg,
            #f4faf8 0%,
            #edf7f4 50%,
            #f8fbfa 100%
        );
}


/*
   If .login-page is a wrapper instead of a body class.
*/
div.login-page,
main.login-page,
section.login-page {
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px 20px;

    box-sizing: border-box;

    overflow-x: hidden;

    background:
        radial-gradient(
            circle at 8% 8%,
            rgba(22, 133, 116, 0.08),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #f4faf8 0%,
            #edf7f4 50%,
            #f8fbfa 100%
        );
}


/* =========================================================
   LOGIN CONTAINER
   ========================================================= */

.login-container,
.login-wrapper {
    position: relative;

    z-index: 1;

    width: min(1080px, 100%);

    min-height: 620px;

    margin: 0 auto;

    display: grid;

    /*
       Fixed proportional columns prevent the right panel
       from moving over the branding content.
    */
    grid-template-columns: minmax(0, 48%) minmax(0, 52%);

    align-items: stretch;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid #dcebe7;

    border-radius: 24px;

    box-shadow:
        0 24px 65px rgba(22, 79, 73, 0.10),
        0 5px 20px rgba(22, 79, 73, 0.04);

    box-sizing: border-box;
}


/*
   Prevent children from creating a grid overflow.
*/
.login-container > *,
.login-wrapper > * {
    min-width: 0;
    max-width: 100%;
}


/* =========================================================
   LEFT BRANDING PANEL
   ========================================================= */

.login-brand {
    position: relative;

    min-width: 0;
    min-height: 620px;

    display: flex;
    flex-direction: column;

    align-items: flex-start;
    justify-content: center;

    padding: 58px;

    overflow: hidden;

    box-sizing: border-box;

    background:
        linear-gradient(
            145deg,
            #e9f7f3 0%,
            #e2f3ef 55%,
            #d9eee9 100%
        );

    color: #164f49;

    text-align: left;
}


/* Decorative circles — subtle only */

.login-brand::before,
.login-brand::after {
    content: "";

    position: absolute;

    z-index: 0;

    border-radius: 50%;

    pointer-events: none;

    border: 1px solid rgba(22, 79, 73, 0.06);
}

.login-brand::before {
    width: 300px;
    height: 300px;

    right: -170px;
    top: -150px;

    box-shadow:
        0 0 0 35px rgba(22, 79, 73, 0.018),
        0 0 0 70px rgba(22, 79, 73, 0.012);
}

.login-brand::after {
    width: 220px;
    height: 220px;

    left: -130px;
    bottom: -130px;
}


/* =========================================================
   BRAND LOGO ICON
   ========================================================= */

.login-brand .login-logo {
    position: relative;
    z-index: 2;

    flex: 0 0 auto;

    width: 58px;
    height: 58px;

    margin: 0 0 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;

    border: 1px solid #cfe5df;

    border-radius: 15px;

    color: #168574;

    font-size: 28px;
    font-weight: 700;

    line-height: 1;

    box-shadow:
        0 8px 22px rgba(22, 79, 73, 0.08);

    box-sizing: border-box;
}


/*
   Only target a logo icon when it is directly used as the
   branding icon. This avoids changing the global .logo-icon.
*/
.login-brand > .logo-icon {
    position: relative;
    z-index: 2;

    flex: 0 0 auto;

    width: 58px;
    height: 58px;

    margin: 0 0 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;

    border: 1px solid #cfe5df;

    border-radius: 15px;

    color: #168574;

    font-size: 28px;
    font-weight: 700;

    line-height: 1;

    box-shadow:
        0 8px 22px rgba(22, 79, 73, 0.08);

    box-sizing: border-box;
}


/* =========================================================
   CARE N CURE BRAND TITLE
   ========================================================= */

/*
   This is the main fix for the screenshot:
   - controlled font size
   - no absolute positioning
   - no transform
   - no float
   - no overflow into the login panel
   - normal wrapping
 */

.login-brand h1,
.login-brand h2,
.login-brand .brand-title,
.login-brand .logo-text {
    position: relative;

    z-index: 2;

    display: block;

    width: 100%;
    max-width: 430px;

    margin: 0 !important;
    padding: 0 !important;

    float: none !important;

    transform: none !important;

    color: #164f49;

    font-family: "Poppins", sans-serif;

    font-size: clamp(38px, 4.2vw, 54px) !important;

    font-weight: 750;

    line-height: 1.08 !important;

    letter-spacing: -1.5px;

    text-align: left;

    white-space: normal;

    overflow-wrap: normal;

    word-break: normal;

    text-shadow: none;
}


/*
   If the title has spans, keep them inline unless the HTML
   explicitly needs separate lines.
*/
.login-brand h1 span,
.login-brand h2 span,
.login-brand .brand-title span,
.login-brand .logo-text span {
    position: static;

    display: inline;

    margin: 0;
    padding: 0;

    font: inherit;

    color: inherit;

    line-height: inherit;
}


/*
   If the HTML uses a dedicated plus element, keep it small.
*/
.login-brand .plus,
.login-brand .plus-icon,
.login-brand .logo-plus {
    position: static;

    display: inline-flex;

    width: auto;
    height: auto;

    margin: 0 5px;

    padding: 0;

    background: transparent;

    border: 0;

    color: #168574;

    font-size: 0.45em;
    font-weight: 700;

    line-height: 1;

    vertical-align: middle;

    box-shadow: none;
}


/* =========================================================
   CLINIC ADMINISTRATION / BRAND DESCRIPTION
   ========================================================= */

.login-brand p,
.login-brand .brand-subtitle,
.login-brand .clinic-subtitle {
    position: relative;

    z-index: 2;

    display: block;

    width: 100%;
    max-width: 430px;

    margin: 16px 0 0 !important;
    padding: 0 !important;

    float: none !important;

    transform: none !important;

    color: #55716c;

    font-family: "Poppins", sans-serif;

    font-size: 14px !important;

    font-weight: 400;

    line-height: 1.7 !important;

    text-align: left;

    white-space: normal;

    overflow-wrap: break-word;
}


/*
   If "Clinic Administration" is rendered as a heading,
   keep it visually subordinate to Care n Cure.
*/
.login-brand .brand-subtitle,
.login-brand .clinic-subtitle {
    font-size: 16px !important;
    font-weight: 600;
    color: #41645e;
}


/* =========================================================
   BRAND BENEFITS
   ========================================================= */

.login-benefits {
    position: relative;

    z-index: 2;

    width: 100%;
    max-width: 430px;

    margin: 28px 0 0;

    display: flex;
    flex-direction: column;

    gap: 11px;
}

.login-benefit {
    display: flex;
    align-items: center;

    min-width: 0;

    gap: 10px;

    color: #41645e;

    font-size: 13px;

    line-height: 1.45;
}

.login-benefit::before {
    content: "✓";

    width: 24px;
    height: 24px;

    flex: 0 0 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;

    border: 1px solid #cfe5df;

    border-radius: 50%;

    color: #168574;

    font-size: 12px;
    font-weight: 700;
}


/* =========================================================
   RIGHT LOGIN PANEL
   ========================================================= */

.login-info {
    position: relative;

    min-width: 0;
    min-height: 620px;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    padding: 58px;

    background: #ffffff;

    box-sizing: border-box;

    overflow: hidden;
}


/*
   Keep login content inside the right grid column.
*/
.login-card {
    position: relative;

    width: 100%;
    max-width: 430px;

    margin: 0 auto;

    min-width: 0;

    box-sizing: border-box;
}


/* =========================================================
   LOGIN HEADER
   ========================================================= */

.login-card-header {
    position: relative;

    width: 100%;

    margin: 0 0 28px;

    padding: 0;

    box-sizing: border-box;
}

.login-card-header h1,
.login-card-header h2,
.login-title {
    position: relative;

    display: block;

    width: 100%;

    margin: 0 0 8px !important;
    padding: 0 !important;

    float: none !important;

    transform: none !important;

    color: #164f49;

    font-family: "Poppins", sans-serif;

    font-size: 30px !important;

    font-weight: 700;

    line-height: 1.2 !important;

    letter-spacing: -0.5px;

    text-align: left;

    white-space: normal;
}

.login-card-header p,
.login-subtitle {
    position: relative;

    display: block;

    width: 100%;

    margin: 0 !important;
    padding: 0 !important;

    float: none !important;

    transform: none !important;

    color: #6a7f7b;

    font-size: 13px !important;

    line-height: 1.6 !important;

    text-align: left;
}


/* =========================================================
   LOGIN FORM
   ========================================================= */

.login-form {
    position: relative;

    width: 100%;
    max-width: 100%;

    margin: 0;
    padding: 0;

    box-sizing: border-box;
}

.login-form-group,
.login-form .form-group {
    position: relative;

    width: 100%;

    margin: 0 0 20px;
    padding: 0;

    box-sizing: border-box;
}

.login-form-group label,
.login-form .form-group label {
    display: block;

    width: 100%;

    margin: 0 0 8px;
    padding: 0;

    color: #173f3a;

    font-size: 13px;
    font-weight: 650;

    line-height: 1.4;

    text-align: left;
}


/* =========================================================
   INPUTS
   ========================================================= */

.login-input-wrapper,
.login-password-wrapper {
    position: relative;

    width: 100%;

    min-width: 0;
}

.login-form input,
.login-input,
.login-form .form-group input[type="text"],
.login-form .form-group input[type="email"],
.login-form .form-group input[type="password"],
input.login-input {
    display: block;

    width: 100%;

    min-width: 0;

    min-height: 58px;

    margin: 0;
    padding: 0 17px;

    box-sizing: border-box;

    border: 1px solid #dce8e5;

    border-radius: 13px;

    outline: none;

    background: #fbfdfc;

    color: #263a38;

    font-family: "Poppins", sans-serif;

    font-size: 14px;

    line-height: 1.4;

    box-shadow: none;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.login-form input::placeholder,
.login-input::placeholder {
    color: #91a39f;

    opacity: 1;
}

.login-form input:hover,
.login-input:hover {
    background: #ffffff;

    border-color: #c8d9d5;
}

.login-form input:focus,
.login-input:focus,
.login-form .form-group input:focus {
    background: #ffffff;

    border-color: #168574;

    box-shadow:
        0 0 0 4px rgba(22, 133, 116, 0.09);
}


/* =========================================================
   PASSWORD TOGGLE
   ========================================================= */

.login-password-wrapper input,
.login-input-wrapper input[type="password"] {
    padding-right: 52px;
}

.password-toggle,
.toggle-password,
.login-password-toggle {
    position: absolute;

    top: 50%;
    right: 8px;

    z-index: 3;

    width: 38px;
    height: 38px;

    min-width: 38px;
    min-height: 38px;

    margin: 0;
    padding: 0;

    transform: translateY(-50%);

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 0;

    border-radius: 8px;

    background: transparent;

    color: #66817b;

    font-family: inherit;

    cursor: pointer;

    box-shadow: none;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.password-toggle:hover,
.toggle-password:hover,
.login-password-toggle:hover {
    background: #edf7f4;

    color: #168574;
}


/* =========================================================
   LOGIN OPTIONS
   ========================================================= */

.login-form-options {
    width: 100%;

    margin: 1px 0 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    box-sizing: border-box;
}

.login-remember,
.remember-me {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    min-width: 0;

    color: #607570;

    font-size: 12px;

    line-height: 1.4;

    cursor: pointer;
}

.login-remember input,
.remember-me input {
    width: 16px;
    height: 16px;

    min-width: 16px;
    min-height: 16px;

    margin: 0;

    accent-color: #168574;

    cursor: pointer;
}

.forgot-password,
.login-forgot-password {
    flex: 0 0 auto;

    color: #168574;

    font-size: 12px;
    font-weight: 600;

    line-height: 1.4;

    text-decoration: none;

    white-space: nowrap;
}

.forgot-password:hover,
.login-forgot-password:hover {
    color: #164f49;

    text-decoration: underline;
}


/* =========================================================
   SIGN IN BUTTON
   ========================================================= */

.login-button,
.login-submit,
.login-form button[type="submit"] {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;

    min-height: 58px;

    margin: 0;
    padding: 13px 18px;

    box-sizing: border-box;

    border: 0;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            #168b78 0%,
            #117565 100%
        );

    color: #ffffff;

    font-family: "Poppins", sans-serif;

    font-size: 15px;

    font-weight: 700;

    line-height: 1.2;

    text-align: center;

    cursor: pointer;

    box-shadow:
        0 9px 21px rgba(22, 133, 116, 0.18);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.login-button:hover,
.login-submit:hover,
.login-form button[type="submit"]:hover {
    transform: translateY(-1px);

    filter: brightness(1.02);

    box-shadow:
        0 12px 26px rgba(22, 133, 116, 0.23);
}

.login-button:active,
.login-submit:active,
.login-form button[type="submit"]:active {
    transform: translateY(0);
}

.login-button:disabled,
.login-submit:disabled,
.login-form button[type="submit"]:disabled {
    opacity: 0.6;

    cursor: not-allowed;

    transform: none;

    box-shadow: none;
}


/* =========================================================
   LOGIN MESSAGES
   ========================================================= */

.login-error,
.login-message,
.login-success,
.form-error {
    width: 100%;

    box-sizing: border-box;

    margin: 0 0 17px;

    padding: 11px 13px;

    border-radius: 9px;

    font-size: 12px;

    line-height: 1.5;
}

.login-error,
.form-error {
    color: #b73532;

    background: #fdeceb;

    border: 1px solid #f3d0ce;
}

.login-success,
.login-message.success {
    color: #137563;

    background: #e8f7f2;

    border: 1px solid #cfeae2;
}


/* =========================================================
   LOGIN FOOTER
   ========================================================= */

.login-footer {
    width: 100%;

    margin: 21px 0 0;

    padding: 0;

    color: #8b9997;

    font-size: 12px;

    line-height: 1.6;

    text-align: center;
}

.login-footer a {
    color: #168574;

    font-weight: 600;

    text-decoration: none;
}

.login-footer a:hover {
    color: #164f49;

    text-decoration: underline;
}


/* =========================================================
   GENERIC AUTH FALLBACK
   ========================================================= */

.auth-page {
    width: 100%;

    min-height: 100vh;
    min-height: 100svh;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 24px;

    box-sizing: border-box;

    background:
        radial-gradient(
            circle at 15% 15%,
            rgba(22, 133, 116, 0.08),
            transparent 30%
        ),
        #f4f8f7;
}

.auth-card {
    width: 100%;
    max-width: 440px;

    padding: 38px;

    box-sizing: border-box;

    background: #ffffff;

    border: 1px solid #e4ecea;

    border-radius: 20px;

    box-shadow:
        0 12px 35px rgba(22, 79, 73, 0.13);
}

.auth-card h1,
.auth-card h2 {
    margin: 0 0 8px;

    color: #164f49;
}

.auth-card p {
    margin: 0;

    color: #667875;

    font-size: 13px;

    line-height: 1.6;
}


/* =========================================================
   LOGIN SAFETY OVERRIDES
   ========================================================= */

/*
   These rules prevent common global styles from causing the
   exact overlap visible in the screenshot.
*/

.login-container *,
.login-wrapper * {
    box-sizing: border-box;
}

.login-container h1,
.login-container h2,
.login-container h3,
.login-container p,
.login-wrapper h1,
.login-wrapper h2,
.login-wrapper h3,
.login-wrapper p {
    position: relative;

    float: none;

    transform: none;
}

.login-container img,
.login-wrapper img,
.login-container svg,
.login-wrapper svg {
    max-width: 100%;
}

.login-container button,
.login-wrapper button,
.login-container input,
.login-wrapper input {
    font-family: "Poppins", sans-serif;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    body.login-page {
        padding: 20px;
    }

    div.login-page,
    main.login-page,
    section.login-page {
        padding: 20px;
    }

    .login-container,
    .login-wrapper {
        width: 100%;

        min-height: 0;

        grid-template-columns: 1fr;

        border-radius: 22px;
    }

    .login-brand {
        min-height: 290px;

        padding: 42px 40px;

        align-items: center;

        text-align: center;
    }

    .login-brand h1,
    .login-brand h2,
    .login-brand .brand-title,
    .login-brand .logo-text {
        max-width: 650px;

        font-size: 44px !important;

        line-height: 1.08 !important;

        text-align: center;
    }

    .login-brand p,
    .login-brand .brand-subtitle,
    .login-brand .clinic-subtitle {
        max-width: 650px;

        margin-left: auto !important;
        margin-right: auto !important;

        text-align: center;
    }

    .login-benefits {
        max-width: 650px;

        margin-left: auto;
        margin-right: auto;

        flex-direction: row;

        justify-content: center;

        flex-wrap: wrap;
    }

    .login-info {
        min-height: 0;

        padding: 45px 40px;
    }

    .login-card {
        max-width: 500px;
    }

    .login-card-header h1,
    .login-card-header h2,
    .login-title {
        text-align: center;
    }

    .login-card-header p,
    .login-subtitle {
        text-align: center;
    }
}


/* =========================================================
   MOBILE — 600px
   ========================================================= */

@media (max-width: 600px) {

    body.login-page {
        min-height: 100svh;

        padding: 0;

        background: #f4faf8;
    }

    div.login-page,
    main.login-page,
    section.login-page {
        min-height: 100svh;

        align-items: flex-start;

        padding: 0;

        background: #f4faf8;
    }

    .login-container,
    .login-wrapper {
        width: 100%;
        max-width: none;

        min-height: 100svh;

        margin: 0;

        display: flex;
        flex-direction: column;

        border: 0;

        border-radius: 0;

        box-shadow: none;
    }

    /* ---------- BRAND ---------- */

    .login-brand {
        min-height: 225px;

        flex: 0 0 auto;

        padding: 30px 22px 28px;

        align-items: center;
        justify-content: center;

        border-radius: 0 0 24px 24px;

        text-align: center;
    }

    .login-brand::before {
        width: 220px;
        height: 220px;

        right: -135px;
        top: -120px;
    }

    .login-brand::after {
        width: 160px;
        height: 160px;

        left: -100px;
        bottom: -100px;
    }

    .login-brand .login-logo,
    .login-brand > .logo-icon {
        width: 50px;
        height: 50px;

        margin-bottom: 14px;

        border-radius: 13px;

        font-size: 24px;
    }

    .login-brand h1,
    .login-brand h2,
    .login-brand .brand-title,
    .login-brand .logo-text {
        max-width: 340px;

        font-size: 34px !important;

        line-height: 1.05 !important;

        letter-spacing: -0.9px;

        text-align: center;
    }

    .login-brand p,
    .login-brand .brand-subtitle,
    .login-brand .clinic-subtitle {
        max-width: 340px;

        margin-top: 10px !important;

        font-size: 12.5px !important;

        line-height: 1.55 !important;

        text-align: center;
    }

    .login-benefits {
        display: none;
    }


    /* ---------- LOGIN FORM ---------- */

    .login-info {
        width: 100%;

        min-height: 0;

        flex: 1 1 auto;

        padding: 30px 22px 28px;

        align-items: stretch;

        justify-content: flex-start;
    }

    .login-card {
        width: 100%;

        max-width: none;
    }

    .login-card-header {
        margin-bottom: 24px;
    }

    .login-card-header h1,
    .login-card-header h2,
    .login-title {
        font-size: 25px !important;

        line-height: 1.2 !important;

        text-align: left;
    }

    .login-card-header p,
    .login-subtitle {
        font-size: 12.5px !important;

        text-align: left;
    }

    .login-form-group,
    .login-form .form-group {
        margin-bottom: 18px;
    }

    .login-form-group label,
    .login-form .form-group label {
        font-size: 13px;

        margin-bottom: 7px;
    }

    .login-form input,
    .login-input,
    .login-form .form-group input[type="text"],
    .login-form .form-group input[type="email"],
    .login-form .form-group input[type="password"],
    input.login-input {
        min-height: 56px;

        padding-left: 15px;
        padding-right: 15px;

        border-radius: 12px;

        font-size: 14px;
    }

    .login-password-wrapper input,
    .login-input-wrapper input[type="password"] {
        padding-right: 50px;
    }

    .login-form-options {
        margin-bottom: 20px;
    }

    .login-button,
    .login-submit,
    .login-form button[type="submit"] {
        min-height: 56px;

        border-radius: 12px;

        font-size: 15px;
    }

    .login-footer {
        margin-top: 18px;

        padding-bottom: env(safe-area-inset-bottom);
    }
}


/* =========================================================
   SMALL PHONES — 380px
   ========================================================= */

@media (max-width: 380px) {

    .login-brand {
        min-height: 205px;

        padding: 24px 18px 25px;
    }

    .login-brand .login-logo,
    .login-brand > .logo-icon {
        width: 46px;
        height: 46px;

        margin-bottom: 12px;

        border-radius: 12px;

        font-size: 22px;
    }

    .login-brand h1,
    .login-brand h2,
    .login-brand .brand-title,
    .login-brand .logo-text {
        max-width: 300px;

        font-size: 29px !important;

        letter-spacing: -0.6px;
    }

    .login-brand p,
    .login-brand .brand-subtitle,
    .login-brand .clinic-subtitle {
        max-width: 300px;

        font-size: 11.5px !important;
    }

    .login-info {
        padding: 26px 18px 24px;
    }

    .login-card-header {
        margin-bottom: 21px;
    }

    .login-card-header h1,
    .login-card-header h2,
    .login-title {
        font-size: 23px !important;
    }

    .login-form-options {
        align-items: flex-start;

        flex-direction: column;

        gap: 10px;
    }

    .forgot-password,
    .login-forgot-password {
        white-space: normal;
    }

    .login-form input,
    .login-input,
    .login-form .form-group input[type="text"],
    .login-form .form-group input[type="email"],
    .login-form .form-group input[type="password"],
    input.login-input {
        min-height: 53px;
    }

    .login-button,
    .login-submit,
    .login-form button[type="submit"] {
        min-height: 53px;
    }
}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.login-button:focus-visible,
.login-submit:focus-visible,
.password-toggle:focus-visible,
.toggle-password:focus-visible,
.login-password-toggle:focus-visible,
.login-input:focus-visible,
.login-footer a:focus-visible {
    outline: 3px solid rgba(22, 133, 116, 0.25);

    outline-offset: 2px;
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .login-button,
    .login-submit,
    .login-input,
    .password-toggle,
    .toggle-password,
    .login-password-toggle {
        transition: none;
    }

    .login-button:hover,
    .login-submit:hover {
        transform: none;
    }
}




/* =========================================
   ADMIN LOGIN — LAYOUT & SPACING
   Preserve existing colors and typography
========================================= */

.login-page {
    min-height: 100vh;
    width: 100%;
    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 32px 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    box-sizing: border-box;

    margin: auto;
    padding: 36px 32px;

    display: flex;
    flex-direction: column;
}

/* Clinic logo and name */

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;

    width: 100%;
    margin: 0 0 32px;
}

.logo-icon {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo > div:last-child {
    min-width: 0;
}

.login-logo h1 {
    margin: 0;
    line-height: 1.3;
}

.login-logo p {
    margin: 5px 0 0;
    line-height: 1.5;
}

/* Login heading */

.login-heading {
    width: 100%;
    margin: 10px 0 26px;
    text-align: left;
    
}

.login-heading h2 {
    margin: 0 0 8px;
    line-height: 1.35;
}

.login-heading p {
    margin: 0;
    line-height: 1.6;
}

/* Form layout */

#adminLoginForm {
    display: flex;
    flex-direction: column;
    gap: 20px;

    width: 100%;
    margin: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;

    width: 100%;
    margin: 0;
}

.form-group label {
    display: block;
    margin: 0;
    line-height: 1.5;
}

.form-group input {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;

    margin: 0;
    padding: 13px 14px;

    font: inherit;
    line-height: 1.5;
}

/* Login feedback */

.form-message {
    width: 100%;
    box-sizing: border-box;

    margin: -4px 0 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.form-message:empty {
    display: none;
}

/* Sign-in button */

.login-button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 48px;
    box-sizing: border-box;

    margin: 0;
    padding: 12px 16px;

    font: inherit;
    line-height: 1.5;
    cursor: pointer;
}

/* Back navigation */

.back-link {
    display: block;
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;

    margin: 24px auto 0;
    line-height: 1.6;
    text-align: center;
    overflow-wrap: anywhere;
}

/* Tablet and mobile */

@media (max-width: 480px) {
    .login-page {
        padding: 20px 16px;
    }

    .login-card {
        padding: 28px 22px;
    }

    .login-logo {
        gap: 12px;
        margin-bottom: 28px;
    }

    .login-heading {
        margin-bottom: 22px;
    }

    #adminLoginForm {
        gap: 18px;
    }
   

    .back-link {
        margin-top: 22px;
    }
}

@media (max-width: 360px) {
    .login-page {
        padding: 16px 12px;
    }

    .login-card {
        padding: 24px 18px;
    }

    .login-logo {
        gap: 10px;
    }
}






/* =========================================================
   CARE N CURE — MOBILE RESPONSIVENESS IMPROVEMENTS
   Append at the END of admin.css
   Desktop styles and existing functionality are preserved
========================================================= */

/* Better touch interaction and prevent unwanted overflow */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

button,
a,
input,
select {
    -webkit-tap-highlight-color: transparent;
}

button,
a,
select {
    touch-action: manipulation;
}

img {
    height: auto;
}

/* =========================================================
   TABLET — 760px
========================================================= */

@media (max-width: 760px) {

    /* Dashboard sidebar */
    .admin-sidebar {
        padding: 18px 16px;
    }

    .sidebar-brand {
        gap: 10px;
        padding: 0 4px 18px;
    }

    .sidebar-brand h1 {
        font-size: 19px;
    }

    .sidebar-menu {
        gap: 8px;
        flex-wrap: wrap;
    }

    .menu-item {
        min-width: 0;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 11px 10px;
        font-size: 13px;
        overflow-wrap: anywhere;
    }

    .logout-button {
        min-height: 44px;
    }

    /* Dashboard header */
    .admin-header {
        gap: 14px;
        margin-bottom: 22px;
    }

    .admin-header h2 {
        font-size: 25px;
        line-height: 1.3;
    }

    .admin-header p {
        line-height: 1.6;
    }

    /* Statistics */
    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .stat-card {
        padding: 18px 16px;
    }

    .stat-card span {
        line-height: 1.5;
    }

    /* Appointments header */
    .section-header {
        gap: 16px;
    }

    .header-actions {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }

    .header-actions select,
    .header-actions button {
        min-height: 44px;
        min-width: 0;
    }

    /* Prevent buttons from becoming too narrow */
    .refresh-button,
    .download-button {
        padding: 11px 13px;
    }

    /* Horizontal table scrolling on touch screens */
    .table-container {
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
    }

    table {
        min-width: 850px;
    }

    th,
    td {
        padding: 13px 12px;
    }

    .appointment-actions {
        gap: 8px;
    }

    .approve-button,
    .reject-button {
        min-height: 40px;
        padding: 9px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* Search */
    .appointment-search input {
        min-height: 46px;
        font-size: 14px;
    }

    /* Pagination */
    .pagination-container {
        gap: 14px;
    }

    .pagination-controls {
        gap: 8px;
        flex-wrap: wrap;
    }

    .pagination-button {
        min-height: 42px;
        padding: 0 14px;
    }

    .page-button {
        min-width: 40px;
        min-height: 40px;
    }

    .records-per-page select {
        min-height: 42px;
    }

    /* =====================================================
       LOGIN PAGE — MATCH THE EXISTING HTML
    ===================================================== */

    main.login-page {
        min-height: 100vh;
        min-height: 100svh;
        padding: 24px 18px;
        align-items: center;
    }

    main.login-page > .login-card {
        width: 100%;
        max-width: 440px;
        min-width: 0;
        padding: 30px 26px;
        border-radius: 18px;
    }

    .brand-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin: 0 auto 24px;
    }

    .brand-logo img {
        display: block;
        width: 100%;
        max-width: 150px;
        max-height: 105px;
        object-fit: contain;
    }

    .login-heading {
        margin: 0 0 24px;
        text-align: left;
    }

    .login-heading h2 {
        font-size: 25px;
        line-height: 1.3;
    }

    .login-heading p {
        font-size: 13px;
        line-height: 1.6;
    }

    #adminLoginForm {
        gap: 18px;
    }

    #adminLoginForm .form-group {
        gap: 7px;
    }

    #adminLoginForm .form-group label {
        font-size: 13px;
    }

    #adminLoginForm .form-group input {
        width: 100%;
        min-height: 50px;
        padding: 12px 14px;
        border-radius: 10px;
        font-size: 16px;
    }

    #adminLoginForm .login-button {
        min-height: 50px;
        border-radius: 10px;
    }

    .back-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 20px;
        font-size: 13px;
    }
}

/* =========================================================
   MOBILE PHONES — 500px
========================================================= */

@media (max-width: 500px) {

    /* Dashboard spacing */
    .admin-main {
        padding: 18px 12px;
    }

    .admin-header {
        gap: 12px;
    }

    .admin-header h2 {
        font-size: 22px;
    }

    .admin-header p {
        font-size: 13px;
    }

    .admin-user {
        padding: 12px 14px;
        border-radius: 10px;
    }

    /* Keep dashboard statistics compact */
    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 18px;
    }

    .stat-card {
        min-height: 105px;
        padding: 15px 12px 15px 16px;
        border-radius: 12px;
    }

    .stat-card span {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .stat-card strong {
        font-size: 25px;
        overflow-wrap: anywhere;
    }

    /* Appointments section */
    .appointments-section {
        border-radius: 12px;
    }

    .section-header {
        padding: 17px 14px;
        gap: 14px;
    }

    .section-header h2 {
        font-size: 17px;
        line-height: 1.4;
    }

    .section-header p {
        font-size: 12px;
        line-height: 1.6;
    }

    /* Stack controls in a predictable layout */
    .header-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 9px;
    }

    .header-actions select {
        grid-column: 1 / -1;
        width: 100%;
    }

    .header-actions button {
        width: 100%;
        min-width: 0;
        padding: 10px 7px;
        font-size: 12px;
        overflow-wrap: anywhere;
    }

    .header-actions select {
        font-size: 13px;
    }

    .appointment-search {
        padding: 14px 14px 0;
    }

    .appointment-search input {
        min-height: 46px;
        padding: 12px;
    }

    .table-container {
        margin-top: 14px;
        scrollbar-width: thin;
    }

    table {
        min-width: 850px;
    }

    th {
        font-size: 11px;
        padding: 12px 10px;
    }

    td {
        font-size: 12px;
        padding: 13px 10px;
    }

    /* Pagination should remain easy to use */
    .pagination-container {
        padding: 16px 12px;
        gap: 14px;
    }

    .pagination-info {
        white-space: normal;
        text-align: center;
        line-height: 1.6;
    }

    .pagination-controls {
        width: 100%;
        gap: 6px;
    }

    .pagination-button {
        min-height: 42px;
        padding: 0 11px;
    }

    .page-numbers {
        gap: 4px;
    }

    .page-button {
        min-width: 38px;
        min-height: 40px;
        flex-shrink: 0;
    }

    .records-per-page {
        flex-wrap: wrap;
        justify-content: center;
        white-space: normal;
    }

    /* Loading overlay */
    .admin-loading-card {
        width: calc(100% - 40px);
        max-width: 300px;
        min-width: 0;
        padding: 24px 20px;
    }

    /* =====================================================
       LOGIN — PHONE LAYOUT
    ===================================================== */

    main.login-page {
        padding: 18px 14px;
    }

    main.login-page > .login-card {
        max-width: 440px;
        padding: 26px 20px;
        border-radius: 16px;
    }

    .brand-logo {
        margin-bottom: 20px;
    }

    .brand-logo img {
        max-width: 135px;
        max-height: 90px;
    }

    .login-heading {
        margin-bottom: 22px;
    }

    .login-heading h2 {
        font-size: 23px;
    }

    .login-heading p {
        font-size: 12px;
    }

    #adminLoginForm {
        gap: 17px;
    }

    #adminLoginForm .form-group input {
        min-height: 50px;
        padding: 12px;
        font-size: 16px;
    }

    #adminLoginForm .login-button {
        min-height: 50px;
        font-size: 14px;
    }

    .back-link {
        margin-top: 18px;
        font-size: 12px;
        text-align: center;
    }
}

/* =========================================================
   VERY SMALL PHONES — 360px
========================================================= */

@media (max-width: 360px) {

    .admin-main {
        padding: 14px 9px;
    }

    .dashboard-stats {
        gap: 8px;
    }

    .stat-card {
        padding: 13px 9px 13px 13px;
    }

    .stat-card span {
        font-size: 11px;
    }

    .stat-card strong {
        font-size: 23px;
    }

    .section-header {
        padding: 15px 11px;
    }

    .header-actions {
        gap: 7px;
    }

    .header-actions button {
        font-size: 11px;
        padding: 10px 5px;
    }

    .page-button {
        min-width: 34px;
    }

    main.login-page {
        padding: 14px 10px;
    }

    main.login-page > .login-card {
        padding: 23px 16px;
    }

    .brand-logo img {
        max-width: 120px;
        max-height: 80px;
    }

    .login-heading h2 {
        font-size: 22px;
    }
}

/* =========================================================
   TOUCH DEVICES — CLEAR FEEDBACK
========================================================= */

@media (hover: none) and (pointer: coarse) {

    .menu-item,
    .logout-button,
    .refresh-button,
    .download-button,
    .approve-button,
    .reject-button,
    .pagination-button,
    .page-button,
    .login-button {
        transition: background-color 0.15s ease,
                    opacity 0.15s ease;
    }

    .menu-item:active,
    .refresh-button:active,
    .download-button:active,
    .approve-button:active,
    .reject-button:active,
    .pagination-button:active,
    .page-button:active,
    .login-button:active {
        opacity: 0.8;
    }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

