/**
 * Shell gaya native iOS (selaras login.php).
 * Pakai: body class "ios-app", load file ini SETELAH style.css / tailwind.
 */

:root {
    --ios-bg: #f2f2f7;
    --ios-group: #ffffff;
    --ios-text: #000000;
    --ios-text-secondary: #8e8e93;
    --ios-blue: #1a3a5c;
    --ios-blue-press: #132d47;
    --ios-sep: rgba(60, 60, 67, 0.36);
    --ios-radius: 12px;
    --ios-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.ios-app {
    font-family: var(--ios-font);
    background: var(--ios-bg);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    color-scheme: light;
}

body.ios-app .mobile-frame {
    width: 100%;
    max-width: 430px;
    min-height: 100dvh;
    min-height: 100vh;
    background: var(--ios-bg);
    box-shadow: none;
    padding:
        max(12px, env(safe-area-inset-top))
        max(20px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));
}

body.ios-app .bank-logo {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

body.ios-app .bank-logo img {
    width: 36px;
    height: 36px;
    padding: 0;
    object-fit: contain;
}

body.ios-app .dashboard-card {
    background: var(--ios-group);
    border-radius: var(--ios-radius);
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

body.ios-app .action-btn:hover {
    transform: none;
}

/* —— Header layar (mengganti bar biru + teks putih) —— */
.ios-screen-head {
    margin-bottom: 16px;
}

.ios-screen-head__row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ios-head-meta {
    flex: 1;
    min-width: 0;
}

.ios-head-brand {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.41px;
    line-height: 1.2;
    color: var(--ios-text);
}

.ios-head-brand .ios-accent {
    color: #b45309;
}

.ios-head-page {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 400;
    color: var(--ios-text-secondary);
    letter-spacing: -0.08px;
}

.ios-head-user {
    text-align: right;
    flex-shrink: 0;
    max-width: 44%;
}

.ios-head-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--ios-text);
    letter-spacing: -0.24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ios-head-role {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    color: var(--ios-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* —— Link kembali (gaya iOS) —— */
.ios-nav-back {
    margin-bottom: 12px;
}

.ios-nav-back a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 17px;
    font-weight: 400;
    color: var(--ios-blue);
    text-decoration: none;
    letter-spacing: -0.41px;
}

.ios-nav-back a:active {
    opacity: 0.55;
}

.ios-nav-back i {
    font-size: 13px;
    opacity: 0.85;
}

/* —— Judul section —— */
body.ios-app .dashboard-card h2,
body.ios-app .dashboard-card h3 {
    letter-spacing: -0.41px;
}

/* —— Tombol / aksen biru → navy —— */
body.ios-app .bg-blue-700,
body.ios-app .bg-blue-800 {
    background-color: var(--ios-blue) !important;
}

body.ios-app .hover\:bg-blue-800:hover {
    background-color: var(--ios-blue-press) !important;
}

body.ios-app .text-blue-700 {
    color: var(--ios-blue) !important;
}

body.ios-app .text-blue-800 {
    color: #163352 !important;
}

body.ios-app .text-blue-600 {
    color: var(--ios-blue) !important;
}

body.ios-app .hover\:text-blue-800:hover {
    color: var(--ios-blue-press) !important;
}

body.ios-app .ring-blue-300 {
    --tw-ring-color: rgba(26, 58, 92, 0.35) !important;
}

/* —— Status kehadiran —— */
body.ios-app .status-card.active {
    background-color: rgba(52, 199, 89, 0.14);
    border-color: rgba(52, 199, 89, 0.45) !important;
    color: inherit;
}

/* —— Footer —— */
body.ios-app .ios-foot,
body.ios-app .ios-foot p {
    color: var(--ios-text-secondary) !important;
    font-size: 13px;
    letter-spacing: -0.08px;
}

body.ios-app .ios-foot a {
    color: #c00 !important;
    text-decoration: none;
    font-size: 15px;
}

body.ios-app .ios-foot a:active {
    opacity: 0.55;
}

/* —— Modal backdrop —— */
body.ios-app .fixed.inset-0 .absolute.inset-0.bg-black.opacity-50 {
    opacity: 0.38 !important;
}

/* —— Area kamera —— */
body.ios-app .camera-preview {
    border-radius: var(--ios-radius);
    border: 0.5px solid var(--ios-sep);
    background: #e5e5ea;
}

/* Aksen biru lembut mengikuti palet navy */
body.ios-app .bg-blue-50 {
    background: rgba(26, 58, 92, 0.07) !important;
}

body.ios-app .hover\:bg-blue-100:hover {
    background: rgba(26, 58, 92, 0.11) !important;
}

body.ios-app .bg-blue-100 {
    background: rgba(26, 58, 92, 0.1) !important;
}

/* —— Rekam: pilihan jenis presensi (idle vs terpilih) —— */
body.ios-app .presensi-btn {
    position: relative;
    -webkit-tap-highlight-color: transparent;
    border-width: 2px;
    border-style: solid;
    box-shadow: none !important;
}

body.ios-app .presensi-btn:focus {
    outline: none;
}

body.ios-app .presensi-btn:focus-visible {
    outline: 2px solid var(--ios-blue);
    outline-offset: 2px;
}

/* Sudah direkam — nonaktif */
body.ios-app .presensi-btn:disabled,
body.ios-app .presensi-btn.presensi-btn--done {
    cursor: not-allowed !important;
    background: #aeaeb2 !important;
    color: #fff !important;
    border-color: #8e8e93 !important;
    opacity: 1;
    transform: none !important;
}

/* Bisa dipilih — belum aktif */
body.ios-app .presensi-btn.presensi-btn--idle.presensi-btn--masuk {
    background: rgba(26, 58, 92, 0.1) !important;
    color: var(--ios-blue) !important;
    border-color: rgba(26, 58, 92, 0.35) !important;
}

body.ios-app .presensi-btn.presensi-btn--idle.presensi-btn--istirahat {
    background: rgba(180, 83, 9, 0.12) !important;
    color: #92400e !important;
    border-color: rgba(180, 83, 9, 0.4) !important;
}

body.ios-app .presensi-btn.presensi-btn--idle.presensi-btn--pulang {
    background: rgba(22, 101, 52, 0.12) !important;
    color: #166534 !important;
    border-color: rgba(22, 101, 52, 0.4) !important;
}

body.ios-app .presensi-btn.presensi-btn--idle:active:not(:disabled) {
    opacity: 0.88;
    transform: scale(0.98);
}

/* Terpilih — solid + “chip” centang */
body.ios-app .presensi-btn.presensi-btn--selected {
    color: #fff !important;
    transform: scale(1.02);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18) !important;
}

body.ios-app .presensi-btn.presensi-btn--selected.presensi-btn--masuk {
    background: var(--ios-blue) !important;
    border-color: var(--ios-blue-press) !important;
}

body.ios-app .presensi-btn.presensi-btn--selected.presensi-btn--istirahat {
    background: #b45309 !important;
    border-color: #92400e !important;
}

body.ios-app .presensi-btn.presensi-btn--selected.presensi-btn--pulang {
    background: #166534 !important;
    border-color: #14532d !important;
}

body.ios-app .presensi-btn .presensi-pick-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--ios-text);
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    pointer-events: none;
}

body.ios-app .presensi-btn.presensi-btn--selected.presensi-btn--masuk .presensi-pick-badge {
    color: var(--ios-blue);
}

body.ios-app .presensi-btn.presensi-btn--selected.presensi-btn--istirahat .presensi-pick-badge {
    color: #b45309;
}

body.ios-app .presensi-btn.presensi-btn--selected.presensi-btn--pulang .presensi-pick-badge {
    color: #166534;
}

body.ios-app .presensi-btn.presensi-btn--idle .presensi-pick-badge,
body.ios-app .presensi-btn:disabled .presensi-pick-badge {
    display: none;
}
