.s-site-logo-img {
  content: url(../../Serenity.Assets/logo/white-128.png);
}

/* ============================================
   DYNAMIC FORM WIZARD - TABLET STILOVI
   ============================================ */

/* SERENITY DIALOG OVERRIDES */
.s-DynamicFormWizard,
.s-DynamicFormWizard .ui-dialog-content,
.s-DynamicFormWizard .s-DialogContent,
.ui-dialog.s-DynamicFormWizard .ui-dialog-content {
    padding: 0 !important;
    overflow: hidden !important;
    background: #f5f5f5 !important;
}

.s-DynamicFormWizard .ui-dialog-titlebar,
.s-DynamicFormWizard .panel-titlebar {
    display: none !important;
}

.s-Panel.s-DynamicFormWizard > .panel-body,
.s-DynamicFormWizard > .panel-body {
    padding: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
}

.s-DynamicFormWizard .s-DialogContent {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* TABLET WIZARD - GLAVNI KONTEJNER */
.tablet-wizard-dialog {
    padding: 0;
    height: 100%;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
}

.wizard-container {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #6c757d;
    gap: 12px;
}

.loading i {
    font-size: 2rem;
    color: #667eea;
}

.wizard-loading,
.wizard-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: #6c757d;
    gap: 16px;
}

.wizard-loading i { color: #667eea; }
.wizard-error i { color: #f44336; }
.wizard-error h3 { margin: 0; color: #333; }
.wizard-error p { margin: 0; color: #6c757d; }

.error-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.tablet-wizard {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    overflow: hidden;
    min-height: 0; /* Ključno za flex children */
}

/* HEADER */
.tablet-wizard .wizard-header {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    flex-shrink: 0;
}

.tablet-wizard .wizard-header .form-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.tablet-wizard .wizard-header .form-info {
    flex: 1;
}

.tablet-wizard .wizard-header .form-title {
    margin: 0 0 4px;
    font-size: 1.2rem;
    font-weight: 600;
}

.tablet-wizard .wizard-header .form-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    opacity: 0.9;
}

.tablet-wizard .wizard-header .form-meta i {
    margin-right: 4px;
}

.tablet-wizard .patient-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* PROGRESS BAR */
.tablet-wizard .wizard-progress {
    padding: 12px 20px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.tablet-wizard .progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.tablet-wizard .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.tablet-wizard .progress-text {
    text-align: center;
    font-size: 0.85rem;
    color: #6c757d;
}

.tablet-wizard .progress-text .current-step {
    font-weight: 600;
    color: #667eea;
}

/* SECTION TABS */
.tablet-wizard .section-tabs {
    display: flex;
    overflow-x: auto;
    background: #fff;
    border-bottom: 2px solid #e0e0e0;
    flex-shrink: 0;
    padding: 0 10px;
}

.tablet-wizard .section-tabs::-webkit-scrollbar {
    height: 4px;
}

.tablet-wizard .section-tabs::-webkit-scrollbar-thumb {
    background: #bdbdbd;
    border-radius: 2px;
}

.tablet-wizard .tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: all 0.2s ease;
    color: #6c757d;
    font-size: 0.9rem;
}

.tablet-wizard .tab:hover {
    background: #f8f9fa;
    color: #333;
}

.tablet-wizard .tab.active {
    border-bottom-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

.tablet-wizard .tab.completed {
    color: #4caf50;
}

.tablet-wizard .tab-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.tablet-wizard .tab.active .tab-number {
    background: #667eea;
    color: #fff;
}

.tablet-wizard .tab.completed .tab-number {
    background: #4caf50;
    color: #fff;
}

.tablet-wizard .tab-check {
    color: #4caf50;
    font-size: 0.9rem;
}

/* SECTION CONTENT */
.tablet-wizard .section-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 0; /* Ključno za flex scroll */
}

.tablet-wizard .section-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.tablet-wizard .section-header-tablet {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #e0e0e0;
}

.tablet-wizard .section-header-tablet .section-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
}

.tablet-wizard .section-header-tablet .section-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.tablet-wizard .section-header-tablet .section-description {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: #6c757d;
}

.tablet-wizard .required-badge {
    color: #f44336;
    margin-left: 4px;
}

.tablet-wizard .section-fields-tablet {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tablet-wizard .no-sections,
.tablet-wizard .no-fields,
.tablet-wizard .no-options {
    padding: 40px;
    text-align: center;
    color: #9e9e9e;
    font-style: italic;
}

/* TABLET FIELD */
.tablet-wizard .tablet-field {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.tablet-wizard .tablet-field[data-field-type="YesNo"] {
    border-left-color: #9c27b0;
}

.tablet-wizard .tablet-field[data-field-type="Select"],
.tablet-wizard .tablet-field[data-field-type="MultiSelect"] {
    border-left-color: #ff9800;
}

.tablet-wizard .tablet-field[data-field-type="Number"],
.tablet-wizard .tablet-field[data-field-type="Decimal"] {
    border-left-color: #4caf50;
}

.tablet-wizard .tablet-field[data-field-type="Signature"] {
    border-left-color: #f44336;
}

.tablet-wizard .field-label-tablet {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
    font-size: 1rem;
}

.tablet-wizard .field-icon {
    width: 28px;
    height: 28px;
    background: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 0.9rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tablet-wizard .required-star {
    color: #f44336;
}

.tablet-wizard .field-unit {
    color: #6c757d;
    font-weight: 400;
    font-size: 0.85rem;
}

.tablet-wizard .field-input-tablet {
    margin-bottom: 8px;
}

.tablet-wizard .field-help-tablet {
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tablet-wizard .field-help-tablet i {
    color: #2196f3;
}

/* TABLET INPUTS */
.tablet-wizard .tablet-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #fff;
    box-sizing: border-box;
}

.tablet-wizard .tablet-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.tablet-wizard .tablet-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Number Input Group */
.tablet-wizard .number-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tablet-wizard .number-input-group .tablet-input {
    text-align: center;
    flex: 1;
}

.tablet-wizard .num-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    color: #667eea;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tablet-wizard .num-btn:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* YESNO BUTTONS */
.tablet-wizard .yesno-buttons {
    display: flex;
    gap: 12px;
}

.tablet-wizard .yesno-btn {
    flex: 1;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tablet-wizard .yesno-btn.yes:hover,
.tablet-wizard .yesno-btn.yes.selected {
    background: #4caf50;
    color: #fff;
    border-color: #4caf50;
}

.tablet-wizard .yesno-btn.no:hover,
.tablet-wizard .yesno-btn.no.selected {
    background: #f44336;
    color: #fff;
    border-color: #f44336;
}

/* SELECT / MULTISELECT BUTTONS */
.tablet-wizard .select-buttons,
.tablet-wizard .multiselect-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tablet-wizard .select-btn,
.tablet-wizard .multiselect-btn {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tablet-wizard .select-btn:hover,
.tablet-wizard .select-btn.selected {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.tablet-wizard .multiselect-btn:hover {
    border-color: #667eea;
}

.tablet-wizard .multiselect-btn.selected {
    background: #e8eaf6;
    border-color: #667eea;
    color: #667eea;
}

.tablet-wizard .multiselect-btn .check-icon {
    color: #bdbdbd;
}

.tablet-wizard .multiselect-btn.selected .check-icon {
    color: #667eea;
}

/* RATING STARS */
.tablet-wizard .rating-stars {
    display: flex;
    gap: 8px;
}

.tablet-wizard .rating-stars .star {
    font-size: 2rem;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tablet-wizard .rating-stars .star:hover,
.tablet-wizard .rating-stars .star.active {
    color: #ffc107;
    transform: scale(1.1);
}

/* SLIDER */
.tablet-wizard .slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tablet-wizard .slider-min,
.tablet-wizard .slider-max {
    font-size: 0.85rem;
    color: #6c757d;
}

.tablet-wizard .tablet-slider {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    background: #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
}

.tablet-wizard .tablet-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

.tablet-wizard .slider-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: #667eea;
}

/* SIGNATURE */
.tablet-wizard .signature-section {
    margin-top: 24px;
    padding: 16px;
    background: #fff5f5;
    border-radius: 10px;
    border: 2px dashed #f44336;
}

.tablet-wizard .signature-section h4 {
    margin: 0 0 8px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tablet-wizard .signature-instruction {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: #6c757d;
}

.tablet-wizard .signature-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tablet-wizard .signature-canvas {
    height: 120px;
    background: #fff;
    border: 2px dashed #bdbdbd;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #9e9e9e;
    cursor: crosshair;
}

.tablet-wizard .signature-canvas i {
    font-size: 2rem;
    color: #667eea;
}

.tablet-wizard .clear-signature {
    align-self: flex-end;
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    color: #6c757d;
}

.tablet-wizard .clear-signature:hover {
    background: #f5f5f5;
}

/* NAVIGATION */
.tablet-wizard .wizard-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.tablet-wizard .btn-prev,
.tablet-wizard .btn-next,
.tablet-wizard .btn-complete {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.tablet-wizard .btn-prev {
    background: #f5f5f5;
    color: #6c757d;
}

.tablet-wizard .btn-prev:hover:not(:disabled) {
    background: #e0e0e0;
}

.tablet-wizard .btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tablet-wizard .btn-next {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.tablet-wizard .btn-next:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.tablet-wizard .btn-complete {
    background: linear-gradient(135deg, #4caf50 0%, #8bc34a 100%);
    color: #fff;
}

.tablet-wizard .btn-complete:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* Section Indicator Dots */
.tablet-wizard .section-indicator {
    display: flex;
    gap: 8px;
}

.tablet-wizard .section-indicator .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tablet-wizard .section-indicator .dot:hover {
    transform: scale(1.2);
}

.tablet-wizard .section-indicator .dot.active {
    background: #667eea;
    transform: scale(1.3);
}

.tablet-wizard .section-indicator .dot.completed {
    background: #4caf50;
}

/* Page Info */
.tablet-wizard .page-info {
    font-size: 0.95rem;
    color: #6c757d;
    font-weight: 500;
    background: #f0f0f0;
    padding: 8px 16px;
    border-radius: 20px;
}

/* ============================================
   CRITICAL FIX: Serenity Panel/Dialog Layout
   ============================================ */

/* Target s-Panel which wraps the dialog */
.s-Panel.s-DynamicFormWizard {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.s-Panel.s-DynamicFormWizard > .panel-body {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 !important;
}

/* All nested containers */
.s-DynamicFormWizard .s-DialogContent,
.s-DynamicFormWizard .tablet-wizard-dialog,
.s-DynamicFormWizard .wizard-container {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* The main wizard container */
.s-DynamicFormWizard .tablet-wizard {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* Fixed height elements - these should NOT grow or shrink */
.s-DynamicFormWizard .wizard-header {
    flex: 0 0 auto !important;
}

.s-DynamicFormWizard .wizard-progress {
    flex: 0 0 auto !important;
}

.s-DynamicFormWizard .section-tabs {
    flex: 0 0 auto !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}

.s-DynamicFormWizard .wizard-navigation {
    flex: 0 0 auto !important;
}

/* THE KEY: Section content - uses calc to fill remaining space */
.s-DynamicFormWizard .section-content {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 200px !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Hide Serenity's default titlebar if present */
.s-DynamicFormWizard .panel-titlebar {
    display: none !important;
}

/* Ensure the dialog has proper height constraints and is resizable */
.ui-dialog.s-DynamicFormWizard,
.s-Panel.s-DynamicFormWizard {
    max-height: 95vh !important;
    resize: both !important;
    overflow: hidden !important;
    min-width: 600px !important;
    min-height: 500px !important;
}

/* Resize handle styling */
.s-Panel.s-DynamicFormWizard::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 20px;
    height: 20px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 50%, #667eea 50%);
    border-radius: 0 0 8px 0;
    opacity: 0.5;
}

.s-Panel.s-DynamicFormWizard:hover::after {
    opacity: 1;
}

