:root {
    --tm-primary: #1f6f64;
    --tm-primary-dark: #15534b;
    --tm-surface: #f6f8f7;
}

body {
    background: var(--tm-surface);
}

.bg-primary,
.btn-primary {
    background-color: var(--tm-primary) !important;
    border-color: var(--tm-primary) !important;
}

.btn-primary:hover {
    background-color: var(--tm-primary-dark) !important;
    border-color: var(--tm-primary-dark) !important;
}

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #eef7f4 0%, #f9fbf7 52%, #f3f0e8 100%);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(100%, 420px);
    background: #fff;
    border: 1px solid #dfe7e3;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 18px 40px rgba(17, 50, 46, .09);
}

.brand-mark {
    display: inline-grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 8px;
    background: var(--tm-primary);
    color: #fff;
    font-weight: 700;
}

.stat-card,
.panel {
    background: #fff;
    border: 1px solid #e2e8e5;
    border-radius: 8px;
    padding: 18px;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
}

.badge-soft {
    background: #eef3f1;
    color: #31534d;
}

/* ── Mobile Top Bar ───────────────────────────────── */

.mobile-topbar {
    background: var(--tm-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.mobile-topbar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: .3px;
}

.mobile-topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .85rem;
    opacity: .9;
}

.mobile-logout {
    color: #fff;
    background: rgba(255,255,255,.2);
    border-radius: 6px;
    padding: 3px 10px;
    text-decoration: none;
    font-size: .8rem;
}

/* ── Bottom Navigation Bar ────────────────────────── */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: #fff;
    border-top: 1px solid #e2e8e5;
    display: flex;
    z-index: 1040;
    box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: #888;
    transition: color .15s;
    padding: 6px 4px;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item.active {
    color: var(--tm-primary);
}

.bottom-nav-item:active {
    background: #f0f7f5;
}

.bottom-nav-icon {
    font-size: 22px;
    line-height: 1;
}

.bottom-nav-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .2px;
    line-height: 1;
}

/* Padding bawah supaya content tak tersembunyi di bawah bottom nav */
.pb-bottom-nav {
    padding-bottom: 76px !important;
}

/* Safe area untuk iPhone X ke atas (notch) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        height: calc(62px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
    }
    .pb-bottom-nav {
        padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important;
    }
}

/* ── Mobile responsiveness ─────────────────────────── */

/* Smaller panel padding on mobile */
@media (max-width: 767.98px) {
    main.container-fluid {
        padding-left: 12px;
        padding-right: 12px;
        padding-top: 16px;
    }

    .panel, .stat-card {
        padding: 14px;
    }

    /* Larger touch targets for buttons */
    .btn {
        min-height: 40px;
    }
    .btn-sm {
        min-height: 34px;
        min-width: 34px;
    }

    /* Display numbers smaller on mobile */
    .display-6 {
        font-size: 1.6rem;
    }

    /* Stack action buttons */
    .d-flex.gap-2 > .btn {
        flex: 1 1 auto;
        text-align: center;
    }

    /* Page title row */
    .d-flex.justify-content-between.align-items-center {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Navbar user info — stack below links */
    .navbar-collapse .ms-lg-auto {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid rgba(255,255,255,.2);
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Form controls — bigger on mobile */
    .form-control, .form-select {
        font-size: 16px; /* prevent iOS zoom */
    }

    /* Hide secondary table columns on mobile */
    .col-hide-mobile {
        display: none !important;
    }

    /* Date nav buttons full width on mobile */
    .btn-group .btn {
        flex: 1;
    }

    /* Card-style record rows (alternative to table on mobile) */
    .rekod-card {
        background: #fff;
        border: 1px solid #e2e8e5;
        border-radius: 8px;
        padding: 12px 14px;
        margin-bottom: 10px;
    }
}

@media (min-width: 768px) {
    .col-hide-mobile {
        display: table-cell !important;
    }
    .rekod-card {
        display: none;
    }
}

/* Manzil table — hide less critical cols on tablet */
@media (max-width: 991.98px) {
    .col-hide-tablet {
        display: none !important;
    }
}

@media (min-width: 992px) {
    .col-hide-tablet {
        display: table-cell !important;
    }
}
