@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
    --ios-bg: #F4F6FA;
    --ios-card: #FFFFFF;
    --ios-blue: #007AFF;
    --ios-blue-active: #0051D5;
    --ios-green: #10B981;
    --ios-red: #F43F5E;
    --ios-orange: #F59E0B;
    --ios-indigo: #4F46E5;
    --ios-teal: #0D9488;
    --ios-text: #0F172A;
    --ios-subtext: #64748B;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body { 
    background: radial-gradient(circle at 0% 0%, #F8FAFC 0%, #F1F5F9 55%, #E8EEF5 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Plus Jakarta Sans', sans-serif; 
    -webkit-tap-highlight-color: transparent; 
    color: var(--ios-text);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

.font-mono { 
    font-family: 'SF Mono', 'JetBrains Mono', monospace; 
}

/* Mempertahankan Spasi Enter / Baris Baru agar Rapi ke Bawah */
.pre-line-text {
    white-space: pre-line;
    word-break: break-word;
    line-height: 1.55;
}

@keyframes iosPop {
    0% { opacity: 0; transform: scale(0.97) translateY(8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes shimmerSweep {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulseUrgent {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.animate-ios-pop {
    animation: iosPop 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.skeleton-shimmer {
    background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
    background-size: 200% 100%;
    animation: shimmerSweep 1.4s infinite linear;
}

/* ================= LOGIN SCREEN ================= */
.login-viewport {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 60;
    background: radial-gradient(circle at 20% 20%, #DBEAFE 0%, #F1F5F9 50%, #E0E7FF 100%);
    overflow-y: auto;
}

.login-viewport.hidden {
    display: none !important;
}

.login-glass-box {
    margin: auto;
    width: 100%;
    max-width: 410px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(28px);
    -webkit-backdrop-filter: saturate(180%) blur(28px);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.14), 0 4px 16px -2px rgba(0, 122, 255, 0.06);
    padding: 36px 30px;
    position: relative;
    z-index: 10;
}

.login-logo-badge {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, #007AFF 0%, #4F46E5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 24px -6px rgba(0, 122, 255, 0.4);
}

.ios-ambient-blob {
    position: absolute;
    border-radius: 9999px;
    filter: blur(85px);
    opacity: 0.45;
    pointer-events: none;
}

.blob-blue {
    width: 340px;
    height: 340px;
    background: #007AFF;
    top: -80px;
    right: -80px;
}

.blob-indigo {
    width: 300px;
    height: 300px;
    background: #4F46E5;
    bottom: -80px;
    left: -80px;
}

.ios-glass-modal {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: saturate(180%) blur(25px);
    -webkit-backdrop-filter: saturate(180%) blur(25px);
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.2), 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ios-chip-blue {
    font-size: 10.5px;
    font-weight: 800;
    color: var(--ios-blue);
    background: rgba(0, 122, 255, 0.1);
    padding: 4px 12px;
    border-radius: 9999px;
    display: inline-block;
    letter-spacing: 0.03em;
}

/* ================= NAVBAR & SEGMENTED BAR ================= */
.ios-navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.ios-pill-btn {
    padding: 6.5px 12px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: transform 0.15s ease, opacity 0.15s ease;
    cursor: pointer;
}

.ios-pill-btn:active {
    transform: scale(0.95);
}

.ios-segmented-bar {
    background: #E2E8F0;
    padding: 3.5px;
    border-radius: 14px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
}

.ios-segment-btn {
    flex: 1;
    padding: 8px 14px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    cursor: pointer;
}

.ios-segment-btn.active {
    background: #FFFFFF;
    color: #0F172A;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08), 0 0.5px 1px rgba(0, 0, 0, 0.04);
}

/* ================= CARDS, INPUTS & SVG EYE/INFO BUTTONS ================= */
.ios-card {
    background: var(--ios-card);
    border-radius: 22px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 8px 26px -8px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #F1F5F9;
}

.ios-step-num {
    width: 25px;
    height: 25px;
    border-radius: 9px;
    background: linear-gradient(135deg, #007AFF 0%, #4F46E5 100%);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ios-section-title {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--ios-text);
    letter-spacing: -0.01em;
}

.ios-label {
    font-size: 11px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 4px;
    display: block;
}

.ios-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ios-subtext);
    pointer-events: none;
}

.ios-eye-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748B;
    padding: 5px;
    border-radius: 10px;
    transition: all 0.18s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
}

.ios-eye-btn:hover {
    color: #007AFF;
    background: rgba(0, 122, 255, 0.08);
}

.ios-info-svg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 12px;
    border-radius: 13px;
    font-size: 11px;
    font-weight: 800;
    color: #007AFF;
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.2);
    transition: all 0.18s ease;
    cursor: pointer;
}

.ios-info-svg-btn:hover {
    background: #007AFF;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.25);
}

.ios-input { 
    background: #F8FAFC; 
    border: 1.5px solid #E2E8F0; 
    border-radius: 14px; 
    padding: 10px 13px; 
    outline: none; 
    transition: all 0.2s ease; 
    width: 100%; 
    max-width: 100%;
    font-size: 13px; 
    color: var(--ios-text);
    box-sizing: border-box;
}

.ios-input.pl-10 {
    padding-left: 2.65rem !important;
}

.ios-input.pr-11 {
    padding-right: 2.75rem !important;
}

.ios-input:focus { 
    background: #FFFFFF;
    border-color: var(--ios-blue); 
    box-shadow: 0 0 0 3.5px rgba(0, 122, 255, 0.13); 
}

/* SLA Day + Hour Row Styling */
.sla-config-row {
    background: #F4F6FA;
    padding: 9px 12px;
    border-radius: 15px;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.sla-total-badge {
    font-family: 'SF Mono', 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 800;
    color: #007AFF;
    background: rgba(0, 122, 255, 0.12);
    padding: 2px 8px;
    border-radius: 8px;
}

.ios-btn-primary { 
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%); 
    color: #FFFFFF; 
    border-radius: 15px; 
    padding: 13px 20px; 
    font-weight: 700; 
    font-size: 14px; 
    transition: transform 0.15s ease, box-shadow 0.2s ease; 
    text-align: center; 
    cursor: pointer; 
    border: none;
    box-shadow: 0 6px 18px rgba(0, 122, 255, 0.26);
}

.ios-btn-primary:hover { 
    box-shadow: 0 8px 22px rgba(0, 122, 255, 0.35);
    transform: translateY(-1px);
}

.ios-btn-primary:active { 
    transform: scale(0.97); 
}

.ios-btn-dark {
    background: #0F172A;
    color: #FFFFFF;
    border-radius: 14px;
    font-weight: 700;
    font-size: 12px;
    transition: transform 0.15s ease, opacity 0.15s ease;
    cursor: pointer;
}

.ios-btn-dark:active {
    transform: scale(0.96);
}

/* ================= PILIHAN SUMBER FOTO SVG MODERN ================= */
.photo-source-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 14px;
    border-radius: 20px;
    border: 1.5px solid #E2E8F0;
    background: #F8FAFC;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-source-btn:hover {
    background: #EFF6FF;
    border-color: #007AFF;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(0, 122, 255, 0.16);
}

/* ================= SWEETALERT MODAL CENTERED ================= */
.swal2-popup {
    border-radius: 26px !important;
    padding: 1.35rem !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Plus Jakarta Sans', sans-serif !important;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25) !important;
}

.swal2-html-container {
    margin: 0.75rem 0 0 0 !important;
    padding: 0 2px !important;
    overflow-x: hidden !important;
}

/* ================= SLA CARD HIGHLIGHTS ================= */
.tx-card-urgent {
    background: linear-gradient(135deg, #ffffff 62%, #fff1f2 100%) !important;
    border: 1.5px solid #fda4af !important;
    box-shadow: 0 10px 25px -8px rgba(225, 29, 72, 0.12) !important;
}

.tx-card-warning {
    background: linear-gradient(135deg, #ffffff 62%, #fffbeb 100%) !important;
    border: 1.5px solid #fcd34d !important;
    box-shadow: 0 10px 25px -8px rgba(217, 119, 6, 0.1) !important;
}

.tx-card-normal:hover {
    border-color: #60a5fa !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -8px rgba(37, 99, 235, 0.09) !important;
}

.sla-badge-urgent {
    background: #e11d48;
    color: #ffffff;
    padding: 3.5px 10px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 3px 10px rgba(225, 29, 72, 0.3);
    animation: pulseUrgent 2s infinite;
}

.sla-badge-warning {
    background: #f59e0b;
    color: #ffffff;
    padding: 3.5px 10px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sla-badge-safe {
    background: #f1f5f9;
    color: #475569;
    padding: 3.5px 10px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 700;
}

/* KPI Widgets */
.ios-kpi-widget {
    background: #FFFFFF;
    padding: 12px 15px;
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ios-kpi-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.ios-kpi-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    display: block;
}

.ios-kpi-val {
    font-size: 22px;
    font-weight: 800;
    margin-top: 2px;
    line-height: 1.2;
}

/* Filter Pills */
.filter-pill {
    padding: 6.5px 13px;
    border-radius: 9999px;
    background: #F1F5F9;
    color: #475569;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
}

.filter-pill.active {
    background: var(--ios-blue);
    color: #FFFFFF;
    box-shadow: 0 3px 10px rgba(0, 122, 255, 0.25);
}

/* Photo Upload Cards */
.photo-card { 
    position: relative; 
    width: 100%; 
    height: 130px; 
    border: 1.5px dashed #CBD5E1; 
    border-radius: 16px; 
    background: #F8FAFC; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    user-select: none;
}

@media (min-width: 640px) {
    .photo-card { height: 155px; }
}

.photo-card:hover { 
    border-color: var(--ios-blue); 
    background: rgba(0, 122, 255, 0.04); 
}

.photo-card img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    position: absolute; 
    top: 0; 
    left: 0; 
    display: none; 
    z-index: 10; 
}

.photo-badge {
    position: absolute;
    bottom: 5px;
    left: 5px;
    right: 5px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 5px;
    border-radius: 7px;
    z-index: 20;
    text-align: center;
    display: none;
}

.required::after { 
    content: " *"; 
    color: var(--ios-red); 
    font-weight: bold; 
}

#viewerStage {
    touch-action: none;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 9999px; }
