/* --- GENERAL --- */
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    margin: 20px;
    background: #f0f2f5;
    color: #333;
}
h1 {
    text-align: center;
    margin-bottom: 20px;
    font-weight: 700;
}
.section-title {
    font-size: 20px;
    font-weight: 600;
    margin: 20px 0 10px;
    color: #2c3e50;
}

/* --- TABS --- */
.tab {
    overflow: hidden;
    border-bottom: 2px solid #ccc;
    margin-bottom: 20px;
    border-radius: 6px 6px 0 0;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.tab button {
    background-color: inherit;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 12px 25px;
    font-size: 16px;
    transition: all 0.3s ease;
    border-radius: 6px 6px 0 0;
}
.tab button:hover {
    background-color: #e2e6ea;
}
.tab button.active {
    background-color: #3498db;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* --- TAB CONTENT --- */
.tabcontent {
    display: none;
}
.tabcontent.active {
    display: block;
}

/* --- TABLE CONTAINER --- */
.table-container {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
th,
td {
    border-bottom: 1px solid #e1e4e8;
    padding: 10px 12px;
    text-align: center;
}
th {
    background: #3498db;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
    font-weight: 600;
}
tr:hover {
    background: #f1f5f9;
    transition: background 0.2s;
}

/* --- INPUTS & SELECT --- */
select,
input[type="date"],
input[type="text"] {
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    transition: border 0.2s;
}
select:focus,
input:focus {
    border-color: #3498db;
    outline: none;
}

/* --- TIMELINE --- */
.timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 10px 0;
    height: 20px;
}
.timeline::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: #ddd;
    z-index: 1;
    transform: translateY(-50%);
}
.step {
    position: relative;
    z-index: 2;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    transition: all 0.3s;
}
.step.active.red {
    background: #e74c3c;
}
.step.active.yellow {
    background: #f1c40f;
}
.step.active.green {
    background: #27ae60;
}

/* --- PRIORITY FLAG --- */
.priority-flag {
    width: 90px;
    padding: 6px 0;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}
.priority-critical {
    background: #c0392b;
}
.priority-high {
    background: #e74c3c;
}
.priority-medium {
    background: #f39c12;
}
.priority-low {
    background: #27ae60;
}
.priority-flag:hover {
    opacity: 0.85;
}

/* --- BUTTONS --- */
.add-btn,
.history-btn {
    margin-bottom: 12px;
    padding: 8px 16px;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}
.add-btn:hover,
.history-btn:hover {
    background: #2980b9;
}

/* --- ERROR --- */
.error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
}

/* --- CHART --- */
.chart-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin: 25px 0;
}
canvas {
    max-width: 320px;
    max-height: 320px;
}

/* --- MODAL --- */
.modal {
    display: none;
    position: fixed;
    z-index: 20;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}
.modal-content {
    background-color: #fff;
    margin: 60px auto;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}
.modal-header {
    display: flex;
    padding: 0px;
    justify-content: space-between;
    align-items: center;
}
.close {
    color: #888;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover {
    color: #000;
}

/* --- APPROVED ROW --- */
.approved-row {
    background: #d4edda;
}

/* --- SEARCH --- */
.search-container {
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.search-container input {
    padding: 6px 8px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #ccc;
    transition: all 0.2s;
}
.search-container input:focus {
    border-color: #3498db;
    outline: none;
}

/* FAB */
.fab-container {
    position: fixed;
    bottom: 70px;
    right: 20px;
    z-index: 100;
}
.fab-main {
    width: 56px;
    height: 56px;
    background: #3498db;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
}
.fab-options {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}
.fab-options button {
    background: #fff;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}
.fab-container.active .fab-options {
    display: flex;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

/* Button container */
.bottom-nav button {
    background: none;
    border: none;
    flex: 1;
    padding: 6px 0;
    text-align: center;
    font-size: 12px;
    color: #777;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease-in-out;
}

/* Icon */
.bottom-nav button i {
    font-size: 20px;
    margin-bottom: 2px;
}

/* Active state */
.bottom-nav button.active {
    color: #007bff;
    font-weight: 500;
}

.bottom-nav button.active i {
    color: #007bff;
}

/* Hover effect */
.bottom-nav button:hover {
    color: #007bff;
}

/* Desktop: sembunyiin */
@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
}

/* Responsive */
.desktop-only {
    display: block;
}
.mobile-only {
    display: none;
}

/* Mobile: cards visible, table hidden */
@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
    .mobile-only {
        display: block;
    }
    .card-container {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    .card-item {
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 1rem;
        background: #fff;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }
    .card-item h3 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    .card-item p {
        margin: 0.25rem 0;
        font-size: 0.9rem;
    }
}
