/* ==========================================================================
   CMCLAB - Global Design System & Unified Color Palette
   Established from Master Management Center
   ========================================================================== */

:root {
    /* Core Brand Accents */
    --cmc-teal: #127968;
    --cmc-teal-dark: #0d5d50;
    --cmc-teal-light: #e6f4f1;
    --cmc-teal-border: #c8e6c9;

    --cmc-mint: #00a78e;
    --cmc-mint-dark: #00826e;
    --cmc-mint-light: #e0f7f4;
    --cmc-mint-border: #b2dfdb;

    /* Entity Accents */
    --accent-doctor: #127968;
    --accent-dept: #00a78e;
    --accent-subdept: #2980b9;
    --accent-subdept-dark: #1f618d;
    --accent-subdept-light: #ebf5fb;
    --accent-subdept-border: #aed6f1;

    --accent-test: #8e44ad;
    --accent-test-dark: #6c3483;
    --accent-test-light: #f4ecf7;
    --accent-test-border: #d7bde2;

    --accent-specimen: #c0392b;
    --accent-specimen-dark: #922b21;
    --accent-specimen-light: #fdedec;
    --accent-specimen-border: #f5b7b1;

    --accent-room: #d35400;
    --accent-room-dark: #a04000;
    --accent-room-light: #fbeee6;
    --accent-room-border: #edbb99;

    --accent-ref: #16a085;
    --accent-ref-dark: #117a65;
    --accent-ref-light: #e8f8f5;
    --accent-ref-border: #a2d9ce;

    /* Neutrals & Surfaces */
    --surface-bg: #f8faf9;
    --surface-card: #ffffff;
    --surface-border: #d5e1df;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
}

/* Base Adjustments */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

body {
    background-color: #f4f7f6;
    color: var(--text-primary);
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
}

/* Modern Form Controls */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    font-family: inherit;
    font-size: 13px;
    padding: 7px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background-color: #ffffff;
    color: var(--text-primary);
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--cmc-teal);
    outline: none;
    box-shadow: 0 0 0 3px rgba(18, 121, 104, 0.18);
}

/* Consistent Buttons */
.f-address button,
.f-address input[type="submit"] {
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 18px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.f-address button[asp-page-handler="Save"],
.f-address button[asp-page-handler="Search"],
.f-address button[type="submit"]:not([asp-page-handler="Cancel"]):not([asp-page-handler="Delete"]) {
    background: var(--cmc-teal);
    color: #ffffff;
}

.f-address button[asp-page-handler="Save"]:hover,
.f-address button[asp-page-handler="Search"]:hover {
    background: var(--cmc-teal-dark);
}

.f-address button[asp-page-handler="Cancel"],
.f-address button[type="button"].btn-cancel {
    background: #e2e8f0;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.f-address button[asp-page-handler="Cancel"]:hover {
    background: #cbd5e1;
    color: #1e293b;
}

.f-address button[asp-page-handler="Delete"] {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.f-address button[asp-page-handler="Delete"]:hover {
    background: #dc2626;
    color: #ffffff;
}

/* Master Header Cards */
.master-header-banner {
    padding: 12px 18px;
    border-radius: 6px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Modernized Grid Style */
table.gridstyle {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

table.gridstyle thead th {
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border: none;
}

table.gridstyle tbody td {
    padding: 8px 12px;
    font-size: 13px;
    border-bottom: 1px solid #eef2f1;
    vertical-align: middle;
}

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

table.gridstyle tbody tr:hover {
    background-color: #f0f7f6 !important;
}

/* Status Badges */
.status-badge-active {
    background: #e8f5e9;
    color: #1e7e34;
    border: 1px solid #a5d6a7;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    letter-spacing: 0.3px;
}

.status-badge-inactive {
    background: #fbe9e7;
    color: #c62828;
    border: 1px solid #ffccbc;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
    letter-spacing: 0.3px;
}

/* Action Buttons (Activate / Deactivate) */
.btn-toggle-deactivate {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-toggle-deactivate:hover {
    background: #ea580c;
    color: #ffffff;
    border-color: #ea580c;
}

.btn-toggle-activate {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-toggle-activate:hover {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
}

/* ==========================================================================
   Global Polish for Patient & Parameter Pages (Haemogram, Micro, Stool, etc.)
   ========================================================================== */

/* Automatically unify all section headers across test & patient pages */
.banner-slider .header .top-nav {
    padding: 10px 16px !important;
    background: linear-gradient(135deg, #127968 0%, #00a78e 100%) !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 6px rgba(18, 121, 104, 0.2) !important;
    margin-bottom: 8px !important;
}

.banner-slider .header .top-nav ul li {
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
    color: #ffffff !important;
}

/* Patient & Parameter Grid Headers */
.banner-slider table.gridstyle thead tr,
.banner-slider table thead tr[style*="background"] {
    background: #127968 !important;
    color: #ffffff !important;
    height: 34px !important;
}

.banner-slider table.gridstyle thead th,
.banner-slider table thead th {
    padding: 8px 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

.banner-slider table.gridstyle tbody tr {
    background-color: #ffffff !important;
    transition: background-color 0.15s ease;
}

.banner-slider table.gridstyle tbody tr:nth-child(even) {
    background-color: #f8faf9 !important;
}

.banner-slider table.gridstyle tbody tr:hover {
    background-color: #eef7f5 !important;
}

/* Contact Info / Patient Details Grids */
table.contact-info-grids td {
    padding: 5px 8px;
    font-size: 13px;
}

table.contact-info-grids h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ==========================================================================
   Login & Authentication Screen Design System
   ========================================================================== */
.spectrum-bar {
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, #127968 0%, #00a78e 20%, #2980b9 40%, #8e44ad 60%, #c0392b 80%, #d35400 100%);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.login-card {
    display: flex;
    width: 100%;
    max-width: 940px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 20px 45px -10px rgba(18, 121, 104, 0.18), 0 8px 24px -6px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(18, 121, 104, 0.15);
    overflow: hidden;
    min-height: 540px;
}

.card-hero {
    flex: 1.15;
    background: linear-gradient(145deg, #094038 0%, #127968 55%, #00a78e 100%);
    padding: 44px 38px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.card-form-wrapper {
    flex: 1.1;
    padding: 44px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #ffffff;
}

.login-input {
    width: 100% !important;
    height: 44px;
    padding: 10px 14px 10px 38px !important;
    font-size: 13.5px !important;
    font-family: inherit !important;
    color: #1e293b !important;
    background-color: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    transition: all 0.18s ease-in-out !important;
}

.login-input:focus {
    background-color: #ffffff !important;
    border-color: var(--cmc-teal) !important;
    box-shadow: 0 0 0 3px rgba(18, 121, 104, 0.18) !important;
    outline: none !important;
}

.submit-btn {
    width: 100%;
    height: 46px;
    background: linear-gradient(135deg, #127968 0%, #00a78e 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(18, 121, 104, 0.28);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #0d5d50 0%, #00826e 100%);
    box-shadow: 0 6px 16px rgba(18, 121, 104, 0.35);
    transform: translateY(-1px);
}

/* ==========================================================================
   Universal Quick Add Modal Dialogs
   ========================================================================== */
.quick-modal-backdrop {
    display: none;
    position: fixed !important;
    z-index: 999999 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.55) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 16px !important;
    box-sizing: border-box !important;
}

.quick-modal-box {
    background: #ffffff !important;
    border-radius: 8px !important;
    padding: 22px 24px !important;
    width: 420px !important;
    max-width: 94vw !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.06) !important;
    position: relative !important;
    box-sizing: border-box !important;
    animation: quickModalPop 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes quickModalPop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==========================================================================
   Custom Global Alert & Confirmation Dialog System (Replaces Native Alert/Confirm)
   ========================================================================== */
.cmc-dialog-backdrop {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10000000 !important;
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.18s ease !important;
}

.cmc-dialog-backdrop.cmc-dialog-open {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.cmc-dialog-card {
    background: #ffffff !important;
    border-radius: 12px !important;
    padding: 24px 26px !important;
    width: 440px !important;
    max-width: 94vw !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.06) !important;
    transform: scale(0.95) translateY(-8px) !important;
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
}

.cmc-dialog-backdrop.cmc-dialog-open .cmc-dialog-card {
    transform: scale(1) translateY(0) !important;
}

.cmc-dialog-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #127968;
}

.cmc-dialog-card.cmc-type-warning::before {
    background: #f59e0b;
}

.cmc-dialog-card.cmc-type-danger::before,
.cmc-dialog-card.cmc-type-error::before {
    background: #e11d48;
}

.cmc-dialog-card.cmc-type-success::before {
    background: #10b981;
}

.cmc-dialog-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.cmc-dialog-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
    background: #e6f4f1;
    color: #127968;
}

.cmc-dialog-card.cmc-type-warning .cmc-dialog-icon {
    background: #fef3c7;
    color: #d97706;
}

.cmc-dialog-card.cmc-type-danger .cmc-dialog-icon,
.cmc-dialog-card.cmc-type-error .cmc-dialog-icon {
    background: #ffe4e6;
    color: #e11d48;
}

.cmc-dialog-card.cmc-type-success .cmc-dialog-icon {
    background: #d1fae5;
    color: #059669;
}

.cmc-dialog-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    flex: 1 !important;
}

.cmc-dialog-body {
    font-size: 13.5px !important;
    line-height: 1.55 !important;
    color: #475569 !important;
    margin: 0 0 22px 0 !important;
    word-break: break-word !important;
}

.cmc-dialog-actions {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 10px !important;
}

.cmc-btn-dialog {
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 7px 18px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    border: none !important;
    transition: all 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.cmc-btn-dialog-cancel {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}

.cmc-btn-dialog-cancel:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

.cmc-btn-dialog-confirm {
    background: linear-gradient(135deg, #127968 0%, #00a78e 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(18, 121, 104, 0.28) !important;
}

.cmc-btn-dialog-confirm:hover {
    background: linear-gradient(135deg, #0d5d50 0%, #00826e 100%) !important;
    box-shadow: 0 4px 10px rgba(18, 121, 104, 0.38) !important;
}

.cmc-btn-dialog-danger {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(225, 29, 72, 0.28) !important;
}

.cmc-btn-dialog-danger:hover {
    background: linear-gradient(135deg, #be123c 0%, #9f1239 100%) !important;
    box-shadow: 0 4px 10px rgba(225, 29, 72, 0.38) !important;
}

/* ==========================================================================
   Custom Floating Toasts
   ========================================================================== */
.cmc-toast-container {
    position: fixed !important;
    top: 20px !important;
    right: 24px !important;
    z-index: 10000001 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    pointer-events: none !important;
    max-width: 420px !important;
    width: calc(100vw - 48px) !important;
}

.cmc-toast {
    pointer-events: auto !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14), 0 1px 3px rgba(0, 0, 0, 0.06) !important;
    padding: 12px 16px !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    border-left: 4px solid #127968 !important;
    animation: cmcToastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
    box-sizing: border-box !important;
}

.cmc-toast.cmc-toast-warning {
    border-left-color: #f59e0b !important;
}

.cmc-toast.cmc-toast-error {
    border-left-color: #e11d48 !important;
}

.cmc-toast.cmc-toast-success {
    border-left-color: #10b981 !important;
}

.cmc-toast.cmc-toast-info {
    border-left-color: #127968 !important;
}

.cmc-toast-icon {
    font-size: 18px !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    margin-top: 1px !important;
}

.cmc-toast-content {
    flex: 1 !important;
    min-width: 0 !important;
}

.cmc-toast-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 0 2px 0 !important;
}

.cmc-toast-message {
    font-size: 12.5px !important;
    color: #475569 !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    word-break: break-word !important;
}

.cmc-toast-close {
    background: none !important;
    border: none !important;
    font-size: 16px !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    padding: 0 0 0 8px !important;
    line-height: 1 !important;
    transition: color 0.15s ease !important;
}

.cmc-toast-close:hover {
    color: #334155 !important;
}

@keyframes cmcToastIn {
    from {
        opacity: 0;
        transform: translateX(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}



