/* ==========================================================
   DASHBOARD OPERATORE STABILIMENTO
   ========================================================== */
.sb-op-app {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #2c3e50;
}

.sb-op-app * { box-sizing: border-box; }

/* Header */
.sb-op-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #fff;
    border: 1px solid #e4e8f0;
    border-radius: 10px;
    margin-bottom: 20px;
}
.sb-op-header-user { font-weight: 600; }
.sb-op-logout {
    color: #c0392b;
    text-decoration: none;
    font-size: 14px;
}
.sb-op-logout:hover { text-decoration: underline; }

/* Hero registrazione */
.sb-op-hero {
    text-align: center;
    padding: 50px 20px 30px;
    background: linear-gradient(135deg, #0077b6, #00b4d8);
    color: #fff;
    border-radius: 16px;
    margin-bottom: 24px;
}
.sb-op-hero h1 { color: #fff; margin: 0 0 12px; font-size: 32px; }
.sb-op-subtitle { font-size: 17px; opacity: 0.95; margin: 0; }

/* Tabs */
.sb-op-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: #f0f3f7;
    padding: 4px;
    border-radius: 10px;
    width: fit-content;
}
.sb-op-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    color: #7e8a99;
    transition: all 0.15s;
}
.sb-op-tab.active {
    background: #fff;
    color: #0077b6;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.sb-op-tab-content { display: none; }
.sb-op-tab-content.active { display: block; }

/* Card */
.sb-op-card {
    background: #fff;
    border: 1px solid #e4e8f0;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 16px;
}
.sb-op-card h2 { margin-top: 0; }
.sb-op-card-center { text-align: center; }

/* Form */
.sb-op-form { display: flex; flex-direction: column; gap: 14px; }
.sb-op-field { display: flex; flex-direction: column; gap: 6px; }
.sb-op-field label { font-weight: 600; font-size: 14px; color: #34495e; }
.sb-op-field small { color: #7e8a99; font-size: 12px; }
.sb-op-field input[type="text"],
.sb-op-field input[type="email"],
.sb-op-field input[type="password"],
.sb-op-field input[type="tel"],
.sb-op-field input[type="url"],
.sb-op-field input[type="number"],
.sb-op-field select,
.sb-op-field textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #d8dee8;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.sb-op-field input:focus,
.sb-op-field select:focus,
.sb-op-field textarea:focus {
    outline: none;
    border-color: #0077b6;
    box-shadow: 0 0 0 3px rgba(0,119,182,0.12);
}
.sb-op-field-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    font-size: 14px;
    cursor: pointer;
}
.sb-op-input-with-btn {
    display: flex;
    gap: 8px;
}
.sb-op-input-with-btn input { flex: 1; }
.sb-op-input-currency {
    display: flex;
    align-items: center;
    border: 1.5px solid #d8dee8;
    border-radius: 8px;
    overflow: hidden;
    max-width: 250px;
}
.sb-op-input-currency span {
    padding: 11px 14px;
    background: #f0f3f7;
    font-weight: 600;
    color: #34495e;
}
.sb-op-input-currency input {
    border: none !important;
    flex: 1;
    padding: 11px 14px;
}
.sb-op-input-currency input:focus { box-shadow: none !important; }
.sb-op-coords {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.sb-op-field-inline {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sb-op-field-inline label { font-size: 12px; color: #7e8a99; }
.sb-op-field-inline input {
    padding: 8px 10px;
    border: 1.5px solid #d8dee8;
    border-radius: 6px;
    background: #f7f9fc;
    font-size: 13px;
    font-family: monospace;
}

/* Buttons */
.sb-op-btn {
    padding: 11px 22px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s;
    font-family: inherit;
}
.sb-op-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sb-op-btn-primary { background: #0077b6; color: #fff; }
.sb-op-btn-primary:hover:not(:disabled) { background: #005f92; transform: translateY(-1px); }
.sb-op-btn-ghost {
    background: #fff;
    color: #34495e;
    border: 1.5px solid #d8dee8;
}
.sb-op-btn-ghost:hover { background: #f7f9fc; }
.sb-op-btn-lg { padding: 14px 28px; font-size: 16px; }

/* Stepper */
.sb-op-stepper {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 8px;
    background: #fff;
    border: 1px solid #e4e8f0;
    border-radius: 12px;
    margin-bottom: 16px;
}
.sb-op-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: #95a5a6;
    transition: all 0.15s;
    flex: 1;
    min-width: 90px;
    text-align: center;
}
.sb-op-step:hover { background: #f7f9fc; }
.sb-op-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f3f7;
    color: #95a5a6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}
.sb-op-step-label { font-size: 11px; font-weight: 600; line-height: 1.2; }
.sb-op-step.done .sb-op-step-num { background: #2ecc71; color: #fff; }
.sb-op-step.done { color: #2ecc71; }
.sb-op-step.current .sb-op-step-num { background: #0077b6; color: #fff; }
.sb-op-step.current { color: #0077b6; }

/* Progress bar */
.sb-op-progress-bar {
    height: 4px;
    background: #f0f3f7;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 28px;
}
.sb-op-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0077b6, #00b4d8);
    transition: width 0.4s;
}

/* Step content */
.sb-op-step-content {
    background: #fff;
    border: 1px solid #e4e8f0;
    border-radius: 12px;
    padding: 30px;
}
.sb-op-step-head {
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f3f7;
}
.sb-op-step-head h2 {
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
}
.sb-op-step-head p { color: #7e8a99; margin: 0; }
.sb-op-step-icon { font-size: 28px; }

/* Map nello step location */
#sb-op-map {
    height: 380px;
    border-radius: 10px;
    border: 1px solid #d8dee8;
    margin: 8px 0;
}

/* Chips servizi */
.sb-op-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sb-op-chip {
    cursor: pointer;
}
.sb-op-chip input { display: none; }
.sb-op-chip span {
    display: inline-block;
    padding: 8px 14px;
    border: 1.5px solid #d8dee8;
    border-radius: 20px;
    font-size: 14px;
    background: #fff;
    transition: all 0.15s;
}
.sb-op-chip input:checked + span {
    background: #0077b6;
    color: #fff;
    border-color: #0077b6;
}
.sb-op-chip:hover span { border-color: #0077b6; }

/* Uploader */
.sb-op-uploader { text-align: center; }
.sb-op-uploader-preview {
    width: 100%;
    height: 280px;
    border: 2px dashed #d8dee8;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    background-color: #f7f9fc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 12px;
    transition: border-color 0.15s;
}
.sb-op-uploader-preview:hover { border-color: #0077b6; }
.sb-op-uploader-empty { text-align: center; color: #95a5a6; }
.sb-op-uploader-icon { font-size: 50px; display: block; margin-bottom: 10px; }

/* Action row */
.sb-op-actions-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #f0f3f7;
}

/* Alert */
.sb-op-alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
}
.sb-op-alert-warn {
    background: #fff8e1;
    border-left: 4px solid #f39c12;
    color: #7d5a13;
}
.sb-op-alert-success {
    background: #e8f5e9;
    border-left: 4px solid #2ecc71;
    color: #1b5e20;
}
.sb-op-alert ul { margin: 8px 0 0 20px; padding: 0; }

/* Summary */
.sb-op-summary {
    background: #f7f9fc;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 18px;
}
.sb-op-summary-item {
    padding: 8px 0;
    border-bottom: 1px solid #e4e8f0;
    font-size: 14px;
}
.sb-op-summary-item:last-child { border: none; }

/* Badges */
.sb-op-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}
.sb-op-badge-ok    { background: #e8f5e9; color: #1b5e20; }
.sb-op-badge-warn  { background: #fff8e1; color: #7d5a13; }

/* Messages */
.sb-op-msg {
    margin-top: 12px;
    padding: 0;
    min-height: 20px;
    font-size: 14px;
}
.sb-op-msg.error   { color: #c0392b; }
.sb-op-msg.success { color: #1b5e20; }

.sb-op-link { text-align: center; margin-top: 12px; font-size: 14px; }

/* Management dashboard */
.sb-op-mgmt-hero {
    background: linear-gradient(135deg, #0077b6, #00b4d8);
    color: #fff;
    padding: 32px 28px;
    border-radius: 14px;
    margin-bottom: 22px;
}
.sb-op-mgmt-hero h1 { color: #fff; margin: 0 0 4px; font-size: 22px; }
.sb-op-mgmt-hero h2 { color: #fff; margin: 0 0 12px; font-size: 28px; opacity: 0.95; }
.sb-op-mgmt-hero p { margin: 0; opacity: 0.9; }
.sb-op-mgmt-hero a { color: #fff; text-decoration: underline; }

.sb-op-mgmt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.sb-op-mgmt-card {
    background: #fff;
    border: 1px solid #e4e8f0;
    border-radius: 12px;
    padding: 22px;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
    display: block;
}
.sb-op-mgmt-card:hover {
    border-color: #0077b6;
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0,119,182,0.12);
}
.sb-op-mgmt-icon { font-size: 32px; display: block; margin-bottom: 10px; }
.sb-op-mgmt-card h3 { margin: 0 0 4px; font-size: 16px; }
.sb-op-mgmt-card p { margin: 0 0 12px; color: #7e8a99; font-size: 13px; }
.sb-op-mgmt-edit { color: #0077b6; font-weight: 600; font-size: 13px; }

.sb-op-mgmt-actions { text-align: center; }
.sb-op-mgmt-hint { color: #7e8a99; font-size: 13px; margin-top: 8px; }

/* Mobile */
@media (max-width: 700px) {
    .sb-op-step-label { display: none; }
    .sb-op-stepper { padding: 6px; }
    .sb-op-step { min-width: 44px; padding: 8px; }
    .sb-op-step-content { padding: 20px; }
    .sb-op-coords { grid-template-columns: 1fr; }
    .sb-op-input-with-btn { flex-direction: column; }
}
