/* ===== POPUP OVERLAY ===== */
.sqlb-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.sqlb-popup-overlay.show {
    opacity: 1;
}

.sqlb-popup-container {
    background: #f0f0f0;
    border: 1px solid #888;
    border-radius: 4px;
    min-width: 400px;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #1e1e1e;
    font-size: 13px;
}

/* Titlebar */
.sqlb-popup-titlebar {
    display: flex;
    align-items: center;
    height: 30px;
    padding: 0 4px 0 10px;
    background: #2d2d2d;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
    user-select: none;
}
.sqlb-popup-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sqlb-popup-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.15s;
}
.sqlb-popup-close:hover {
    background: rgba(255,255,255,0.15);
}

/* Body */
.sqlb-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* ===== POPUP FORM ===== */
.popup-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.popup-fieldset {
    border: 1px solid #999;
    border-radius: 3px;
    padding: 10px 12px;
    margin: 0;
    flex: 1;
}
.popup-fieldset legend {
    font-size: 12px;
    padding: 0 6px;
    color: #333;
    font-weight: 500;
}

.popup-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}
.popup-row:last-child {
    margin-bottom: 0;
}

.popup-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.popup-field label {
    font-size: 11px;
    color: #555;
    font-weight: 500;
}

.popup-input {
    height: 26px;
    border: 1px solid #aaa;
    border-radius: 2px;
    padding: 0 6px;
    font-size: 12px;
    background: white;
    color: #1e1e1e;
    outline: none;
    font-family: 'Roboto', sans-serif;
}
.popup-input:focus {
    border-color: #0078d4;
    box-shadow: 0 0 0 1px #0078d4;
}
select.popup-input {
    cursor: pointer;
}

/* Password wrapper */
.password-wrapper {
    position: relative;
    display: flex;
}
.password-wrapper .popup-input {
    flex: 1;
    padding-right: 28px;
}
.password-toggle {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.password-toggle:hover {
    color: #333;
}

/* Buttons */
.popup-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
    flex-shrink: 0;
}
.popup-btn {
    height: 28px;
    padding: 0 20px;
    border: 1px solid #999;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    transition: background 0.15s;
}
.popup-btn-primary {
    background: #e1e1e1;
    color: #1e1e1e;
}
.popup-btn-primary:hover {
    background: #ccc;
}
.popup-btn-secondary {
    background: #e1e1e1;
    color: #1e1e1e;
}
.popup-btn-secondary:hover {
    background: #ccc;
}
