/* === MODAL DIALOGS === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 9, 20, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-window {
    background: linear-gradient(
        160deg,
        rgba(15, 23, 42, 0.98) 0%,
        rgba(10, 15, 30, 0.99) 100%
    );
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: 24px;
    width: 90%;
    max-width: 560px;
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: scale(0.93) translateY(10px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    overflow: hidden;
}

.modal-overlay.active .modal-window {
    transform: scale(1) translateY(0);
}

.modal-header {
    background: linear-gradient(
        135deg,
        rgba(6, 182, 212, 0.06) 0%,
        rgba(99, 102, 241, 0.04) 100%
    );
    border-bottom: 1px solid rgba(6, 182, 212, 0.12);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Top accent line pada modal header */
.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(6, 182, 212, 0.5),
        rgba(99, 102, 241, 0.4),
        transparent
    );
}

.modal-title {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-active);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Gradient dot sebelum judul modal */
.modal-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.5);
    flex-shrink: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.4rem 1.5rem;
    max-height: 68vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(6, 182, 212, 0.2) transparent;
}

.modal-body::-webkit-scrollbar {
    width: 4px;
}
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(6, 182, 212, 0.25);
    border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(6, 182, 212, 0.45);
}


/* FORM ELEMENTS */
.form-group {
    margin-bottom: 1.1rem;
    position: relative;
}

.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
    color: rgba(156, 163, 175, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Dot indicator sebelum setiap label */
.form-label::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.7;
    flex-shrink: 0;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.7rem 1rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.form-control:hover {
    border-color: rgba(6, 182, 212, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.form-control:focus {
    border-color: rgba(6, 182, 212, 0.5);
    background: rgba(6, 182, 212, 0.04);
    box-shadow:
        0 0 0 3px rgba(6, 182, 212, 0.1),
        0 0 12px rgba(6, 182, 212, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.2);
    font-weight: 400;
}

/* ── SELECT Dropdown Premium (Form) ─────────────────────────── */
.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2306b6d4' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    transition: transform 0.3s ease;
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.8rem;
    cursor: pointer;
    background-image: none !important; /* Hapus native icon jika ada */
}

/* Putar ikon panah jika dropdown difokuskan */
select.form-control:focus + .select-wrapper::after,
.select-wrapper:focus-within::after {
    transform: translateY(-50%) rotate(180deg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

select.form-control option {
    background: #0f1729;
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.8rem 1rem;
}

select.form-control option:checked {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(99, 102, 241, 0.2));
    color: #22d3ee;
}

select.form-control option:disabled {
    color: rgba(156, 163, 175, 0.4);
    font-style: italic;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.form-footer {
    border-top: 1px solid var(--border-glass);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
}

/* TOAST NOTIFICATION */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-left: 4px solid var(--primary);
    border-top: 1px solid var(--border-glass);
    border-right: 1px solid var(--border-glass);
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: var(--text-primary);
    box-shadow: var(--shadow-premium);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 280px;
}

@keyframes slideIn {
    from { transform: translateX(120%); }
    to { transform: translateX(0); }
}

.toast-success { border-left-color: var(--success); }
.toast-warning { border-left-color: var(--warning); }
.toast-danger { border-left-color: var(--danger); }

/* === TECHNICIAN / WORKER AREA ASSIGNMENT STYLING === */
.tech-area-checkbox-group {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border-glass);
    padding: 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
}

.tech-area-checkbox-group::-webkit-scrollbar {
    width: 4px;
}

.tech-area-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.tech-areas-all-badge {
    display: none;
    padding: 10px;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-glass-active);
    border-radius: 8px;
}

/* ── Reset Data View (Superadmin Only) ────────────────── */
.reset-container {
    max-width: 650px;
    margin: 2rem auto;
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.05);
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.3s ease;
}

.reset-header {
    text-align: center;
    margin-bottom: 2rem;
}

.danger-icon-wrapper {
    width: 64px;
    height: 64px;
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid rgba(239, 68, 68, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    animation: pulseDanger 2s infinite ease-in-out;
}

@keyframes pulseDanger {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.danger-icon {
    width: 32px;
    height: 32px;
    color: #ef4444;
}

.reset-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 0.9rem;
    font-weight: 600;
}

.warning-banner {
    background: rgba(239, 68, 68, 0.06);
    border-left: 4px solid #ef4444;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.warning-banner strong {
    color: #f87171;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.warning-banner ul {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
}

.warning-banner li {
    margin-bottom: 0.4rem;
}

.highlight-text {
    background: rgba(255, 255, 255, 0.04);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    margin-top: 0.75rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.confirmation-box {
    margin-bottom: 2rem;
    text-align: center;
}

.confirmation-box .form-label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.confirmation-box strong {
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin: 0 0.25rem;
    font-family: monospace;
    font-size: 0.95rem;
}

.text-center {
    text-align: center;
}

.text-bold {
    font-weight: 700;
    letter-spacing: 0.05em;
}

.btn-reset-large {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-reset-large:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-surface-hover) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--text-muted) !important;
}

.btn-reset-large:not(:disabled) {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.btn-reset-large:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.spin-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── Mikrotik Connection View ────────────────────────── */
.admin-only.init-hidden {
    display: none;
}

.mikrotik-config-container {
    padding: 1.75rem;
    border-radius: 16px;
    border: 1px solid var(--border-glass);
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin-bottom: 1.5rem;
}

.mikrotik-status-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.75rem;
    border-radius: 16px;
    border: 1px solid var(--border-glass);
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.mikrotik-status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-glass);
}

.connection-badge {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-connected {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #4ade80;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.2);
}

.badge-disconnected {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.2);
}

.badge-connecting {
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.4);
    color: #facc15;
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.2);
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot-connected {
    background-color: #22c55e;
    animation: pulseSuccess 2s infinite ease-in-out;
}

.dot-disconnected {
    background-color: #ef4444;
    animation: pulseDanger 2s infinite ease-in-out;
}

.dot-connecting {
    background-color: #eab308;
    animation: pulseWarning 1.5s infinite ease-in-out;
}

@keyframes pulseSuccess {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes pulseWarning {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(234, 179, 8, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(234, 179, 8, 0); }
}

.device-details-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.device-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.85rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.device-detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.device-detail-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mikrotik-logs-box {
    margin-top: 0.5rem;
    padding: 0.85rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    color: #ef4444;
    white-space: pre-wrap;
    max-height: 120px;
    overflow-y: auto;
}



