/* site.css - Enterprise Medical Blue Theme (Production Ready) */

/* Root Variables for Enterprise Medical Blue Theme */
:root {
    --bg: #f8fafc; /* Clean modern slate background */
    --panel-bg: #ffffff; /* Crisp white cards/panels */
    --border: #e2e8f0; /* Subtle modern border */
    --accent-1: #1e40af; /* Royal Blue (Primary/Save/Focus) */
    --accent-2: #059669; /* Emerald Green (Success/Register) */
    --accent-3: #0284c7; /* Azure Blue (Vitals/Consultations) */
    --focus-bg: #ffffff; /* Clean white focus background */
    --text: #0f172a; /* Deep slate text for crisp readability */
    --light-text: #ffffff; /* Text color for dark backgrounds */
    --secondary-text: #64748b; /* Muted/Gray text */
    --danger: #dc2626; /* Modern red for danger/errors */
    --warning: #d97706; /* Amber for warnings */
    --info: #0284c7; /* Azure for info */
    --secondary: #64748b; /* Gray for secondary actions */
    --radius: 8px; /* Modern rounded corners */
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --transition: all 0.15s ease;
    --toggle-bg: #e2e8f0;
    --toggle-active: var(--accent-1);
    --header-bg: #1e40af;
    --modal-header-bg: linear-gradient(135deg, #0f172a, #1e40af);
    --login-bg: linear-gradient(135deg, #0f172a, #1e40af);
    --error-bg: #fef2f2;
    --error-border: #fecaca;
}

/* General Styling */
body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* Dashboard Container */
.dashboard-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0.75rem;
    background: var(--bg);
    min-height: 100vh;
}

/* ERP Form */
.erp-form {
    font-size: 13px;
    padding: 8px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.erp-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.bottom-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 4px;
}

.left-buttons, .right-buttons {
    display: flex;
    gap: 6px;
    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);
    overflow: hidden;
}

.panel-header {
    background: #ffffff;
    color: #0f172a;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.header-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.panel-icon {
    width: 16px;
    height: 16px;
    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='16' height='16' fill='none' stroke='%231e40af' stroke-width='2' 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='16' height='16' fill='none' stroke='%23059669' stroke-width='2' viewBox='0 0 24 24'%3E%3Ctext x='3' y='17' font-size='11' font-family='Arial' font-weight='bold' fill='%23059669'%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='16' height='16' fill='none' stroke='%230284c7' stroke-width='2' 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: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Form Controls */
.form-control, .form-select, .input {
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: var(--transition);
}

    .form-control:focus, .form-select:focus, .input:focus {
        border-color: var(--accent-1);
        background: #ffffff;
        box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
        outline: none;
    }

.form-select {
    appearance: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
    background-size: 10px;
    padding-right: 24px;
}

textarea.form-control {
    height: 44px;
    resize: none;
    padding: 6px 8px;
    font-size: 12px;
}

    textarea.form-control:focus {
        background: #ffffff;
    }

/* Input Group */
.input-group {
    display: flex;
    align-items: center;
}

    .input-group .btn {
        height: 32px;
        padding: 0 10px;
        font-size: 13px;
        border-radius: 0 var(--radius) var(--radius) 0;
        border: 1px solid var(--border);
        background: #f1f5f9;
        color: var(--text);
        box-shadow: none;
    }

        .input-group .btn:hover {
            background: #e2e8f0;
            border-color: var(--accent-1);
            color: var(--accent-1);
        }

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}

.toggle-switch {
    background: #f1f5f9;
    border-radius: 999px;
    padding: 3px;
    border: 1px solid var(--border);
}

.toggle-radio-group {
    display: flex;
    gap: 2px;
}

.toggle-option {
    padding: 4px 14px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    border-radius: 999px;
    transition: var(--transition);
}

    .toggle-option input[type="radio"] {
        display: none;
    }

    .toggle-option.active {
        background: var(--accent-1);
        color: #ffffff;
        box-shadow: 0 2px 6px rgba(30, 64, 175, 0.3);
    }

    .toggle-option:hover:not(.active) {
        background: #e2e8f0;
        color: #0f172a;
    }

/* Totals Box */
.totals-box {
    margin-top: 6px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: var(--radius);
    font-size: 12px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-item {
    font-weight: 600;
    color: #475569;
}

    .total-item span {
        color: var(--accent-2);
        font-weight: 800;
        font-size: 13px;
    }

    .total-item.dues span {
        color: var(--danger);
    }

/* Buttons */
.btn, .btn-action, .btn-sm, .login-btn, .secondary-login-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    text-transform: none;
    letter-spacing: 0.01em;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    min-width: 36px;
}

/* Success/Register Button */
.btn-register, .btn-success {
    background: #059669;
    border: 1px solid #047857;
    color: #ffffff;
}

    .btn-register:hover, .btn-success:hover {
        background: #047857;
        color: #ffffff;
    }

/* Primary/Update Button */
.btn-update, .btn-primary {
    background: #1e40af;
    border: 1px solid #1e3a8a;
    color: #ffffff;
}

    .btn-update:hover:not(:disabled), .btn-primary:hover:not(:disabled) {
        background: #1d4ed8;
        color: #ffffff;
    }

/* Print Receipt Button */
.btn-print-receipt {
    background: #0284c7;
    border: 1px solid #0369a1;
    color: #ffffff;
}

    .btn-print-receipt:hover:not(:disabled) {
        background: #0369a1;
        color: #ffffff;
    }

/* Print Letterhead Button */
.btn-print-letterhead {
    background: #4338ca;
    border: 1px solid #3730a3;
    color: #ffffff;
}

    .btn-print-letterhead:hover:not(:disabled) {
        background: #3730a3;
        color: #ffffff;
    }

/* Secondary/Cancel Button */
.btn-cancel, .btn-secondary {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #334155;
}

    .btn-cancel:hover, .btn-secondary:hover {
        background: #e2e8f0;
        color: #0f172a;
    }

/* Search/Outline Primary Button */
.btn-search, .btn-outline-primary {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

    .btn-search:hover, .btn-outline-primary:hover {
        background: #1e40af;
        border-color: #1e3a8a;
        color: #ffffff;
    }

/* Danger Button */
.btn-danger {
    background: #dc2626;
    border: 1px solid #b91c1c;
    color: #ffffff;
}

    .btn-danger:hover {
        background: #b91c1c;
        color: #ffffff;
    }

/* Warning Button */
.btn-warning {
    background: #d97706;
    border: 1px solid #b45309;
    color: #ffffff;
}

    .btn-warning:hover {
        background: #b45309;
        color: #ffffff;
    }

/* Info Button */
.btn-info {
    background: #0284c7;
    border: 1px solid #0369a1;
    color: #ffffff;
}

    .btn-info:hover {
        background: #0369a1;
        color: #ffffff;
    }

/* Disabled Button */
.btn:disabled, .btn-sm:disabled {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Validation */
.validation-message, .validation-summary-errors {
    color: #dc2626;
    font-size: 11px;
    font-weight: 500;
    margin-top: 3px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 3px 6px;
    border-radius: 4px;
}

/* 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(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    padding: 1rem;
}

.appt-modal, .form-window, .form-window2, .form-window6, .form-window7 {
    background: var(--panel-bg);
    border-radius: 12px;
    width: 90vw;
    max-width: 650px;
    min-width: 320px;
    height: auto;
    max-height: 85vh;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: popup 0.2s ease-out;
    border: 1px solid var(--border);
}

.form-window6, .form-window7 {
    max-width: 1200px;
    width: 95vw;
    max-height: 92vh;
}

.modal-header, .form-header {
    background: var(--modal-header-bg);
    color: var(--light-text);
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 42px;
}

    .modal-header h5, .form-header h5 {
        margin: 0;
        font-size: 14px;
        font-weight: 700;
        letter-spacing: -0.01em;
    }

.btn-close-custom {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--light-text);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

    .btn-close-custom:hover {
        background: rgba(255, 255, 255, 0.35);
    }

.appt-modal-content, .modal-body, .form-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
    background: #ffffff;
}

    .appt-modal-content::-webkit-scrollbar,
    .modal-body::-webkit-scrollbar,
    .form-body::-webkit-scrollbar {
        width: 6px;
    }

    .appt-modal-content::-webkit-scrollbar-thumb,
    .modal-body::-webkit-scrollbar-thumb,
    .form-body::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

    .appt-modal-content::-webkit-scrollbar-track,
    .modal-body::-webkit-scrollbar-track,
    .form-body::-webkit-scrollbar-track {
        background: #f8fafc;
    }

    .modal-body input.form-control {
        margin-bottom: 8px;
    }

.modal-footer {
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
}

/* Table Styles */
.table {
    font-size: 12.5px;
    width: 100%;
    background: #ffffff;
    border-collapse: collapse;
}

    .table th, .table td {
        padding: 6px 10px;
        text-overflow: ellipsis;
        vertical-align: middle;
        border: 1px solid var(--border);
    }

    .table th {
        background: #f8fafc;
        color: #475569;
        font-weight: 700;
        font-size: 11.5px;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .table td {
        color: #334155;
    }

.table-hover tbody tr:hover {
    background: #f1f5f9;
}

.table-primary {
    background: #eff6ff !important;
    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 */
    }

.sidebar .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);
    }
/* ==============================
   Swing ERP Tabs
================================ */

.erp-tabs {
    border-bottom: 1px solid #8b8b8b;
    margin-bottom: 0;
    padding-left: 4px;
    gap: 1px;
    background: transparent;
}

    .erp-tabs .nav-item {
        margin-bottom: -1px;
    }

    .erp-tabs .nav-link {
        min-width: 120px;
        padding: 5px 18px;
        color: #222;
        font-size: 13px;
        font-weight: 600;
        background: linear-gradient(to bottom,#efefef,#cfcfcf);
        border: 1px solid #8d8d8d;
        border-bottom: none;
        border-radius: 5px 5px 0 0;
        box-shadow: inset 0 1px 0 #ffffff, inset -1px 0 0 #f7f7f7;
        transition: none;
    }

        .erp-tabs .nav-link:hover {
            background: linear-gradient(to bottom,#f7f7f7,#d8d8d8);
            color: #000;
        }

        .erp-tabs .nav-link.active {
            background: var(--panel-bg);
            color: #000;
            border: 1px solid #8d8d8d;
            border-bottom: 1px solid var(--panel-bg);
            box-shadow: inset 0 1px 0 #ffffff;
            position: relative;
            z-index: 5;
        }

.erp-tab-content {
    background: var(--panel-bg);
    border: 1px solid #8d8d8d;
    padding: 8px;
    margin-top: -1px;
    box-shadow: inset 0 1px 0 #ffffff, inset 1px 0 0 #ffffff;
}