/* ================================================================ */
/* MODAL PREFERINTE UTILIZATOR                                       */
/* Fisier: /isu-core/setari/css/setari-profil.css                   */
/* ================================================================ */

/* ---- OVERLAY ---- */
.ssm-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: ssmFadeIn .18s ease;
}
@keyframes ssmFadeIn { from { opacity:0 } to { opacity:1 } }

.ssm-modal-wrapper {
    width: 100%; max-width: 720px;
    animation: ssmSlideUp .22s ease;
}
@keyframes ssmSlideUp {
    from { transform:translateY(-14px); opacity:0 }
    to   { transform:translateY(0);     opacity:1 }
}

/* ---- CONTAINER ---- */
.ssm-modal-container {
    background: #fff;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 24px 64px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
    height: 82vh;
    max-height: 780px;
    min-height: 420px;
    overflow: hidden;
}

/* ---- HEADER ---- */
.ssm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #f3f4f6;
    flex-shrink: 0;
}
.ssm-modal-header-left {
    display: flex; align-items: center; gap: 9px; color: #6b7280;
}
.ssm-modal-title {
    margin: 0; font-size: 16px; font-weight: 500; color: #111827;
}
.ssm-modal-close-btn {
    width: 30px; height: 30px; border-radius: 8px;
    background: #f9fafb; border: 1px solid #e5e7eb;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; color: #9ca3af;
    transition: background .15s, color .15s; flex-shrink: 0;
}
.ssm-modal-close-btn:hover { background: #f3f4f6; color: #374151; }

/* ---- BODY ---- */
.ssm-modal-body { display: flex; flex: 1; overflow: hidden; }

/* ---- SIDEBAR ---- */
.ssm-modal-sidebar {
    width: 230px; flex-shrink: 0;
    border-right: 1px solid #f3f4f6;
    background: #fafafa;
    padding: 14px 10px;
    display: flex; flex-direction: column;
}
.ssm-modal-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }

.ssm-nav-btn {
    width: 100%; text-align: left;
    padding: 8px 11px; border-radius: 8px;
    border: none; background: transparent;
    font-size: 14px; color: #374151; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    transition: background .13s, color .13s; font-family: inherit;
}
.ssm-nav-btn:hover { background: #eff6ff; color: #1d4ed8; }
.ssm-nav-btn.active { background: #eff6ff; color: #1d4ed8; }
.ssm-nav-btn.active svg { stroke: #1d4ed8; }

.ssm-sidebar-footer { padding-top: 10px; border-top: 1px solid #f0f0f0; margin-top: 8px; }
.ssm-sidebar-link {
    display: flex; align-items: center; gap: 7px;
    padding: 7px 10px; border-radius: 7px;
    font-size: 12px; color: #374151; text-decoration: none;
    transition: background .13s, color .13s;
}
.ssm-sidebar-link:hover { background: #f0f0f0; color: #374151; }

/* ---- CONTINUT TAB-URI ---- */
.ssm-modal-content { flex: 1; overflow: hidden; position: relative; }
.ssm-tab-panel { display: none; height: 100%; }
.ssm-tab-panel.active { display: block; }

.ssm-tab-scroll {
    height: 100%; overflow-y: auto;
    padding: 22px 26px;
    max-height: calc(82vh - 120px);
    box-sizing: border-box;
}
.ssm-tab-scroll::-webkit-scrollbar { width: 5px; }
.ssm-tab-scroll::-webkit-scrollbar-track { background: transparent; }
.ssm-tab-scroll::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* ---- AVATAR (squircle prin DaisyUI mask mask-squircle) ---- */
.ssm-avatar-row {
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 22px; padding-bottom: 22px;
    border-bottom: 1px solid #f3f4f6;
}
.ssm-avatar {
    width: 58px; height: 58px;
    background: linear-gradient(135deg,#3b82f6,#1d4ed8);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700; color: #fff; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(59,130,246,.35);
    overflow: hidden;
    position: relative;
    /* DaisyUI mask mask-squircle se ocupă de formă */
}
.ssm-avatar-img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.ssm-avatar-initial {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    font-size: 22px; font-weight: 700; color: #fff;
}
.ssm-avatar-name { font-weight: 600; font-size: 18px; color: #111827; }
.ssm-avatar-role { font-size: 12.5px; color: #6b7280; margin-top: 3px; }
.ssm-avatar-change-btn {
    margin-top: 6px; font-size: 12px; color: #3b82f6;
    background: none; border: none; cursor: pointer;
    padding: 0; font-family: inherit;
}
.ssm-avatar-change-btn:hover { color: #1d4ed8; text-decoration: underline; }

/* ---- FORMULAR ---- */
.ssm-form-group { margin-bottom: 15px; }
.ssm-form-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ssm-form-label {
    display: block; font-size: 14px; font-weight: 500;
    color: #111827; margin-bottom: 5px;
}
.ssm-form-input {
    width: 100%; padding: 8px 11px;
    border: 1px solid #e5e7eb; border-radius: 8px;
    font-size: 14px; color: #111827; background: #f9fafb;
    box-sizing: border-box; font-family: inherit;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.ssm-form-input.ssm-mono {
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: .06em; font-size: 12.5px;
}
.ssm-form-input:focus {
    outline: none; border-color: #3b82f6; background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* ---- DIVIDER & TITLU SECTIUNE ---- */
.ssm-divider { border: none; border-top: 1px solid #f3f4f6; margin: 20px 0; }
.ssm-section-title {
    font-size: 14px; font-weight: 500; color: #111827;
    margin-bottom: 12px;
}

/* ---- SWITCH ---- */
.ssm-switch-row {
    display: flex; justify-content: space-between; align-items: center;
    gap: 14px; padding: 9px 12px; margin: 0 -12px 2px;
    border-radius: 8px; cursor: pointer; transition: background .13s;
}
.ssm-switch-row:hover { background: #f9fafb; }
.ssm-switch-info { display: block; }
.ssm-switch-title { display: block; font-size: 14px; font-weight: 500; color: #111827; }
.ssm-switch-desc { display: block; font-size: 13px; color: #9ca3af; margin-top: 2px; line-height: 1.4; }

.ssm-switch-wrap {
    position: relative; flex-shrink: 0;
    width: 36px; height: 20px; display: inline-block;
}
.ssm-switch-wrap input { display: none; }

.ssm-switch-track {
    position: absolute; inset: 0;
    background: #d1d5db; border-radius: 999px;
    transition: background .2s ease;
}
.ssm-switch-wrap input:checked ~ .ssm-switch-track { background: #3b82f6; }

.ssm-switch-thumb {
    position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; background: #fff;
    border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.22);
    transition: transform .2s ease; pointer-events: none;
    z-index: 1;
}
.ssm-switch-wrap input:checked ~ .ssm-switch-track ~ .ssm-switch-thumb {
    transform: translateX(16px);
}

/* ---- STATUS BADGE ---- */
.ssm-status-badge {
    display: flex; align-items: center; gap: 13px;
    padding: 14px 16px; border-radius: 10px; margin-bottom: 22px;
}
.ssm-status-ok { background: #f0fdf4; border: 1px solid #bbf7d0; }
.ssm-status-icon {
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ssm-status-icon-ok { background: #22c55e; }
.ssm-status-title { font-weight: 600; font-size: 13.5px; color: #15803d; }
.ssm-status-desc { font-size: 12px; color: #16a34a; margin-top: 2px; }

/* ---- FOOTER ---- */
.ssm-modal-footer {
    display: flex; justify-content: flex-end; align-items: center;
    gap: 10px; padding: 13px 20px;
    border-top: 1px solid #f3f4f6; flex-shrink: 0;
}
.ssm-btn-secondary {
    padding: 8px 16px; border: 1px solid #e5e7eb;
    background: #fff; color: #374151; border-radius: 8px;
    font-size: 13px; font-weight: 500; cursor: pointer;
    font-family: inherit; transition: background .13s, border-color .13s;
}
.ssm-btn-secondary:hover { background: #f9fafb; border-color: #d1d5db; }
.ssm-btn-primary {
    padding: 8px 18px; background: #1d4ed8; color: #fff;
    border: 1px solid #1e40af; border-radius: 8px;
    font-size: 13px; font-weight: 500; cursor: pointer;
    font-family: inherit; transition: background .13s;
}
.ssm-btn-primary:hover { background: #1e40af; }


/* ================================================================ */
/* SUB-MODAL: UPLOAD ȘI CROP AVATAR                                 */
/* ================================================================ */

.ssm-avatar-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: ssmFadeIn .15s ease;
}

.ssm-avatar-modal-box {
    width: 100%; max-width: 440px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 24px 64px rgba(0,0,0,.22);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    animation: ssmSlideUp .2s ease;
    overflow: hidden;
}

.ssm-avatar-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #f3f4f6;
}
.ssm-avatar-modal-title {
    margin: 0; font-size: 15px; font-weight: 600; color: #111827;
}

.ssm-avatar-step {
    padding: 20px;
}

/* ---- Dropzone ---- */
.ssm-avatar-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: #fafbfc;
}
.ssm-avatar-dropzone:hover,
.ssm-avatar-dropzone.ssm-drag-over {
    border-color: #3b82f6;
    background: #eff6ff;
}
.ssm-dropzone-text {
    font-size: 14px; color: #6b7280;
    margin: 10px 0 8px; line-height: 1.4;
}
.ssm-dropzone-btn {
    display: inline-block;
    padding: 7px 18px;
    background: #1d4ed8; color: #fff;
    border: none; border-radius: 7px;
    font-size: 13px; font-weight: 500;
    cursor: pointer; font-family: inherit;
    transition: background .15s;
}
.ssm-dropzone-btn:hover { background: #1e40af; }
.ssm-dropzone-hint {
    font-size: 12px; color: #9ca3af; margin-top: 10px;
}

/* ---- Crop Container (canvas-based) ---- */
.ssm-crop-container {
    width: 100%; height: 300px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #111827;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.ssm-crop-container:active { cursor: grabbing; }

#ssm-crop-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: block;
}



/* ---- Zoom Slider ---- */
.ssm-crop-zoom-row {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 0 4px;
}
.ssm-crop-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1; height: 4px;
    background: #e5e7eb; border-radius: 4px;
    outline: none;
}
.ssm-crop-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%; background: #1d4ed8;
    cursor: pointer; border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.ssm-crop-slider::-moz-range-thumb {
    width: 16px; height: 16px;
    border-radius: 50%; background: #1d4ed8;
    cursor: pointer; border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

/* ---- Preview rezultat (squircle prin DaisyUI) ---- */
.ssm-crop-preview-row {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 0 0;
}
.ssm-crop-preview-label {
    font-size: 12.5px; color: #6b7280; font-weight: 500;
}
.ssm-crop-preview-box {
    width: 58px; height: 58px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    flex-shrink: 0;
    /* DaisyUI mask mask-squircle se ocupă de formă */
}
.ssm-crop-preview-box canvas {
    display: block; width: 100%; height: 100%;
}

/* Footer sub-modal */
.ssm-avatar-modal-footer {
    display: flex; justify-content: flex-end; align-items: center;
    gap: 10px; padding: 13px 20px;
    border-top: 1px solid #f3f4f6;
}

/* ---- Toast notificare ---- */
.ssm-avatar-toast {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%);
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    z-index: 100000;
    animation: ssmSlideUp .2s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.ssm-avatar-toast-success { background: #22c55e; color: #fff; }
.ssm-avatar-toast-error { background: #ef4444; color: #fff; }

/* ---- RESPONSIVE ---- */
@media (max-width:600px) {
    .ssm-modal-sidebar { width: 150px; }
    .ssm-form-row-2col { grid-template-columns: 1fr; }
    .ssm-tab-scroll { padding: 16px; }
    .ssm-avatar-modal-box { max-width: 95%; }
    .ssm-crop-container { height: 240px; }
    .ssm-crop-hole { width: 150px; height: 150px; }
}


/* ================================================================ */
/* TAB SEMNĂTURĂ — Preview semnătură curentă + buton Schimbă       */
/* ================================================================ */

/* ---- Badge warning (portocaliu) — când nu există semnătură ---- */
.ssm-status-warn { background: #fff7ed; border: 1px solid #fed7aa; }
.ssm-status-icon-warn { background: #f97316; }
.ssm-status-warn .ssm-status-title { color: #c2410c; }
.ssm-status-warn .ssm-status-desc  { color: #ea580c; }

/* ---- Cutia care înconjoară preview-ul semnăturii ---- */
.ssm-sign-current-box {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.ssm-sign-current-label {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

/* ---- Zona centrală unde apare imaginea/fontul ---- */
.ssm-sign-preview-area {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
    padding: 10px;
}
.ssm-sign-preview-img {
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
    display: block;
}

/* ---- Placeholder când nu există semnătură ---- */
.ssm-sign-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}
.ssm-sign-empty p { margin: 6px 0 0; }

/* ---- Butonul „Schimbă semnătura" ---- */
.ssm-sign-change-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: none;
    border: 1px solid #3b82f6;
    border-radius: 7px;
    color: #3b82f6;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, color .15s;
}
.ssm-sign-change-btn:hover { background: #eff6ff; color: #1d4ed8; }


/* ================================================================ */
/* SUB-MODAL SEMNĂTURĂ ELECTRONICĂ                                  */
/* ================================================================ */

/* ---- Cutia sub-modalului (mai lată ca cea de avatar) ---- */
.ssm-sign-modal-box { max-width: 500px; }

/* ---- Tab-uri Desenată / Scrisă ---- */
.ssm-sign-tabs {
    display: flex;
    border-bottom: 2px solid #f3f4f6;
    padding: 0 20px;
}
.ssm-sign-tab {
    flex: 1;
    padding: 11px 12px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 14px;
    font-weight: 500;
    color: #9ca3af;
    cursor: pointer;
    font-family: inherit;
    transition: color .15s;
}
.ssm-sign-tab:hover { color: #374151; }
.ssm-sign-tab-active { color: #1d4ed8; border-bottom-color: #1d4ed8; }

/* ---- Panel (conținut tab activ) ---- */
.ssm-sign-panel { padding: 18px 20px 18px; }
.ssm-sign-panel-hidden { display: none; }
.ssm-sign-panel-desc {
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    margin: 0 0 12px;
}

/* ---- Canvas pentru desenarea semnăturii ---- */
.ssm-sign-canvas-wrap {
    position: relative;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    text-align: center;
}
.ssm-sign-canvas {
    display: block;
    margin: 0 auto;
    width: 398px;
    height: 160px;
    cursor: crosshair;
    touch-action: none;
}
.ssm-sign-guide-line {
    position: absolute;
    bottom: 38px;
    left: 16px;
    right: 16px;
    border-bottom: 2px dashed #e5e7eb;
    pointer-events: none;
}

/* ---- Butoane Șterge + Salvează ---- */
.ssm-sign-controls { display: flex; gap: 10px; }
.ssm-sign-btn { flex: 1; }
.ssm-sign-btn-full { width: 100%; }

/* ---- Preview semnătură scrisă în sub-modal ---- */
.ssm-sign-written-preview-box {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    margin-bottom: 14px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Mesaj status în sub-modal ---- */
.ssm-sign-status {
    margin: 8px 20px 16px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}
.ssm-sign-status-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.ssm-sign-status-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.ssm-sign-status-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ---- Responsive ---- */
@media (max-width: 520px) {
    .ssm-sign-modal-box { max-width: 95%; }
    .ssm-sign-canvas    { width: 100%; max-width: 398px; }
    .ssm-sign-controls  { flex-direction: column; }
}



/* ================================================================ */
/* BUTON SALVARE — stare dezactivată                                 */
/* ================================================================ */
.ssm-btn-primary:disabled {
    background: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
    opacity: 1;
}
.ssm-btn-primary:disabled:hover { background: #9ca3af; }

/* ================================================================ */
/* POPUP CONFIRMARE — modificări nesalvate                          */
/* ================================================================ */
#ssm-unsaved-overlay {
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.ssm-unsaved-box {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    padding: 28px 26px 22px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    animation: ssmSlideUp .2s ease;
}

.ssm-unsaved-icon {
    width: 48px; height: 48px;
    background: #fff7ed;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
}

.ssm-unsaved-title {
    font-size: 16px; font-weight: 600; color: #111827;
    margin-bottom: 8px;
}

.ssm-unsaved-desc {
    font-size: 13.5px; color: #6b7280; line-height: 1.5;
    margin-bottom: 20px;
}

.ssm-unsaved-btns {
    display: flex; gap: 10px; justify-content: center;
}

.ssm-unsaved-exit-btn {
    padding: 8px 18px;
    background: #fee2e2; color: #dc2626;
    border: 1px solid #fca5a5; border-radius: 8px;
    font-size: 13px; font-weight: 500; cursor: pointer;
    font-family: inherit; transition: background .13s;
}
.ssm-unsaved-exit-btn:hover { background: #fecaca; }