/*!
 * ==============================================================================
 * KNTI BESPOKE MOBILE-FIRST SKIN
 * Font: Nunito (Google Fonts) — Dirancang untuk keterbacaan maksimal di layar
 *       Android berukuran sedang, termasuk penggunaan outdoor di bawah sinar matahari.
 * Skin: CSS Override layer di atas Atlantis — zero-risk, zero file PHP tersentuh.
 *
 * Opsi B: Mobile Skin over Atlantis
 * Opsi C: Font diganti ke Nunito
 *
 * Desain: Indikrea Dev (Bespoke Enterprise UI/UX Standard)
 * ==============================================================================
 */

/* ==============================================================================
 * [C] FONT: Nunito — Keterbacaan optimal di layar Android
 * Alasan: Karakter sedikit membulat, jarak huruf natural, sangat nyaman
 * dibaca di layar resolusi menengah dan kondisi cahaya outdoor (nelayan).
 * Lisensi: SIL Open Font License 1.1 — bebas digunakan.
 * ============================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

:root {
    --font-primary : 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading : 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body    : 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Color tokens — konsisten di seluruh skin */
    --color-primary   : #1d7af3;
    --color-primary-dk: #0e5fd0;
    --color-surface   : #ffffff;
    --color-border    : rgba(0,0,0,0.07);
    --color-text-main : #1a2035;
    --color-text-muted: #6b7280;

    /* Spacing & radius tokens */
    --radius-card  : 14px;
    --radius-btn   : 10px;
    --radius-input : 8px;
    --shadow-card  : 0 2px 12px rgba(26,32,53,0.07);
    --shadow-card-h: 0 8px 24px rgba(26,32,53,0.12);
}

/* ==============================================================================
 * [C] GLOBAL FONT OVERRIDE — Timpa Lato bawaan Atlantis
 * ============================================================================== */
html, body,
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6,
p, span, a, label, input, button, select, textarea,
.navbar, .navbar-brand, .brand, .sidebar, .sidebar-content,
.nav-item, .sub-item, .user .info, .user .info span, .user-level,
.card-title, .card-category, .numbers, .numbers .card-title,
.btn, .btn-simple, .badge, .alert, .table, td, th,
.modal-title, .dropdown-item, .dropdown-title, .pagination,
.form-control, .input-group-text, .tooltip, .popover {
    font-family: var(--font-body) !important;
}

body {
    font-size        : 14px;
    letter-spacing   : 0em;
    -webkit-font-smoothing   : antialiased;
    -moz-osx-font-smoothing  : grayscale;
    text-rendering           : optimizeLegibility;
    /* Scroll momentum untuk Android & iOS */
    -webkit-overflow-scrolling: touch;
}

/* ==============================================================================
 * [C] TIPOGRAFI HIERARKI
 * ============================================================================== */
h1, .h1, h2, .h2, h3, .h3, h4, .h4,
.card-title, .modal-title, .navbar-brand {
    font-family : var(--font-heading) !important;
    font-weight : 700 !important;
    letter-spacing: -0.01em !important;
}

h1, .h1 { font-size: 1.7rem;  }
h2, .h2 { font-size: 1.4rem;  }
h3, .h3 { font-size: 1.2rem;  }
h4, .h4 { font-size: 1.05rem; }

.card-category, .card-stats .numbers .card-category {
    font-family   : var(--font-heading) !important;
    font-weight   : 700 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    font-size     : 11px !important;
}

.numbers .card-title {
    font-weight   : 800 !important;
    letter-spacing: -0.02em !important;
}

/* Sidebar nav text */
.sidebar .nav > .nav-item a p {
    font-weight   : 600 !important;
    letter-spacing: 0em !important;
    font-size     : 13.5px !important;
}

.sidebar .nav > .nav-item.active a p { font-weight: 700 !important; }

.sidebar .user .info .user-level {
    font-size  : 11px !important;
    font-weight: 600 !important;
}

/* Badge & Button */
.badge { font-weight: 700 !important; letter-spacing: 0.02em !important; }
.btn   { font-weight: 700 !important; letter-spacing: 0em !important; }

/* Table */
.table thead th {
    font-weight   : 700 !important;
    letter-spacing: 0.04em !important;
    font-size     : 11.5px !important;
    text-transform: uppercase !important;
}

.table tbody td {
    letter-spacing: 0em !important;
    font-size     : 13.5px !important;      /* sedikit lebih besar untuk Android */
    line-height   : 1.6 !important;
}

/* Form */
.form-control, input, select, textarea {
    letter-spacing: 0em !important;
    font-size     : 14px !important;        /* Cegah auto-zoom iOS/Android */
}

label, .font-weight-bold { letter-spacing: 0em !important; }

/* ==============================================================================
 * [B] MOBILE SKIN — Overlay CSS di atas Atlantis
 * Semua override di bawah ini murni penambahan, tidak mengubah file Atlantis.
 * ============================================================================== */

/* -----------------------------------------------------------------------
   B1. Kartu (Card) — Radius modern, shadow lebih lembut
   ----------------------------------------------------------------------- */
.card {
    border-radius: var(--radius-card) !important;
    border       : 1px solid var(--color-border) !important;
    box-shadow   : var(--shadow-card) !important;
    transition   : box-shadow 0.25s ease, transform 0.25s ease !important;
}

.card:hover {
    box-shadow: var(--shadow-card-h) !important;
}

.card-round { border-radius: var(--radius-card) !important; }

/* -----------------------------------------------------------------------
   B2. Tombol — Touch target minimal 44px (standar WCAG & Google)
   ----------------------------------------------------------------------- */
.btn {
    border-radius: var(--radius-btn) !important;
    min-height   : 38px;
    padding-top  : 0.45rem;
    padding-bottom: 0.45rem;
    transition   : all 0.2s ease !important;
}

.btn-sm  { min-height: 32px; border-radius: 7px !important; }
.btn-lg  { min-height: 50px; border-radius: 12px !important; }
.btn-round { border-radius: 50px !important; }

/* -----------------------------------------------------------------------
   B3. Form Input — Ukuran tap area nyaman di layar kecil
   ----------------------------------------------------------------------- */
.form-control {
    border-radius: var(--radius-input) !important;
    min-height   : 42px !important;
    border       : 1.5px solid #d1d5db !important;
    transition   : border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.form-control:focus {
    border-color: var(--color-primary) !important;
    box-shadow  : 0 0 0 3px rgba(29,122,243,0.15) !important;
    outline     : none !important;
}

select.form-control { appearance: auto; }

/* -----------------------------------------------------------------------
   B4. Tabel — Lebih nyaman dibaca di layar kecil
   ----------------------------------------------------------------------- */
.table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}

.table tbody tr:hover { background-color: rgba(29,122,243,0.04) !important; }

.table thead th {
    background    : #f8fafc !important;
    border-bottom : 2px solid #e2e8f0 !important;
    padding       : 10px 12px !important;
    white-space   : nowrap;
}

.table tbody td { padding: 10px 12px !important; vertical-align: middle !important; }

/* -----------------------------------------------------------------------
   B5. Badge — Lebih terbaca
   ----------------------------------------------------------------------- */
.badge {
    border-radius: 6px !important;
    padding      : 4px 8px !important;
    font-size    : 11px !important;
}

.badge-pill { border-radius: 50px !important; }

/* -----------------------------------------------------------------------
   B6. Navbar & Logo Header — Lebih rapat di mobile
   ----------------------------------------------------------------------- */
.logo-header {
    box-shadow: 0 2px 10px rgba(0,0,0,0.12) !important;
}

/* -----------------------------------------------------------------------
   B7. Sidebar — Scrolling lebih mulus di Android
   ----------------------------------------------------------------------- */
.sidebar .sidebar-wrapper {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

.sidebar .nav > .nav-item > a {
    border-radius: 8px !important;
    margin      : 1px 8px !important;
    transition  : background 0.2s ease, color 0.2s ease !important;
}

.sidebar .nav > .nav-item.active > a {
    border-radius: 8px !important;
}

/* -----------------------------------------------------------------------
   B8. Modal — Fullscreen di HP kecil
   ----------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin      : 0.5rem auto !important;
        max-width   : calc(100vw - 1rem) !important;
    }
    .modal-content { border-radius: 14px !important; }
}

/* -----------------------------------------------------------------------
   B9. Dropdown — Cegah terpotong di layar kecil
   ----------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    .dropdown-menu {
        max-width : 90vw !important;
        right     : 0 !important;
        left      : auto !important;
    }

    /* Dropdown user profile di navbar */
    .dropdown-user {
        right: 0 !important;
        left : auto !important;
    }
}

/* ==============================================================================
 * [B] MOBILE-SPECIFIC OVERRIDES — max-width: 767px (Portrait Android)
 * ============================================================================== */
@media (max-width: 767.98px) {

    /* -- Konten utama -- */
    .page-inner {
        padding-left : 12px !important;
        padding-right: 12px !important;
    }

    .main-panel .container {
        padding-left : 8px !important;
        padding-right: 8px !important;
    }

    /* -- Kartu stat -- */
    .card-body { padding: 14px !important; }

    .card-stats .numbers .card-title {
        font-size: 1.8rem !important;
    }

    /* -- Quick action widget -- */
    .quick-action-widget {
        padding      : 12px 14px !important;
        border-radius: 12px !important;
        margin-bottom: 10px !important;
    }

    .quick-action-widget .icon-wrapper {
        width        : 44px !important;
        height       : 44px !important;
        border-radius: 11px !important;
        font-size    : 18px !important;
        margin-right : 12px !important;
        flex-shrink  : 0 !important;
    }

    .quick-action-widget .text-wrapper .title   { font-size: 13px !important; }
    .quick-action-widget .text-wrapper .subtitle { font-size: 11px !important; }

    /* -- Page header -- */
    .d-flex.flex-column.flex-md-row h2 { font-size: 1.35rem !important; }

    /* -- Tombol di header -- */
    .ml-md-auto.py-2 .btn {
        font-size  : 12px !important;
        padding    : 6px 14px !important;
        margin-top : 4px !important;
        display    : inline-block !important;
    }

    /* -- Tabel -- */
    .table thead th { font-size: 10.5px !important; padding: 8px 10px !important; }
    .table tbody td { font-size: 13px !important;   padding: 8px 10px !important; }

    /* -- Card header -- */
    .card-header { padding: 14px 16px !important; }
    .card-title  { font-size: 0.98rem !important; }

    /* -- Badge di card -- */
    .card-header .badge { font-size: 10px !important; }

    /* -- Form label -- */
    label { font-size: 13px !important; }

    /* -- Alert -- */
    .alert { font-size: 13px !important; border-radius: 10px !important; }

    /* -- Footer -- */
    .footer { padding: 12px 16px !important; font-size: 12px !important; }

    /* -- Section title -- */
    .text-section { font-size: 10px !important; }
}

/* ==============================================================================
 * [B] SMALL PHONE — max-width: 390px (HP kecil, Android entry level)
 * ============================================================================== */
@media (max-width: 390px) {

    body { font-size: 13.5px; }

    .card-stats .numbers .card-title { font-size: 1.6rem !important; }

    .quick-action-widget .icon-wrapper {
        width : 38px !important;
        height: 38px !important;
    }

    .btn { font-size: 12px !important; padding: 6px 12px !important; }

    .table thead th { font-size: 10px !important; }
    .table tbody td { font-size: 12px !important; }
}

/* ==============================================================================
 * [B] LANDSCAPE PHONE — max-height: 430px (HP di posisi landscape)
 * ============================================================================== */
@media (max-height: 430px) and (orientation: landscape) {
    .sidebar {
        overflow-y: auto !important;
    }

    .logo-header { height: 50px !important; }
}

/* ==============================================================================
 * [B] SCROLL REFINEMENTS — Semua area scroll
 * ============================================================================== */
* {
    scroll-behavior: smooth;
}

::-webkit-scrollbar              { width: 4px; height: 4px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover  { background: #94a3b8; }

/* ==============================================================================
 * [B] ANIMASI — Lebih lembut, hemat daya baterai
 * ============================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration  : 0.01ms !important;
        transition-duration : 0.01ms !important;
    }
}

/* ==============================================================================
 * [B] LOGIN & AUTHENTICATION SCREENS — Mobile Optimization
 * ============================================================================== */
@media (max-width: 767.98px) {
    .login .wrapper.wrapper-login.wrapper-login-full {
        flex-direction: column !important;
        min-height: 100vh;
    }
    .login .login-aside {
        width: 100% !important;
        padding: 2rem 1.5rem !important;
    }
    .login .login-aside:first-child {
        padding: 2.5rem 1.5rem 1.5rem !important;
    }
    .login .container-login {
        padding: 24px 18px !important;
        max-width: 100% !important;
        box-shadow: none !important;
        border-radius: 12px !important;
    }
    .login .login-aside .title {
        font-size: 1.8rem !important;
    }
    .login .login-aside .subtitle {
        font-size: 1rem !important;
    }
}

