/* ================= RESET ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: #f5f7fb;
    color: #222;
    font-size: 14px;
}

img {
    max-width: 100%;
}

/* ================= LOGIN ================= */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #7a1f2b, #a83244);
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: white;
    padding: 35px;
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    text-align: center;
}

.login-card input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* ================= SIDEBAR ================= */
.sidebar {
    width: 240px;
    height: 100vh;
    background: linear-gradient(180deg, #7a1f2b, #5e1822);
    color: white;
    position: fixed;
    padding: 20px;
}

.sidebar a {
    display: block;
    padding: 12px;
    border-radius: 8px;
    color: white;
    text-decoration: none;
}

.sidebar a.active {
    background: rgba(255,255,255,0.2);
}

/* ================= MAIN ================= */
.main {
    margin-left: 240px;
    min-height: 100vh;
}

/* ================= TOPBAR ================= */
.topbar {
    height: 60px;
    background: white;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 20px;
}

/* ================= CONTENT ================= */
.content {
    padding: 30px;
    max-width: 1200px;
    margin: auto;
}

/* ================= CARD ================= */
.card {
    background: white;
    padding: 18px;
    border-radius: 14px;
    margin-bottom: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

/* ================= GRID ================= */
.stat-slider,
.barang-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ================= BUTTON ================= */
button, .btn {
    background: #7a1f2b;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
}

/* ================= TABLE ================= */
.table-container {
    width: 100%;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: #7a1f2b;
    color: white;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: center;
}

/* ================= STATUS ================= */
.status-badge {
    padding: 8px 14px;       /* 🔥 lebih lega */
    border-radius: 20px;
    color: white;
    font-size: 13px;
    font-weight: 500;
}

/* ================= STATUS COLOR ================= */
.status-pending {
    background: #999;
}

.status-disetujui {
    background: #2ecc71;
}

.status-dikembalikan {
    background: orange;
}

.status-selesai {
    background: #3498db;
}

/* ================= STATUS GRID ================= */
.status-grid {
    display: flex;
    gap: 12px;           /* 🔥 jarak antar badge */
    flex-wrap: wrap;     /* 🔥 biar turun kalau sempit */
    margin-top: 10px;
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {

    /* layout */
    .sidebar {
        display: none;
    }

    .main {
        margin: 0;
    }

    .content {
        padding: 12px;
        padding-bottom: 100px;
    }

    /* grid */
    .stat-slider,
    .barang-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* menu */
    .menu-grid {
        display: grid;
        gap: 10px;
    }

    .menu-item {
        background: white;
        height: 80px;
        border-radius: 14px;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
    }

    /* bottom nav */
    .bottom-nav {
        position: fixed;
        bottom: 0;
        width: 100%;
        height: 65px;
        background: white;
        display: flex;
        justify-content: space-around;
        align-items: center;
    }

    /* 🔥 TABLE FIT SCREEN (TANPA SCROLL) */
    .admin-table {
        table-layout: fixed;
    }

    .admin-table th,
    .admin-table td {
        font-size: 10px;
        padding: 6px;
        word-break: break-word;
    }

    /* 🔥 KALENDER */
    #calendar {
        width: 100%;
        overflow: hidden;
    }

    .fc {
        font-size: 10px;
    }

}

/* ================= LOCK DESKTOP (JANGAN DIUBAH) ================= */
@media (min-width: 769px) {

    table,
    .admin-table {
        display: table !important;
        width: 100% !important;
        min-width: unset !important;
        table-layout: auto !important;
    }

    thead {
        display: table-header-group !important;
    }

    tbody {
        display: table-row-group !important;
    }

    tr {
        display: table-row !important;
    }

    th, td {
        display: table-cell !important;
        white-space: normal !important;
    }

}

/* ================= MOBILE ONLY FIX ================= */
@media (max-width: 768px) {

    html, body {
        overflow-x: hidden !important;
    }

    .admin-table {
        width: 100% !important;
        table-layout: fixed !important;
    }

    .admin-table th,
    .admin-table td {
        font-size: 10px !important;
        padding: 6px !important;
        word-break: break-word;
    }

    /* tombol tidak numpuk */
    .admin-table td button {
        width: 100%;
        margin-bottom: 4px;
    }

}

/* ================= SIDEBAR LOGO FIX ================= */
.sidebar-logo {
    width: 45px !important;
    margin-bottom: 8px;
}

.logo-text {
    font-size: 14px;
}

/* ================= FORM TEMPAT DESKTOP ================= */
@media (min-width: 769px) {

    form input[type="text"],
    form input[type="number"],
    form input[type="file"] {
        width: 220px;
        padding: 10px;
        margin-right: 10px;
    }

    form button {
        padding: 10px 16px;
    }

}

/* ================= FORM TAMBAH BARANG ================= */
@media (min-width: 769px) {

    .form-inner input,
    .form-inner select {
        width: 250px;
    }

}

/* ================= KOP SURAT FIX ================= */
.kop-logo img {
    width: 60px !important;
    height: auto;
}

.kop-text h2 {
    font-size: 16px;
}

.kop-text h3 {
    font-size: 14px;
}
/* ================= LOGIN DESKTOP CLEAN ================= */
@media (min-width: 769px) {

    body.login-page {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .login-container {
        max-width: 420px;
        width: 100%;
    }

    .login-card {
        padding: 40px;
        border-radius: 16px;
        box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    }

    .login-card h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .login-card input {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }

    .login-card button {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }

}

/* ================= KOP SURAT PROFESSIONAL ================= */
.kop-resmi {
    display: flex;
    align-items: center;
    justify-content: space-between;

    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;   /* 🔥 tambah tinggi kop */
}

/* logo kiri kanan */
/* ================= KOP LOGO BESAR FINAL ================= */
.kop-logo {
    width: 160px;   /* 🔥 ruang lebih besar */
    display: flex;
    justify-content: center;
    align-items: center;
}

.kop-logo img {
    width: 140px !important;   /* 🔥 paksa besar */
    height: auto;
}

/* text */
.kop-text {
    flex: 1;
    text-align: center;
    line-height: 1.4;
    padding: 0 10px;
}

/* ================= FIX UKURAN JUDUL ================= */
.kop-text h2 {
    font-size: 18px !important;  /* 🔥 balik ke ukuran awal */
    font-weight: bold;
}

.kop-text h3 {
    font-size: 16px !important;
}

.kop-text p {
    font-size: 14px !important;
}

/* garis */
.garis-kop {
    max-width: 900px;
    margin: 10px auto 20px;
    border: 2px solid black;
}

/* ================= TTD HORIZONTAL ================= */
.ttd-container {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    text-align: center;
}

.ttd-item {
    width: 30%;
}

.ttd-item p {
    margin: 4px 0;
}

/* ================= FORM TEMPAT RAPI (DESKTOP) ================= */
@media (min-width: 769px) {

    form {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }

    form input[type="text"],
    form input[type="number"],
    form input[type="file"],
    form textarea {
        height: 38px;
        padding: 8px;
        border-radius: 6px;
        border: 1px solid #ccc;
    }

    /* ukuran masing-masing */
    form input[type="text"] {
        width: 180px;
    }

    form input[type="number"] {
        width: 120px;
    }

    form input[type="file"] {
        width: 180px;
    }

    form textarea {
        width: 220px;
        height: 38px;
        resize: none;
    }

    /* tombol */
    form button {
        height: 38px;
        padding: 0 16px;
    }

}

/* ================= TAMBAH BARANG FORM RAPI ================= */
@media (min-width: 769px) {

    .card form {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
    }

        .card form label {
        font-size: 13px;
        margin-right: 5px;
        white-space: nowrap;
    }

        .card form input,
    .card form textarea {
        height: 38px;
        padding: 8px;
        border-radius: 6px;
        border: 1px solid #ccc;
    }

        /* nama barang */
    .card form input[type="text"] {
        width: 180px;
    }

    /* jumlah */
    .card form input[type="number"] {
        width: 100px;
    }

    /* file */
    .card form input[type="file"] {
        width: 180px;
    }

    /* spesifikasi */
    .card form textarea {
        width: 220px;
        height: 38px;
        resize: none;
    }

        .card form button {
        height: 38px;
        padding: 0 16px;
        white-space: nowrap;
    }

}

/* ================= TABLE HEADER MAROON ================= */

/* ================= TABLE LAPORAN CLEAN ================= */

.laporan-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-family: 'Times New Roman', serif;
    font-size: 14px;
    border-top: 4px solid #7a1f2b;
}

/* HEADER */
.laporan-table th {
    background: #7a1f2b;
    color: white;
    padding: 10px;
    text-align: center;
    border: 1px solid #000;
    font-weight: bold;
}

/* ISI */
.laporan-table td {
    padding: 8px;
    border: 1px solid #000;
    text-align: center;
}

/* ZEBRA (biar enak dibaca) */
.laporan-table tr:nth-child(even) {
    background: #f5f5f5;
}

/* ================= PRINT COLOR FIX ================= */
@media print {

    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

}

/* ================= PRINT MODE ================= */
@media print {

    body {
        background: white;
    }

    .laporan-container {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* hilangkan tombol print */
    button {
        display: none;
    }

    /* section spacing */
    .section-title {
        margin-top: 20px;
        font-weight: bold;
    }

}

/* ================= LOGIN PREMIUM CENTER (FINAL FIX) ================= */
body.login-page {
    margin: 0;
    font-family: 'Inter', sans-serif;

    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;

    background: #eef1f5;
}

/* card */
.login-card {
    width: 100%;
    max-width: 460px;

    background: #ffffff;
    padding: 48px;

    border-radius: 18px;

    box-shadow: 
        0 10px 30px rgba(0,0,0,0.08),
        0 20px 60px rgba(0,0,0,0.06);

    text-align: center;
}

/* logo */
.login-logo {
    height: 70px;
    margin-bottom: 18px;
}

/* title */
.login-card h2 {
    font-size: 26px;
    margin-bottom: 6px;
    font-weight: 600;
}

.subtitle {
    font-size: 14px;
    color: #777;
    margin-bottom: 28px;
}

/* form */
.login-card form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

/* ================= INPUT (PASTI SAMA) ================= */
.login-card input {
    width: 100%;
    height: 54px;

    padding: 0 16px;

    border-radius: 12px;
    border: 1px solid #e0e0e0;

    font-size: 15px;
    box-sizing: border-box;
}

/* focus */
.login-card input:focus {
    outline: none;
    border-color: #7a1f2b;
    box-shadow: 0 0 0 3px rgba(122,31,43,0.08);
}

/* ================= BUTTON (LEBIH PROPORSIONAL) ================= */
.btn-primary {
    width: 80%;                 /* 🔥 tidak full */
    height: 52px;

    margin: 10px auto 0;        /* 🔥 center */

    border-radius: 12px;
    border: none;

    font-size: 15px;
    font-weight: 500;

    background: #7a1f2b;
    color: white;

    cursor: pointer;
    transition: 0.2s;
}

/* hover */
.btn-primary:hover {
    background: #641823;
    transform: translateY(-1px);
}

/* link */
.switch {
    margin-top: 16px;
    font-size: 14px;
}

/* ================= FINAL LOCK (ANTI NGACO) ================= */

/* paksa semua isi form identik */
.login-card form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* 🔥 KUNCI UTAMA */
.login-card form input,
.login-card form button {
    width: 100%;
    height: 54px;

    margin: 0;
    padding: 0 16px;

    border-radius: 12px;
    font-size: 15px;

    box-sizing: border-box;
    display: block;
}

/* input */
.login-card form input {
    border: 1px solid #e0e0e0;
}

/* button */
.login-card form button {
    border: none;
    background: #7a1f2b;
    color: white;
}

/* kalau mau tombol tidak terlalu lebar */
.login-card form button.btn-primary {
    width: 80%;
    margin: 10px auto 0;
}

/* ================= HIDE MENU CEPAT DI DESKTOP ================= */
/* hanya sembunyikan untuk mahasiswa */
@media (min-width: 769px) {
    body.mahasiswa .menu-grid {
        display: none !important;
    }
}

/* ================= LOCK ADMIN - FIX MAHASISWA ================= */
@media (min-width: 769px) {

    /* 🔥 hanya mahasiswa */
    body.mahasiswa .menu-grid {
        display: none !important;
    }

}


/* ================= FIX MENU CEPAT ================= */

/* 🔥 default: sembunyikan mobile-only di desktop */
@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}

/* 🔥 tampilkan hanya di mobile */
@media (max-width: 768px) {
    .mobile-only {
        display: block;
    }
}

/* ================= HIDE LINK KALENDER & TEMPAT (MAHASISWA DESKTOP) ================= */
@media (min-width: 769px) {

    /* target link kalender & tempat di dashboard */
    body .content a[href="/kalender"],
    body .content a[href="/peminjaman-tempat"] {
        display: none !important;
    }

}

@media (min-width: 769px) {
    .content i[data-lucide="calendar"],
    .content i[data-lucide="map-pin"] {
        display: none !important;
    }
}

/* ================= TEMPAT MAHASISWA DESKTOP GRID ================= */
@media (min-width: 769px) {

    .tempat-title {
        font-size: 22px;
        font-weight: 600;
        margin-bottom: 20px;
    }

    /* ================= GRID TEMPAT ================= */
    .tempat-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 18px;
        margin-bottom: 30px;
    }

    .tempat-card-item {
        cursor: pointer;
        border: 1px solid #ddd;
        border-radius: 12px;
        padding: 12px;
        background: #fff;
        transition: 0.2s;
    }

    .tempat-card-item:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    }

    .tempat-card-item.active {
        border: 2px solid #7a1f2b;
        background: #fff6f7;
    }

    .tempat-card-item img {
        width: 100%;
        height: 130px;
        object-fit: cover;
        border-radius: 10px;
        margin-bottom: 8px;
    }

    /* ================= TEMPAT GRID 3 KOLOM ================= */
@media (min-width: 769px) {

    /* 🔥 GRID TEMPAT 3 KOLOM */
    .tempat-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 🔥 FIX 3 KOLOM */
        gap: 20px;
        margin-bottom: 30px;
    }

    .tempat-card-item {
        cursor: pointer;
        border: 1px solid #ddd;
        border-radius: 12px;
        padding: 12px;
        background: #fff;
        transition: 0.2s;
    }

    .tempat-card-item:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    }

    .tempat-card-item.active {
        border: 2px solid #7a1f2b;
        background: #fff6f7;
    }

    .tempat-card-item img {
        width: 100%;
        height: 140px;
        object-fit: cover;
        border-radius: 10px;
        margin-bottom: 8px;
    }

}

    /* ================= FORM FULL DI BAWAH ================= */
    .tempat-form-box {
        width: 100%;              /* 🔥 full bawah */
        max-width: 700px;         /* biar gak kepanjangan */
        margin: 0 auto;           /* center */

        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;

        background: #fff;
        padding: 24px;
        border-radius: 14px;
        box-shadow: 0 8px 25px rgba(0,0,0,0.05);
    }

    /* input */
    .tempat-form-box input {
        width: 100%;
        height: 44px;
        border-radius: 10px;
        border: 1px solid #ddd;
        padding: 0 12px;
        font-size: 14px;
    }

    /* textarea full */
    .tempat-textarea {
        grid-column: span 2;
    }

    .tempat-textarea textarea {
        width: 100%;
        min-height: 90px;
        border-radius: 10px;
        border: 1px solid #ddd;
        padding: 10px;
        font-size: 14px;
    }

    /* tombol */
    .btn-submit {
        grid-column: span 2;
        height: 48px;
        border-radius: 12px;
        border: none;
        background: #7a1f2b;
        color: white;
        font-weight: 500;
        cursor: pointer;
    }

    .btn-submit:hover {
        background: #641823;
    }

}

/* ================= PENGEMBALIAN MAHASISWA DESKTOP ================= */
@media (min-width: 769px) {

    /* 🔥 FULL WIDTH WRAPPER */
    .table-wide-full {
        width: 100%;
        margin-bottom: 10px;
    }

    /* 🔥 TABLE FULL */
    .admin-table {
        width: 100%;
        border-collapse: collapse;
        background: #fff;
    }

    /* header */
    .admin-table thead th {
        background: #7a1f2b;
        color: white;
        padding: 12px;
        font-size: 14px;
        text-align: center;
    }

    /* body */
    .admin-table td {
        padding: 12px;
        border-bottom: 1px solid #eee;
        text-align: center;
    }

    /* 🔥 input dalam table biar rapi */
    .admin-table input[type="number"],
    .admin-table input[type="file"] {
        width: 100%;
        max-width: 120px;
        padding: 6px;
        border-radius: 8px;
        border: 1px solid #ccc;
        font-size: 13px;
    }

    /* 🔥 tombol di bawah kanan */
    .pengembalian-action {
        width: 100%;
        margin-top: 20px;
        display: flex;
        justify-content: flex-end;
    }

    .btn-success {
        height: 46px;
        padding: 0 24px;
        border-radius: 10px;
        border: none;
        background: #7a1f2b;
        color: white;
        font-size: 14px;
        cursor: pointer;
    }

    .btn-success:hover {
        background: #641823;
    }

}

/* ================= ADMIN MOBILE TOPBAR ================= */
@media (max-width: 768px) {

    .top-logo {
        height: 36px;   /* 🔥 dari gede → kecil proporsional */
        width: auto;
        object-fit: contain;
    }

    .top-text .top-title {
        font-size: 14px;
        font-weight: 600;
    }

    .top-user {
        font-size: 12px;
        color: #666;
    }

}

/* ================= MENU CEPAT ADMIN MOBILE ================= */
@media (max-width: 768px) {

    .menu-grid.admin-menu {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 🔥 3 kolom */
        gap: 10px;

        padding: 10px; /* 🔥 rapihin pinggir */
    }

    .menu-item {
        background: white;
        padding: 12px 8px;
        border-radius: 12px;

        text-align: center;
        font-size: 12px;

        box-shadow: 0 3px 8px rgba(0,0,0,0.05);
    }

    .menu-item i {
        display: block;
        margin-bottom: 5px;
        width: 18px;
        height: 18px;
    }

}

/* ================= BOTTOM NAV MOBILE ================= */
@media (max-width: 768px) {

    .bottom-nav {
        background: #fff;
        border-top: 1px solid #eee;
    }

    /* 🔥 default icon */
    .bottom-nav a {
        color: #999; /* abu dulu */
    }

    .bottom-nav a i {
        color: inherit;
        width: 22px;
        height: 22px;
    }

    /* 🔥 ACTIVE = MAROON */
    .bottom-nav a.active {
        color: #7a1f2b;
    }

    /* 🔥 hover (optional biar hidup) */
    .bottom-nav a:hover {
        color: #7a1f2b;
    }

}

/* ================= TOPBAR MOBILE FIX ================= */
@media (max-width: 768px) {

    .mobile-topbar {
        padding: 10px 12px;
    }

    .top-left {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    /* 🔥 logo kecil & stabil */
    .top-logo {
        height: 34px;
        width: auto;
        flex-shrink: 0;
    }

    /* 🔥 text jangan numpuk */
    .top-text {
        display: flex;
        flex-direction: column;
        justify-content: center;

        line-height: 1.2;
    }

    .top-title {
        font-size: 14px;
        font-weight: 600;
        margin: 0;
    }

    .top-user {
        font-size: 11px;
        color: #777;
    }

}

/* ================= MENU CEPAT MAHASISWA MOBILE ================= */
@media (max-width: 768px) {

    /* 🔥 override grid lama */
    .menu-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr); /* 🔥 2 kolom */
        gap: 12px;
        padding: 10px;
    }

    .menu-item {
        background: white;
        border-radius: 12px;
        padding: 14px;

        text-align: center;
        font-size: 13px;

        box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    }

    .menu-item i {
        display: block;
        margin-bottom: 6px;
        width: 20px;
        height: 20px;
    }

}

/* ================= FORM TANGGAL MOBILE MAHASISWA ================= */
@media (max-width: 768px) {

    .tempat-form-grid {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 🔥 2 kolom sejajar */
        gap: 10px;
    }

    .tempat-form-grid input {
        width: 100%;
        height: 42px;

        padding: 0 10px;
        border-radius: 10px;
        border: 1px solid #ddd;

        font-size: 13px;
        box-sizing: border-box;
    }

}

/* ================= PEMINJAMAN TEMPAT MOBILE FINAL ================= */
@media (max-width: 768px) {

    /* 🔥 grid tanggal sejajar */
    .tempat-form-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    /* 🔥 semua input sama ukuran */
    .tempat-form-grid input {
        width: 100% !important;
        height: 44px;

        padding: 0 12px;
        border-radius: 10px;
        border: 1px solid #ddd;

        font-size: 14px;
        box-sizing: border-box;
    }

    /* 🔥 label konsisten */
    .tempat-form-grid label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    /* 🔥 textarea full bawah */
    .tempat-textarea {
        width: 100%;
        margin-top: 10px;
    }

    .tempat-textarea textarea {
        width: 100% !important;
        min-height: 90px;

        padding: 10px;
        border-radius: 10px;
        border: 1px solid #ddd;

        font-size: 14px;
        box-sizing: border-box;
    }

    /* 🔥 tombol full biar enak tap */
    .btn-submit {
        width: 100%;
        height: 46px;
        margin-top: 12px;
        border-radius: 12px;
    }

}

/* ================= FIX CLICK MOBILE ================= */

/* 🔥 pastikan card bisa diklik */
.tempat-card-item {
    position: relative;
    z-index: 1;
}

/* 🔥 gambar jangan blok klik */
.tempat-card-item img {
    pointer-events: none;
}

/* 🔥 pastikan klik jalan */
.tempat-card-item img {
    pointer-events: none;
}

/* 🔥 aktif */
.tempat-card-item.active {
    border: 2px solid #7a1f2b;
    background: #fff6f7;
}

@media (max-width: 768px) {
    .tempat-form-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ================= MOBILE FINAL FIX (TEMPAT + TANGGAL) ================= */
@media (max-width: 768px) {

    /* 🔥 GLOBAL */
    * {
        box-sizing: border-box;
    }

    html, body {
        overflow-x: hidden;
    }

    .content {
        padding: 12px;
        width: 100%;
    }

    /* ================= TEMPAT ================= */
    .tempat-form-box {
        width: 100%;
        padding: 12px;
        border-radius: 12px;
    }

    .tempat-form-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .tempat-form-grid > div {
        width: 100%;
    }

    .tempat-form-box label {
        font-size: 13px;
        margin-bottom: 5px;
        display: block;
    }

    .tempat-form-box input,
    .tempat-form-box textarea {
        width: 100%;
        height: 46px;
        padding: 0 12px;

        border-radius: 10px;
        border: 1px solid #ddd;

        display: block;
        box-sizing: border-box;
    }

    .tempat-form-box textarea {
        height: auto;
        min-height: 100px;
        padding: 10px 12px;
    }

    .btn-submit {
        width: 100%;
        height: 46px;
        margin-top: 10px;
    }

    /* ================= TANGGAL DASHBOARD ================= */
    .form-tanggal,
    .dashboard-filter,
    .filter-tanggal {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .form-tanggal > div,
    .dashboard-filter > div,
    .filter-tanggal > div {
        width: 100%;
    }

    .form-tanggal label,
    .dashboard-filter label,
    .filter-tanggal label {
        font-size: 13px;
        margin-bottom: 5px;
        display: block;
    }

    input[type="date"] {
        width: 100%;
        max-width: 100%;

        height: 48px;
        padding: 0 14px;

        border-radius: 12px;
        border: 1px solid #ddd;

        font-size: 15px;

        display: block;
        box-sizing: border-box;
    }

    .btn-tanggal {
        width: 100%;
        height: 48px;
        border-radius: 12px;
    }

}

/* ================= FIX KHUSUS DASHBOARD TANGGAL ================= */
@media (max-width: 768px) {

    /* 🔥 card dashboard */
    .card {
        padding: 16px !important;
    }

    /* 🔥 wrapper form tanggal */
    .form-tanggal {
        width: 100%;
    }

    /* 🔥 SETIAP FIELD */
    .form-tanggal > div {
        width: 100%;
    }

    /* 🔥 LABEL */
    .form-tanggal label {
        display: block;
        margin-bottom: 6px;
    }

    /* 🔥 INI KUNCI UTAMA */
    .form-tanggal input[type="date"] {
        width: calc(100% - 0px) !important; /* 🔥 FIX PRESISI */
        max-width: 100% !important;

        height: 46px !important;
        padding: 0 12px !important;

        border-radius: 12px;
        border: 1px solid #ddd;

        box-sizing: border-box !important;
        display: block;
    }

    /* 🔥 tombol */
    .btn-tanggal {
        width: 160px; /* biar gak kepanjangan */
        margin-top: 10px;
    }

}

/* ================= MICRO FIX (PIXEL PERFECT) ================= */
@media (max-width: 768px) {

    /* 🔥 card padding tetap */
    .card {
        padding: 16px !important;
    }

    /* 🔥 INI FIX UTAMA */
    .form-tanggal input[type="date"] {
        width: calc(100% - 2px) !important; /* 🔥 potong 2px biar gak overflow */
        margin-right: 2px !important;

        box-sizing: border-box !important;
        display: block;
    }

    /* 🔥 kalau masih bandel, fallback */
    .form-tanggal {
        overflow: hidden;
    }

}

/* ================= FIX ISI DALAM CARD OVERFLOW ================= */
@media (max-width: 768px) {

    /* 🔥 semua isi card */
    .card * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 🔥 khusus form tanggal */
    .form-tanggal,
    .form-tanggal > div {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 🔥 INPUT (INI YANG NGEBETULIN) */
    .form-tanggal input[type="date"] {
        width: 100% !important;
        max-width: 100% !important;

        display: block !important;

        padding: 0 10px !important;
        height: 46px !important;

        box-sizing: border-box !important;
    }

    /* 🔥 label biar gak dorong layout */
    .form-tanggal label {
        display: block;
        margin-bottom: 6px;
    }

}

/* ================= HARD FIX INPUT DATE (SAFARI / ANDROID) ================= */
@media (max-width: 768px) {

    /* 🔥 TARGET SPESIFIK: TEMPAT */
    .tempat-form-box input[type="date"] {
        -webkit-appearance: none !important;
        appearance: none !important;

        width: 100% !important;
        max-width: 100% !important;

        display: block !important;

        padding: 0 10px !important;
        height: 46px !important;

        border-radius: 10px !important;
        border: 1px solid #ddd !important;

        box-sizing: border-box !important;
    }

    /* 🔥 TARGET SPESIFIK: DASHBOARD / BARANG */
    .form-tanggal input[type="date"],
    .dashboard-filter input[type="date"] {
        -webkit-appearance: none !important;
        appearance: none !important;

        width: 100% !important;
        max-width: 100% !important;

        display: block !important;

        padding: 0 10px !important;
        height: 46px !important;

        border-radius: 10px !important;
        border: 1px solid #ddd !important;

        box-sizing: border-box !important;
    }

}

/* ================= BOTTOM NAV FIX (STAY VISIBLE) ================= */
@media (max-width: 768px) {

    /* 🔥 bottom nav tetap di bawah */
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;

        height: 60px;
        z-index: 9999;

        background: #fff;
        border-top: 1px solid #eee;
    }

    /* 🔥 kasih ruang supaya konten gak ketutup */
    .mobile-content,
    .content {
        padding-bottom: 80px !important; /* 🔥 ini kunci */
    }

}

/* ================= FORCE FIX DASHBOARD TANGGAL ================= */
@media (max-width: 768px) {

    /* 🔥 WRAPPER */
    .form-tanggal {
        width: 100% !important;
        overflow: hidden !important; /* 🔥 kunci */
    }

    .form-tanggal > div {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

}

    /* ================= FIX TANGGAL DASHBOARD (DI BAWAH MENU CEPAT) ================= */
@media (max-width: 768px) {

    /* 🔥 area content mobile */
    .mobile-content {
        width: 100%;
    }

    /* 🔥 semua form di dashboard */
    .mobile-content form {
        width: 100%;
        overflow: hidden; /* 🔥 kunci */
    }

    /* 🔥 semua wrapper dalam form */
    .mobile-content form > div {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* 🔥 TARGET INPUT DATE DI DASHBOARD */
    .mobile-content input[type="date"] {
        -webkit-appearance: none !important;
        appearance: none !important;

        width: calc(100% - 6px) !important; /* 🔥 potong lebih biar aman */
        max-width: 100% !important;

        display: block !important;

        height: 46px !important;
        padding: 0 10px !important;

        margin: 0 !important;

        border-radius: 10px !important;
        border: 1px solid #ddd !important;

        box-sizing: border-box !important;
    }

    /* 🔥 tombol */
    .mobile-content .btn-tanggal {
        width: 100% !important;
        margin-top: 10px;
    }

}

/* ================= SPACING TANGGAL DASHBOARD ================= */
@media (max-width: 768px) {

    /* 🔥 kasih jarak antar field */
    .mobile-content input[type="date"] {
        margin-bottom: 12px !important;
    }

    /* 🔥 tombol kasih jarak dari input */
    .mobile-content .btn-tanggal {
        margin-top: 6px !important;
    }

}

.flex button {
    padding: 6px 10px;
    font-size: 13px;
}

/* ================= FIX BUTTON ADMIN CARD ================= */
.barang-card .flex {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.barang-card .flex a button {
    padding: 5px 8px;
    font-size: 12px;
    height: auto;
    width: auto;
    border-radius: 8px;
}

/* ================= KALENDER FINAL FIX ================= */

#calendar .fc-event {
    border-radius: 8px !important;
    padding: 4px !important;
    font-size: 11px;
    white-space: normal !important;
    line-height: 1.2;
}

#calendar .fc-daygrid-event {
    min-height: 26px;
}

.admin-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}