/* ========================================
   PRODUCTS PAGE STYLES
   ======================================== */

/* Page Wrapper - Compact */
.pd-wrapper {
    width: 100%;
    height: calc(100vh - 60px);
    overflow: hidden;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    position: relative;
}

.pd-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    position: relative;
    z-index: var(--z-base);
}

/* ========================================
   LOADING SPINNER
   ======================================== */

.pd-spinner-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-light);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

.pd-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.pd-spinner-ring {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-primary);
    border-top-color: var(--accent-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

.pd-spinner p {
    color: var(--text-body);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    letter-spacing: var(--tracking-wide);
}

.pd-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 20px;
}

.pd-loader-ring {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-primary);
    border-top-color: var(--accent-primary);
    border-radius: var(--radius-full);
    animation: spin 1.2s linear infinite;
}

.pd-loading p {
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: var(--font-regular);
    margin: 0;
    letter-spacing: var(--tracking-wide);
}

/* ========================================
   HEADER SECTION
   ======================================== */

.pd-header {
    background: var(--surface);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: var(--space-lg) var(--space-xl);
    margin: var(--space-lg) var(--space-xl);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.pd-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-primary);
}

.pd-header-content {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.pd-header-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent-primary);
}

.pd-header-text {
    flex: 1;
}

.pd-title {
    margin: 0;
    font-family: var(--font-serif);
    font-size: var(--text-2xl);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-tight);
}

.pd-subtitle {
    margin: 4px 0 0 0;
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    font-weight: var(--font-regular);
    letter-spacing: var(--tracking-normal);
}

/* ========================================
   MAIN LAYOUT - Full Width
   ======================================== */

.pd-main-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
    padding: var(--space-lg) var(--space-xl);
}

.pd-grid-panel,
.pd-details-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: transparent;
}

.pd-panel-card {
    background: var(--surface);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: background var(--transition-slow);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.pd-panel-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.pd-panel-header h3 {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.pd-panel-header h3 i {
    color: var(--accent-primary);
    font-size: 16px;
}

.pd-editing-badge {
    font-family: var(--font-numeric);
    font-variant-numeric: tabular-nums;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    padding: 6px 14px;
    background: var(--accent-primary);
    color: var(--on-accent);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: var(--tracking-wide);
}

.pd-new-badge {
    font-family: var(--font-numeric);
    font-variant-numeric: tabular-nums;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    padding: 6px 14px;
    background: var(--accent-secondary);
    color: var(--on-accent);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: var(--tracking-wide);
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* ========================================
   TOOLBAR
   ======================================== */

.pd-grid-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pd-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-xl);
    border-bottom: 1px solid var(--border-primary);
    background: var(--surface);
}

.pd-toolbar-spacer {
    flex: 1;
}

.pd-btn-new {
    background: var(--accent-primary);
    color: var(--on-accent);
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 22px;
    font-family: var(--font-sans);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pd-btn-new:hover {
    background: var(--accent-secondary);
    box-shadow: var(--shadow-accent-sm);
    transform: translateY(-1px);
}

/* ========================================
   SEARCH BOX
   ======================================== */

.pd-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 280px;
}

.pd-search-box i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: var(--text-sm);
    pointer-events: none;
}

.pd-search-input {
    width: 100%;
    padding: 10px 36px 10px 38px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    color: var(--text-body);
    background: var(--surface);
    transition: all var(--transition-base);
}

.pd-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.pd-search-input::placeholder {
    color: var(--text-muted);
}

.pd-search-clear {
    position: absolute;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.pd-search-clear:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ========================================
   DATA GRID
   ======================================== */

.pd-grid-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pd-grid-header {
    display: grid;
    grid-template-columns: 140px 1fr 130px 100px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: var(--text-primary);
}

.pd-grid-cell {
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.pd-grid-header .pd-grid-cell {
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

.pd-grid-header .pd-grid-cell:hover {
    background: var(--surface-warm);
}

.pd-grid-header .pd-grid-cell i {
    font-size: 10px;
    color: var(--accent-primary);
}

.pd-grid-body {
    flex: 1;
    overflow-y: auto;
    background: var(--surface);
}

.pd-grid-body::-webkit-scrollbar {
    width: 4px;
}

.pd-grid-body::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.pd-grid-body::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: var(--radius-md);
}

.pd-grid-row {
    display: grid;
    grid-template-columns: 140px 1fr 130px 100px;
    border-bottom: 1px solid var(--border-primary);
    transition: all var(--transition-fast);
}

.pd-grid-row:hover {
    background: var(--surface-warm);
}

.pd-grid-row.pd-row-selected {
    background: var(--accent-light);
    border-left: 3px solid var(--accent-primary);
}

.pd-col-actions {
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.pd-btn-edit {
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

.pd-btn-edit:hover {
    background: var(--accent-primary);
    color: var(--on-accent);
    border-color: var(--accent-primary);
}

.pd-col-code {
    padding: 14px 16px;
}

.pd-col-desc {
    padding: 14px 16px;
}

.pd-col-lab {
    padding: 14px 16px;
    display: flex;
    align-items: center;
}

.pd-product-code {
    font-family: var(--font-numeric);
    font-variant-numeric: tabular-nums;
    font-weight: var(--font-medium);
    color: var(--accent-primary);
    font-size: var(--text-sm);
    letter-spacing: var(--tracking-wide);
}

.pd-product-desc {
    color: var(--text-body);
    font-size: var(--text-sm);
    font-weight: var(--font-regular);
}

/* ========================================
   BADGES
   ======================================== */

.pd-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
}

.pd-badge-success {
    background: var(--accent-primary);
    color: var(--on-accent);
}

.pd-badge-secondary {
    background: var(--border-primary);
    color: var(--text-muted);
}

.pd-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.pd-no-results i {
    font-size: 48px;
    color: var(--border-secondary);
}

.pd-no-results p {
    color: var(--text-muted);
    font-size: var(--text-base);
    margin: 0;
}

/* ========================================
   PAGINATION
   ======================================== */

.pd-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

.pd-page-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-primary);
    background: var(--surface);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-body);
    transition: all var(--transition-fast);
}

.pd-page-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    color: var(--on-accent);
    border-color: var(--accent-primary);
}

.pd-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pd-page-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--text-sm);
    color: var(--text-body);
}

.pd-page-info strong {
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.pd-page-divider {
    color: var(--border-secondary);
}

/* ========================================
   DETAILS PANEL
   ======================================== */

.pd-details-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl);
    padding-left: calc(var(--space-xl) * 1.5);
    padding-right: calc(var(--space-xl) * 1.5);
    width: 100%;
}

.pd-details-content::-webkit-scrollbar {
    width: 4px;
}

.pd-details-content::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.pd-details-content::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: var(--radius-md);
}

/* Edit Page Layout - Two Column for Large Screens */
.pd-edit-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    width: 100%;
}

@media (min-width: 1200px) {
    .pd-edit-layout {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xl);
    }

    .pd-section-full {
        grid-column: 1 / -1;
    }
}

/* ========================================
   FORM SECTIONS
   ======================================== */

.pd-section {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--space-xl);
    border: 1px solid var(--border-primary);
    transition: all var(--transition-slow);
    height: fit-content;
}

.pd-section:hover {
    box-shadow: var(--shadow-sm);
}

.pd-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-primary);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
}

.pd-section-title i {
    font-size: 14px;
    color: var(--accent-primary);
    opacity: 0.8;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.pd-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.pd-form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.pd-form-group label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    letter-spacing: var(--tracking-normal);
}

.pd-span-2 {
    grid-column: span 1;
}

.pd-input,
.pd-select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    color: var(--text-body);
    background: var(--surface);
    transition: all var(--transition-base);
}

.pd-input:focus,
.pd-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.pd-input::placeholder {
    color: var(--text-muted);
}

.pd-input:disabled,
.pd-select:disabled {
    background: var(--bg-secondary);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ========================================
   TOGGLE SWITCH
   ======================================== */

.pd-active-toggle {
    grid-column: span 1;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
}

.pd-toggle-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-primary);
    margin: 0;
    letter-spacing: var(--tracking-wide);
}

.pd-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.pd-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.pd-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-secondary);
    transition: var(--transition-base);
    border-radius: 26px;
}

.pd-switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--on-accent);
    transition: var(--transition-base);
    border-radius: var(--radius-full);
}

.pd-switch input:checked + .pd-switch-slider {
    background-color: var(--accent-primary);
}

.pd-switch input:checked + .pd-switch-slider:before {
    transform: translateX(22px);
}

/* ========================================
   CHECKBOX
   ======================================== */

.pd-checkbox-group {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.pd-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.pd-checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pd-checkbox-mark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.pd-checkbox input:checked ~ .pd-checkbox-mark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.pd-checkbox input:checked ~ .pd-checkbox-mark::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--on-accent);
    font-size: var(--text-xs);
}

.pd-checkbox-label {
    font-size: var(--text-sm);
    font-weight: var(--font-regular);
    color: var(--text-body);
}

/* ========================================
   INFO BOX
   ======================================== */

.pd-info-box {
    background: var(--accent-light);
    border-left: 3px solid var(--accent-primary);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin: 16px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: var(--text-sm);
    color: var(--text-body);
    line-height: var(--leading-relaxed);
}

.pd-info-box i {
    font-size: 14px;
    color: var(--accent-primary);
    margin-top: 2px;
}

/* ========================================
   LAB TESTS MANAGEMENT
   ======================================== */

.pd-lab-tests-container {
    margin-top: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    border: 1px solid var(--border-primary);
}

.pd-lab-tests-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-primary);
}

.pd-lab-tests-header h4 {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.pd-lab-tests-header h4 i {
    color: var(--accent-primary);
    font-size: 14px;
}

.pd-btn-add-test {
    background: var(--accent-primary);
    color: var(--on-accent);
    border: none;
    border-radius: var(--radius-md);
    padding: 8px 18px;
    font-family: var(--font-sans);
    font-weight: var(--font-semibold);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pd-btn-add-test:hover {
    background: var(--accent-secondary);
    box-shadow: var(--shadow-accent-sm);
}

.pd-tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1px;
    max-height: 320px;
    overflow-y: auto;
    padding: 0;
    background: var(--border-primary);
    border: 1px solid var(--border-primary);
}

.pd-tests-grid::-webkit-scrollbar {
    width: 4px;
}

.pd-tests-grid::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.pd-tests-grid::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: var(--radius-md);
}

.pd-test-card {
    background: var(--surface);
    border: none;
    border-radius: 0;
    padding: 16px;
    transition: all var(--transition-slow);
}

.pd-test-card:hover {
    background: var(--surface-warm);
}

.pd-test-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-primary);
}

.pd-test-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    flex: 1;
    letter-spacing: var(--tracking-wide);
}

.pd-test-actions {
    display: flex;
    gap: 6px;
}

.pd-test-edit-btn,
.pd-test-delete-btn {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    transition: all var(--transition-base);
    background: var(--surface);
}

.pd-test-edit-btn {
    color: var(--accent-primary);
}

.pd-test-edit-btn:hover {
    background: var(--accent-primary);
    color: var(--on-accent);
    border-color: var(--accent-primary);
}

.pd-test-delete-btn {
    color: var(--error);
}

.pd-test-delete-btn:hover {
    background: var(--error-light);
    border-color: var(--error);
}

.pd-test-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pd-test-spec {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-sm);
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin: 6px 0;
}

.pd-spec-label {
    color: var(--text-secondary);
    font-weight: var(--font-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    font-size: 11px;
}

.pd-spec-value {
    color: var(--text-primary);
    font-weight: var(--font-bold);
    font-family: var(--font-numeric);
    font-variant-numeric: tabular-nums;
    font-size: var(--text-base);
}

.pd-test-spec-scope {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    padding: 8px 10px;
    background: var(--accent-light);
    border-radius: var(--radius-md);
    margin-top: 6px;
    border-left: 2px solid var(--accent-primary);
}

.pd-test-spec-scope .pd-spec-label {
    color: var(--accent-primary);
}

.pd-test-spec-scope .pd-spec-value {
    color: var(--accent-primary);
}

/* ========================================
   ACTION BUTTONS
   ======================================== */

.pd-actions {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--surface);
    border-top: 1px solid var(--border-primary);
    justify-content: flex-end;
}

.pd-btn-save {
    background: var(--accent-primary);
    color: var(--on-accent);
    border: none;
    border-radius: var(--radius-md);
    padding: 9px 20px;
    font-family: var(--font-sans);
    font-weight: var(--font-semibold);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pd-btn-save:hover:not(:disabled) {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-accent-sm);
}

.pd-btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pd-btn-delete {
    background: var(--surface);
    color: var(--error);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 9px 20px;
    font-family: var(--font-sans);
    font-weight: var(--font-semibold);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pd-btn-delete:hover:not(:disabled) {
    background: var(--error-light);
    border-color: var(--error);
    transform: translateY(-1px);
}

.pd-btn-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pd-btn-cancel {
    background: var(--surface);
    color: var(--text-body);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 9px 20px;
    font-family: var(--font-sans);
    font-weight: var(--font-semibold);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pd-btn-cancel:hover {
    background: var(--bg-secondary);
    border-color: var(--border-secondary);
}

/* ========================================
   DIALOG/MODAL
   ======================================== */

.pd-dialog-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-dark);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal-backdrop);
    animation: fadeIn var(--transition-fast) ease-out;
}

.pd-dialog {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp var(--transition-slow) ease-out;
}

.pd-lab-dialog {
    max-width: 600px;
}

.pd-dialog-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-primary);
    position: relative;
}

.pd-dialog-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-primary);
}

.pd-dialog-header span {
    flex: 1;
    font-family: var(--font-serif);
    font-size: var(--text-xl);
    font-weight: var(--font-regular);
    color: var(--text-primary);
    letter-spacing: var(--tracking-tight);
}

.pd-dialog-header i:first-child {
    font-size: 20px;
    color: var(--accent-primary);
}

.pd-dialog-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-primary);
    background: var(--surface);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.pd-dialog-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.pd-dialog-content {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.pd-dialog-content::-webkit-scrollbar {
    width: 4px;
}

.pd-dialog-content::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.pd-dialog-content::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: var(--radius-md);
}

.pd-dialog-content p {
    font-size: var(--text-base);
    color: var(--text-body);
    margin-bottom: 18px;
    line-height: var(--leading-relaxed);
}

.pd-dialog-product-info {
    background: var(--bg-secondary);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-primary);
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.pd-dialog-footer {
    display: flex;
    gap: 12px;
    padding: 20px 28px;
    border-top: 1px solid var(--border-primary);
    justify-content: flex-end;
    background: var(--bg-secondary);
}

.pd-dialog-btn-confirm,
.pd-dialog-btn-save {
    background: var(--accent-primary);
    color: var(--on-accent);
    border: none;
    border-radius: var(--radius-md);
    padding: 11px 26px;
    font-family: var(--font-sans);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.pd-dialog-btn-confirm:hover,
.pd-dialog-btn-save:hover {
    background: var(--accent-secondary);
}

.pd-dialog-btn-cancel {
    background: var(--surface);
    color: var(--text-body);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 11px 26px;
    font-family: var(--font-sans);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.pd-dialog-btn-cancel:hover {
    background: var(--bg-secondary);
}

/* ========================================
   SFDIALOG STYLING
   ======================================== */

/* Fix SfDialog container to not affect page layout */
.e-dlg-container {
    display: contents !important;
}

/* Ensure SfDialog backdrop covers entire viewport */
.e-dlg-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1000 !important;
}

/* Ensure SfDialog is centered on viewport */
.pd-dialog.e-dialog {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-2xl) !important;
    border: 1px solid var(--border-primary) !important;
    font-family: var(--font-sans) !important;
    z-index: 1001 !important;
}

.pd-dialog .e-dlg-header-content {
    background: var(--surface) !important;
    padding: 18px 22px !important;
    border-bottom: 1px solid var(--border-primary) !important;
    position: relative;
}

.pd-dialog .e-dlg-header-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

.pd-dialog-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    font-weight: var(--font-regular);
    color: var(--text-primary);
}

.pd-dialog-header-content i:first-child {
    color: var(--accent-primary);
    font-size: 18px;
}

.pd-dialog .e-dlg-header {
    font-family: var(--font-serif) !important;
    font-size: var(--text-lg) !important;
    font-weight: var(--font-regular) !important;
    color: var(--text-primary) !important;
}

.pd-dialog .e-dlg-closeicon-btn {
    color: var(--text-muted) !important;
    background: transparent !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: var(--radius-md) !important;
    width: 30px !important;
    height: 30px !important;
}

.pd-dialog .e-dlg-closeicon-btn:hover {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

.pd-dialog .e-dlg-content {
    padding: 20px 22px !important;
    background: var(--surface) !important;
}

.pd-dialog-footer {
    display: flex;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

.pd-dialog .e-footer-content {
    padding: 0 !important;
    background: var(--bg-secondary) !important;
}

/* ========================================
   LAB TEST DIALOG SPECIFIC
   ======================================== */

.pd-test-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    margin: 18px 0;
    padding: 0;
    background: var(--border-primary);
    border: 1px solid var(--border-primary);
}

.pd-spec-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--bg-secondary);
    padding: 18px;
}

.pd-spec-section-title {
    margin: 0 0 10px 0;
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-primary);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
}

.pd-spec-section-title i {
    color: var(--accent-primary);
    font-size: 13px;
    opacity: 0.8;
}

.pd-validation-error {
    background: var(--error-light);
    border-left: 3px solid var(--error);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin: 16px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: var(--text-sm);
    color: var(--error);
    font-weight: var(--font-medium);
    line-height: var(--leading-normal);
}

.pd-validation-error i {
    font-size: 14px;
    color: var(--error);
    margin-top: 2px;
}

.pd-validation-info {
    background: var(--accent-light);
    border-left: 3px solid var(--accent-primary);
    font-size: var(--text-sm);
    color: var(--text-body);
}

.pd-validation-info i {
    color: var(--accent-primary);
}

.pd-validation-info strong {
    color: var(--text-primary);
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.pd-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 18px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    max-width: 400px;
    z-index: var(--z-toast);
    animation: slideInRight var(--transition-slow) ease-out;
    border-left: 4px solid var(--accent-primary);
}

.pd-toast-success {
    border-left-color: var(--success);
}

.pd-toast-error {
    border-left-color: var(--error);
}

.pd-toast-info {
    border-left-color: var(--info);
}

.pd-toast-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pd-toast-success .pd-toast-icon {
    background: var(--success-light);
    color: var(--success);
}

.pd-toast-error .pd-toast-icon {
    background: var(--error-light);
    color: var(--error);
}

.pd-toast-info .pd-toast-icon {
    background: var(--info-light);
    color: var(--info);
}

.pd-toast-content {
    flex: 1;
}

.pd-toast-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: var(--tracking-wide);
}

.pd-toast-message {
    font-size: var(--text-sm);
    color: var(--text-body);
    line-height: var(--leading-normal);
}

.pd-toast-close {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.pd-toast-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1200px) {
    .pd-main-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 420px 1fr;
    }

    .pd-test-specs-grid {
        grid-template-columns: 1fr;
    }

    .pd-edit-layout {
        grid-template-columns: 1fr;
    }

    .pd-section-full {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .pd-container {
        padding: 0;
    }

    .pd-header {
        padding: var(--space-lg);
    }

    .pd-title {
        font-size: var(--text-xl);
    }

    .pd-subtitle {
        font-size: var(--text-sm);
    }

    .pd-details-content {
        padding: var(--space-lg);
    }

    .pd-form-grid {
        grid-template-columns: 1fr;
    }

    .pd-span-2 {
        grid-column: span 1;
    }

    .pd-actions {
        flex-wrap: wrap;
        padding: var(--space-lg);
    }

    .pd-btn-save,
    .pd-btn-delete,
    .pd-btn-cancel {
        flex: 1 1 auto;
        min-width: 120px;
    }

    .pd-search-box {
        width: 100%;
    }

    .pd-toolbar {
        flex-wrap: wrap;
    }

    .pd-toolbar-spacer {
        display: none;
    }

    .pd-toast {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}
