/* site.css - Java Swing-inspired metallic theme (RECTIFIED) */

/* Root Variables for Swing Metallic Theme */
:root {
    --bg: #d3d6d8; /* Light metallic gray (Main background) */
    --panel-bg: #e6e9ec; /* Softer metallic panel/form background */
    --border: #a0a0a0; /* Neutral gray border */
    --accent-1: #4682b4; /* Steel blue (Primary/Update/Focus) */
    --accent-2: #2e8b57; /* Sea green (Success/Register) */
    --accent-3: #6a5acd; /* Slate blue (Vitals - less used, but defined) */
    --focus-bg: #f0f4fa; /* Light blue focus background */
    --text: #333333; /* Dark text for readability */
    --light-text: #ffffff; /* Text color for dark backgrounds (like accents) */
    --secondary-text: #6b7280; /* Muted/Gray text */
    --danger: #dc3545; /* Red for danger/errors */
    --warning: #d97706; /* Orange/Yellow for warnings */
    --info: #0e7490; /* Teal/Cyan for info */
    --secondary: #6c757d; /* Gray for secondary actions */
    --radius: 3px; /* Tight radius for Swing look */
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3); /* Beveled shadow */
    --transition: all 0.1s ease; /* Fast, crisp transitions */
    --toggle-bg: #c0c0c0; /* Metallic toggle base */
    --toggle-active: var(--accent-1); /* Blue active toggle */
    --header-bg: linear-gradient(180deg, #d3d6d8, #b0b4b8); /* Metallic header gradient (lighter) */
    --modal-header-bg: linear-gradient(180deg, var(--accent-1), #3a6b9a); /* Modal header gradient (darker blue) */
    --login-bg: linear-gradient(135deg, var(--accent-1), #2a5298); /* Vibrant metallic gradient for login */
    --error-bg: #fff3f3; /* Light red background for errors */
    --error-border: #ffcccc; /* Light red border for errors */
}

/* General Styling */
body {
    margin: 0;
    font-family: 'Verdana', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* Dashboard Container */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem;
    background: var(--bg);
    min-height: 100vh;
}

/* ERP Form */
.erp-form {
    font-size: 13px;
    padding: 6px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.erp-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.bottom-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding: 0 3px;
}

.left-buttons, .right-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* ERP Panel */
.erp-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.panel-header {
    background: var(--header-bg);
    color: var(--text);
    font-weight: 600;
    font-size: 12px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.header-title {
    font-size: 13px;
    font-weight: 700;
}

.panel-icon {
    width: 14px;
    height: 14px;
    background-size: contain;
    background-repeat: no-repeat;
}

/* Inline SVG icons using accent colors */
.patient-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%234682b4' stroke-width='1.5' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-3.3 2.7-6 6-6h4c3.3 0 6 2.7 6 6'/%3E%3C/svg%3E");
}

.fee-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%232e8b57' stroke-width='1.5' viewBox='0 0 24 24'%3E%3Ctext x='3' y='17' font-size='10' font-family='Arial' fill='%232e8b57'%3E%26%23x20B9%3B%3C/text%3E%3Cline x1='8' y1='7' x2='20' y2='7'/%3E%3Cline x1='8' y1='12' x2='20' y2='12'/%3E%3Cline x1='8' y1='7' x2='14' y2='17'/%3E%3C/svg%3E");
}

.vitals-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%236a5acd' stroke-width='1.5' viewBox='0 0 24 24'%3E%3Cpath d='M3 12h4l2-5 4 10 2-5h4' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}

.panel-body {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: none;
}

    .panel-body::-webkit-scrollbar {
        display: none;
    }

/* Form Controls */
.form-control, .form-select, .input {
    height: 28px;
    padding: 0 6px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #f5f6f5; /* Light input background */
    color: var(--text);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), inset 0 -1px 0 rgba(255, 255, 255, 0.3);
    transition: var(--transition);
}

    .form-control:focus, .form-select:focus, .input:focus {
        border-color: var(--accent-1);
        background: var(--focus-bg);
        box-shadow: 0 0 4px rgba(70, 130, 180, 0.5);
        outline: none;
    }

.form-select {
    appearance: none;
    /* Use var(--text) for the SVG dropdown arrow color */
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' fill='none' stroke='%23333333' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 6px center;
    background-size: 10px;
    padding-right: 20px;
}

textarea.form-control {
    height: 36px;
    resize: none;
    padding: 5px 6px;
    font-size: 12px;
}

    textarea.form-control:focus {
        background: var(--focus-bg);
    }

/* Input Group */
.input-group {
    display: flex;
    align-items: center;
}

    .input-group .btn {
        height: 28px;
        padding: 0 6px;
        font-size: 13px;
        border-radius: 0 var(--radius) var(--radius) 0;
        border: 1px solid var(--border);
        background: var(--header-bg);
        color: var(--text);
        box-shadow: var(--shadow);
    }

        .input-group .btn:hover {
            background: #c0c4c8; /* Slightly darker metallic on hover */
            border-color: var(--accent-1);
        }

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toggle-label {
    font-size: 12px;
    font-weight: 600;
}

.toggle-switch {
    background: var(--toggle-bg);
    border-radius: 12px;
    padding: 2px;
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.toggle-radio-group {
    display: flex;
}

.toggle-option {
    padding: 4px 12px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    color: var(--text);
    border-radius: 10px;
    transition: var(--transition);
}

    .toggle-option input[type="radio"] {
        display: none;
    }

    .toggle-option.active {
        background: var(--toggle-active);
        color: var(--light-text);
    }

    .toggle-option:hover:not(.active) {
        background: #b0b4b8; /* Same as header-bg end color */
    }

/* Totals Box */
.totals-box {
    margin-top: 4px;
    padding: 5px;
    background: var(--panel-bg);
    border-radius: var(--radius);
    font-size: 11px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
}

.total-item {
    font-weight: 500;
}

    .total-item span {
        color: var(--accent-2);
        font-weight: 700;
    }

    .total-item.dues {
        font-weight: 700;
    }

/* Buttons */
.btn, .btn-action, .btn-sm, .login-btn, .secondary-login-btn {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-transform: uppercase;
}

.btn-sm {
    padding: 3px 6px;
    font-size: 12px;
    min-width: 40px;
}

/* Success/Register Button */
.btn-register, .btn-success {
    background: var(--accent-2);
    border: none;
    color: var(--light-text);
}

    .btn-register:hover, .btn-success:hover {
        background: #287a47; /* Darker accent-2 */
    }

/* Primary/Update Button */
.btn-update, .btn-primary {
    background: var(--accent-1);
    border: none;
    color: var(--light-text);
}

    .btn-update:hover:not(:disabled), .btn-primary:hover:not(:disabled) {
        background: #3a6b9a; /* Darker accent-1 */
    }

/* Print Receipt Button */
.btn-print-receipt {
    background: #e08c47; /* Orange/Gold */
    border: none;
    color: var(--light-text);
}

    .btn-print-receipt:hover:not(:disabled) {
        background: #c97a3e;
    }

/* Print Letterhead Button */
.btn-print-letterhead {
    background: #b73e4c; /* Dark Red/Maroon */
    border: none;
    color: var(--light-text);
}

    .btn-print-letterhead:hover:not(:disabled) {
        background: #9f3643;
    }

/* Secondary/Cancel Button */
.btn-cancel, .btn-secondary {
    background: var(--secondary);
    border: none;
    color: var(--light-text);
}

    .btn-cancel:hover, .btn-secondary:hover {
        background: #5a6268;
    }

/* Search/Outline Primary Button */
.btn-search, .btn-outline-primary {
    background: var(--header-bg);
    color: var(--text);
}

    .btn-search:hover, .btn-outline-primary:hover {
        background: var(--accent-1);
        color: var(--light-text);
    }

/* Danger Button */
.btn-danger {
    background: var(--danger);
    border: none;
    color: var(--light-text);
}

    .btn-danger:hover {
        background: #c82333;
    }

/* Warning Button */
.btn-warning {
    background: var(--warning);
    border: none;
    color: var(--light-text);
}

    .btn-warning:hover {
        background: #b35900;
    }

/* Info Button */
.btn-info {
    background: var(--info);
    border: none;
    color: var(--light-text);
}

    .btn-info:hover {
        background: #0c5b71;
    }

/* Disabled Button */
.btn:disabled, .btn-sm:disabled {
    background: #d3d3d3; /* Lighter gray */
    color: #888;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Validation */
.validation-message, .validation-summary-errors {
    color: #b73e4c; /* Custom error color, but could use var(--danger) */
    font-size: 10px;
    margin-top: 2px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    padding: 3px;
    border-radius: var(--radius);
}

/* Searchable Dropdown */
.searchable-dropdown {
    position: relative;
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-bg);
    margin: 2px 0 0 0;
    padding: 0;
    list-style: none;
    z-index: 1050;
    box-shadow: var(--shadow);
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--panel-bg);
}

    .dropdown-list::-webkit-scrollbar {
        width: 5px;
    }

    .dropdown-list::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: var(--radius);
    }

    .dropdown-list::-webkit-scrollbar-track {
        background: var(--panel-bg);
    }

    .dropdown-list li {
        padding: 5px 8px;
        cursor: pointer;
        font-size: 12px;
        transition: var(--transition);
    }

        .dropdown-list li:hover {
            background: var(--accent-1);
            color: var(--light-text);
        }

        .dropdown-list li.selected {
            background: var(--bg); /* Use main bg color for selected item */
            color: var(--text);
        }

/* Modal Styles */
.appt-modal-backdrop, .overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
}

.appt-modal, .form-window, .form-window2, .form-window6, .form-window7 {
    background: var(--panel-bg);
    border-radius: var(--radius);
    width: 90vw;
    max-width: 600px;
    min-width: 320px;
    height: 70vh;
    max-height: 70vh;
    min-height: 400px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: popup 0.2s ease-out;
}

.form-window6, .form-window7 {
    max-width: 1200px;
    height: auto;
    max-height: 95vh;
}

.modal-header, .form-header {
    background: var(--modal-header-bg); /* Use defined modal header gradient */
    color: var(--light-text);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 38px;
}

    .modal-header h5 {
        margin: 0;
        font-size: 13px;
    }

.btn-close-custom {
    background: transparent;
    border: none;
    color: var(--light-text);
    cursor: pointer;
    transition: color 0.2s;
}

    .btn-close-custom:hover {
        color: #e6e6e6; /* Light gray on hover */
    }

.appt-modal-content, .modal-body, .form-body {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--panel-bg);
}

    .appt-modal-content::-webkit-scrollbar,
    .modal-body::-webkit-scrollbar,
    .form-body::-webkit-scrollbar {
        width: 5px;
    }

    .appt-modal-content::-webkit-scrollbar-thumb,
    .modal-body::-webkit-scrollbar-thumb,
    .form-body::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: var(--radius);
    }

    .appt-modal-content::-webkit-scrollbar-track,
    .modal-body::-webkit-scrollbar-track,
    .form-body::-webkit-scrollbar-track {
        background: var(--panel-bg);
    }

    .modal-body input.form-control {
        margin-bottom: 6px;
    }

.modal-footer {
    padding: 6px 8px;
}

/* Table Styles */
.table {
    font-size: 12px;
    width: 100%;
    table-layout: fixed;
    background: var(--panel-bg);
    border-collapse: collapse;
}

    .table th, .table td {
        padding: 2px 4px;
        text-overflow: ellipsis;
        vertical-align: middle;
        border: 1px solid var(--border);
    }

    .table th {
        background: var(--header-bg);
        font-weight: 600;
        font-size: 11px;
        text-transform: uppercase;
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .table td {
        font-size: 12px;
    }

.table-hover tbody tr:hover {
    background: var(--bg); /* Use main bg color for hover */
}

.table-primary {
    background: #e6f0fa; /* Light blue row highlight */
    outline: 1px solid var(--accent-1);
}

/* Service and Test Tables */
.service-table, .test-table {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* Grid Card */
.grid-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-bg);
    box-shadow: var(--shadow);
}

.table-container {
    max-height: 350px;
    overflow-y: auto;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-1) var(--panel-bg);
}

    .table-container::-webkit-scrollbar {
        width: 6px;
    }

    .table-container::-webkit-scrollbar-track {
        background: var(--panel-bg);
    }

    .table-container::-webkit-scrollbar-thumb {
        background: var(--accent-1);
        border-radius: var(--radius);
    }

        .table-container::-webkit-scrollbar-thumb:hover {
            background: #3a6b9a; /* Darker accent-1 */
        }

.grid-card tr:nth-child(odd) {
    background: #f0f2f4; /* Subtle alternating row color */
}

.grid-card tr:hover {
    background: var(--bg); /* Use main bg color for hover */
}

.grid-card [aria-selected="true"] {
    outline: 2px solid var(--accent-1);
}

/* Login Page */
.login-background {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--login-bg); /* Use login gradient variable */
    animation: gradientShift 10s ease infinite;
}

.login-card {
    background: var(--panel-bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow), 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

    .login-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
    }

.logo {
    width: 90px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

h2 {
    margin-bottom: 1.5rem;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
}

/* Login Input - now uses .input selector */
.input {
    width: 100%;
    height: 30px;
    padding: 0 8px;
    margin-bottom: 1rem;
}

/* Login Button */
.login-btn {
    width: 100%;
    height: 30px;
    border: none;
    background: var(--accent-1);
    color: var(--light-text);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition), transform 0.2s ease;
}

    .login-btn:hover {
        background: #3a6b9a; /* Darker accent-1 */
        transform: translateY(-1px);
    }

    .login-btn:active {
        transform: translateY(0);
    }

.secondary-login-btn {
    width: 100%;
    height: 30px;
    border: none;
    background: var(--header-bg);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition), transform 0.2s ease;
    margin-top: 0.5rem;
}

    .secondary-login-btn:hover {
        background: #c0c4c8; /* Slightly darker metallic */
        transform: translateY(-1px);
    }

    .secondary-login-btn:active {
        transform: translateY(0);
    }

.error {
    color: #b73e4c;
    margin-top: 0.5rem;
    font-size: 11px;
    background: var(--error-bg);
    padding: 3px;
    border-radius: var(--radius);
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: var(--header-bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow-y: auto;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

    .sidebar.closed {
        width:0px;
    }

.sidebar-header {
    padding: .5rem;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

    .sidebar-header i {
        margin-right: 0.5rem;
        font-size: 16px;
    }

.sidebar-menu {
    list-style: none;
    padding: 0;
    flex: 1;
}

.menu-link, .menu-btn {
    display: flex;
    width: 100%;
    align-items: center;
    padding: 0.8rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

    .menu-link i, .menu-btn i {
        margin-right: 0.5rem;
        font-size: 14px;
    }

    .menu-link:hover, .menu-btn:hover {
        background: #c0c4c8; /* Slightly darker metallic on hover */
    }

.active {
    background: #b0b4b8; /* Darker end of header gradient */
    border-left: 3px solid var(--accent-1);
    font-weight: 600;
}

.submenu {
    list-style: none;
    padding-left: 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

    .submenu.open {
        max-height: 400px;
    }

    .submenu .nav-link {
        padding: 0.6rem 1rem;
        color: var(--text);
        font-size: 12px;
        border-left: 2px solid transparent;
        transition: var(--transition);
    }

        .submenu .nav-link:hover {
            background: #c0c4c8;
            border-left: 2px solid var(--accent-1);
        }

.submenu-indicator.rotate {
    transform: rotate(180deg);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius);
}

/* Header */
header.fixed-top {
    height: 42px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 900;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
}

main.flex-grow-1 {
    margin-left: 240px;
    margin-top: 42px; /* Adjusted to header height (42px) */
    padding: 1rem;
    flex-grow: 1;
    transition: margin-left 0.3s ease;
}

.sidebar.closed + main.flex-grow-1 {
    margin-left:0px;
}

/* Animations (Corrected gradientShift for better cross-browser compatibility if used) */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes popup {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .bottom-panels {
        grid-template-columns: 1fr;
    }

    .form-control, .form-select, .input {
        font-size: 12px;
        height: 26px;
    }

    .form-label {
        font-size: 12px;
    }

    textarea.form-control {
        height: 34px;
        font-size: 11px;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 0.3rem;
    }

    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }

    .left-buttons, .right-buttons {
        justify-content: center;
        width: 100%;
    }

    .btn, .btn-action, .btn-sm, .login-btn, .secondary-login-btn {
        flex: 1 1 48%;
        font-size: 10px;
        padding: 3px 6px;
    }

    .appt-modal, .form-window, .form-window2 {
        width: 95vw;
        max-width: 450px;
        min-width: 300px;
        height: 65vh;
        max-height: 65vh;
        min-height: 350px;
    }

    .form-window6, .form-window7 {
        max-width: 450px;
        min-width: 300px;
        height: auto;
        max-height: 95vh;
        min-height: 350px;
    }

    .form-control, .form-select, .input {
        font-size: 11px;
        height: 24px;
    }

    .form-label {
        font-size: 11px;
    }

    .sidebar {
        width:0px;
    }

        .sidebar.open {
            width: 240px;
        }

    main.flex-grow-1 {
        margin-left:0px;
        margin-top: 42px;
    }

    .sidebar.open + main.flex-grow-1 {
        margin-left: 240px;
    }

    /* MISSING STYLE ADDED: Sidebar Toggle for mobile */
    .sidebar-toggle {
        display: block;
        position: fixed;
        top: 0.5rem;
        left: 0.5rem;
        padding: 0.4rem;
        background: var(--accent-1);
        color: var(--light-text);
        border-radius: var(--radius);
        z-index: 1100;
        border: 1px solid #3a6b9a;
        box-shadow: var(--shadow);
    }

    .login-card {
        padding: 1.5rem;
    }

    .logo {
        width: 80px;
    }
}

@media (max-width: 480px) {
    .erp-form {
        padding: 3px;
    }

    .btn, .btn-action, .btn-sm, .login-btn, .secondary-login-btn {
        flex: 1 1 100%;
        font-size: 9px;
        padding: 3px 6px;
    }

    .form-control, .form-select, .input {
        font-size: 10px;
        height: 22px;
        padding: 2px 4px;
    }

    .form-label {
        font-size: 10px;
    }

    .panel-header {
        font-size: 10px;
        padding: 4px;
    }

    .header-title {
        font-size: 11px;
    }

    .appt-modal, .form-window, .form-window2 {
        max-width: 320px;
        min-width: 280px;
        height: 60vh;
        max-height: 60vh;
        min-height: 300px;
    }

    .form-window6, .form-window7 {
        max-width: 320px;
        min-width: 280px;
        height: auto;
        max-height: 95vh;
        min-height: 300px;
    }

    .login-card {
        padding: 1rem;
    }

    .logo {
        width: 70px;
    }
}
/* Details Card */
.details-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-bg);
    box-shadow: var(--shadow);
    margin-bottom: 0.5rem;
}

    .details-card .card-header {
        background: var(--modal-header-bg); /* Consistent header gradient */
        color: var(--light-text);
        font-size: 12px;
        font-weight: 600;
        padding: 4px 8px;
        border-radius: var(--radius) var(--radius) 0 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

        .details-card .card-header .btn-sm {
            padding: 2px 6px;
            font-size: 10px;
            background: #e6e6e6; /* Light gray button */
            border: 1px solid var(--border);
            color: var(--text);
            box-shadow: var(--shadow);
        }

            .details-card .card-header .btn-sm:hover {
                background: #c0c4c8;
            }

    .details-card .card-body {
        padding: 6px;
        font-size: 11px;
    }

    .details-card .section-title {
        font-size: 12px;
        font-weight: 600;
        color: var(--accent-1);
        margin-bottom: 4px;
    }

    .details-card p {
        margin: 2px 0;
        font-size: 11px;
        color: var(--text);
    }

    .details-card .text-muted {
        font-size: 11px;
        color: var(--secondary-text); /* Use variable */
        font-style: italic;
    }

    .details-card .spinner-border {
        width: 1.5rem;
        height: 1.5rem;
        border-width: 0.2em;
    }

/* Responsive Adjustments for Details Card (No changes, already fine) */
@media (max-width: 768px) {
    .details-card .card-header {
        font-size: 11px;
        padding: 3px 6px;
    }

    .details-card .card-body {
        padding: 4px;
        font-size: 10px;
    }

    .details-card .section-title {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .details-card p {
        font-size: 10px;
    }

    .details-card .text-muted {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .details-card .card-header {
        font-size: 10px;
        padding: 2px 4px;
    }

    .details-card .card-body {
        padding: 3px;
        font-size: 9px;
    }

    .details-card .section-title {
        font-size: 10px;
        margin-bottom: 2px;
    }

    .details-card p {
        font-size: 9px;
    }

    .details-card .text-muted {
        font-size: 9px;
    }

    .details-card .spinner-border {
        width: 1.2rem;
        height: 1.2rem;
    }
}
/* Metallic-themed message dialog */
.message-dialog-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.message-dialog {
    background: linear-gradient(180deg, #d9e2e9, #a6b8c4); /* Consistent with metallic theme */
    border: 2px solid #4a5a6b; /* Dark metallic border */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    width: 350px;
    max-width: 90%;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.message-dialog-header {
    background: linear-gradient(180deg, #6c8294, #4a5a6b); /* Darker metallic gradient */
    color: var(--light-text);
    padding: 10px 15px;
    border-bottom: 1px solid #3a4a5b;
    border-radius: 6px 6px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.message-dialog-title {
    margin: 0;
    font-size: 16px;
}

.message-dialog-close {
    background: none;
    border: none;
    color: var(--light-text);
    font-size: 14px;
    cursor: pointer;
    padding: 0 5px;
}

    .message-dialog-close:hover {
        color: var(--danger);
    }

.message-dialog-body {
    padding: 15px;
    color: var(--text);
    font-size: 14px;
    background: #e6ecef; /* Light metallic background */
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.message-dialog-footer {
    padding: 10px 15px;
    text-align: right;
    background: linear-gradient(180deg, #d9e2e9, #a6b8c4);
    border-radius: 0 0 6px 6px;
}

.message-dialog-button {
    background: linear-gradient(180deg, #6c8294, #4a5a6b); /* Button metallic gradient */
    border: 1px solid #3a4a5b;
    border-radius: 4px;
    color: var(--light-text);
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
    transition: background 0.2s;
}

    .message-dialog-button:hover {
        background: linear-gradient(180deg, #8a9fb3, #5c6f81);
    }

    .message-dialog-button:active {
        background: linear-gradient(180deg, #4a5a6b, #6c8294);
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    }

/* ===== Transparent Button Styling ===== */
.btn-transparent {
    background-color: transparent !important;
    border: none;
    color: var(--text); /* Use theme text color */
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
    padding: 4px 8px;
    border-radius: var(--radius); /* Use theme radius */
}

    .btn-transparent:hover {
        background-color: rgba(0, 0, 0, 0.05);
    }

/* ===== User Menu Dropdown ===== */
.user-menu {
    position: relative;
    outline: none;
    z-index: 11;
}

    /* Dropdown menu styling */
    .user-menu .dropdown-menu {
        position: absolute;
        top: 120%;
        right: 0;
        display: none;
        min-width: 200px;
        border-radius: var(--radius); /* Use theme radius */
        border: 1px solid var(--border);
        background-color: var(--panel-bg); /* Use theme panel background */
        padding: 0.4rem 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        animation: fadeIn 0.2s ease;
        z-index: 2000;
    }

        /* Show when active */
        .user-menu .dropdown-menu.show {
            display: block;
        }

    /* Dropdown item styling */
    .user-menu .dropdown-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 14px;
        font-size: 0.95rem;
        color: var(--text); /* Use theme text color */
        transition: background-color 0.15s ease, color 0.15s ease;
        background: transparent;
        border: none;
        width: 100%;
        text-align: left;
    }

        .user-menu .dropdown-item i {
            color: var(--secondary-text); /* Use secondary text for icons */
            font-size: 1rem;
        }

        .user-menu .dropdown-item:hover {
            background-color: #f1f1f1; /* Light hover background */
        }

    /* Divider inside dropdown */
    .user-menu .dropdown-divider {
        margin: 6px 0;
        border-top: 1px solid var(--border); /* Use theme border */
    }

    /* Logout item styling */
    .user-menu .dropdown-item.text-danger {
        color: var(--danger) !important;
        font-weight: 600;
    }

/* Dropdown caret rotation */
.rotate {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

/* ===== Fade-in Animation ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Transparent overlay for click-outside ===== */
.overlay2 {
    position: fixed;
    inset: 0;
    background: none;
    z-index: 2;
}

.profile-container {
    max-width: 900px;
    margin: 2rem auto;
    background: var(--panel-bg); /* Use theme panel background */
    padding: 2rem 2.5rem;
    border-radius: var(--radius); /* Use theme radius */
    box-shadow: var(--shadow); /* Use theme shadow */
    border: 1px solid var(--border); /* Added theme border */
}

.profile-header {
    border-bottom: 1px solid var(--border); /* Use theme border */
    padding-bottom: 0.75rem;
}


.image-preview {
    display: flex;
    align-items: center;
    justify-content: start;
}

.img-preview {
    max-width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border); /* Use theme border */
}

.img-placeholder {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: var(--bg); /* Use theme background */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-text); /* Use secondary text */
    font-size: 3rem;
    border: 3px dashed var(--border); /* Use theme border */
}

.password-container {
    max-width: 550px;
    margin: 3rem auto;
    background: var(--panel-bg); /* Use theme panel background */
    padding: 2.5rem;
    border-radius: var(--radius); /* Use theme radius */
    box-shadow: var(--shadow); /* Use theme shadow */
    border: 1px solid var(--border); /* Added theme border */
}

.password-header {
    border-bottom: 1px solid var(--border); /* Use theme border */
    padding-bottom: 0.75rem;
}

.password-form .form-group {
    margin-bottom: 1.2rem;
}

.password-form label {
    font-weight: 600;
    color: var(--text); /* Use theme text color */
    margin-bottom: 0.4rem;
    display: block;
}

.password-form .form-control {
    border-radius: var(--radius); /* Use theme radius */
    padding: 0.65rem 0.8rem;
}

.password-form .btn-primary {
    border-radius: var(--radius); /* Use theme radius */
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(70, 130, 180, 0.3); /* Shadow based on accent-1 */
    transition: all 0.2s ease;
}

    .password-form .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(70, 130, 180, 0.35);
    }
