/* ===============================
   GLOBAL
=================================*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    background: #f4f6f9;
}

/* ===============================
   SIDEBAR
=================================*/
/* SIDEBAR */
.sidebar {
    width: 240px;
    height: 100vh;
    background: #2bb8a9;
    position: fixed;
    left: 0;
    top: 0;
    padding-top: 20px;
}

/* LOGO */
.logo-container {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
}

/* MENU */
.menu {
    list-style: none;
    padding: 0;
}

.menu li {
    margin-bottom: 10px;
}

.menu a {
    display: block;
    padding: 14px 20px;
    margin: 0 15px;
    text-decoration: none;
    color: #000;
    border-radius: 12px;
    transition: 0.3s;
}

/* HOVER */
.menu a:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* ACTIVE PAGE */
.menu a.active {
    background: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}


/* ===============================
   MAIN CONTENT
=================================*/
.main {
    margin-left: 240px;
    padding: 30px;
}

.main h1 {
    font-size: 26px;
    margin-bottom: 5px;
}

.main p {
    color: #666;
    margin-bottom: 25px;
}

/* ===============================
   DASHBOARD CARDS
=================================*/
.cards {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card h3 {
    font-size: 24px;
    margin-bottom: 5px;
}

.card p {
    color: #777;
    font-size: 14px;
}

.card i {
    font-size: 30px;
    color: #30D0C3;
}

/* ===============================
   SECTION LAYOUT
=================================*/
.section {
    display: flex;
    gap: 20px;
}

.box {
    flex: 1;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.box h3 {
    margin-bottom: 15px;
}

/* ===============================
   CHART
=================================*/
.chart-container {
    width: 250px;   /* smaller chart */
    height: 250px;
    margin: auto;
}

/* ===============================
   TABLE
=================================*/
table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    text-align: left;
    background: #f4f6f9;
    padding: 10px;
    font-size: 14px;
}

table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

/* Status Badge */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: #ffe082;
    color: #795548;
}

/* ===============================
   RESPONSIVE
=================================*/
@media (max-width: 900px) {
    .cards {
        flex-direction: column;
    }

    .section {
        flex-direction: column;
    }
}

/* SIDEBAR FLEX STRUCTURE */
.sidebar {
    display: flex;
    flex-direction: column;
}

/* Tolak menu ke atas */
.menu {
    flex-grow: 1;
}

/* LOGOUT BUTTON */
.logout {
    margin: 20px 15px;
}

.logout a {
    display: block;
    padding: 14px 20px;
    background: #ff4d4d;
    color: white;
    text-decoration: none;
    border-radius: 12px;
    text-align: center;
    transition: 0.3s;
}

.logout a:hover {
    background: #e60000;
}

/* ===============================
   PAGE HEADER (WITH BUTTON)
=================================*/
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

/* ADD BUTTON */
.add-btn {
    background: #2bb8a9;
    color: white;
    padding: 10px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s ease;
}

.add-btn:hover {
    background: #239b8e;
    transform: translateY(-2px);
}

.btn.warning {
    background: #f59e0b;
    color: white;
}

.btn.warning:hover {
    background: #d97706;
}

.btn.cancel:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===============================
   FIX SELECT ARROW BUG
================================ */

/* Remove browser default arrow */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 5.5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;

    padding-right: 36px;
}

/* Remove weird edge arrows (Windows / Edge) */
select::-ms-expand {
    display: none;
}

/* Prevent text clipping */
.form-group select {
    line-height: 1.4;
}

/* Table */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.styled-table th, .styled-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.styled-table th {
    background: #2c3e50;
    color: #fff;
}

.styled-table tr:hover {
    background: #f1f1f1;
}

/* Buttons */
.toggle-btn {
    padding: 8px 15px;
    border: none;
    cursor: pointer;
    background: #bdc3c7;
    color: #000;
    border-radius: 6px;
    margin-right: 5px;
}

.toggle-btn.active {
    background: #3498db;
    color: #fff;
}

/* Description toggle */
.desc-box {
    display: none;
    margin-top: 5px;
    font-size: 0.9em;
    color: #333;
}

/* Badge */
.badge {
    background: #007bff;
    color: #fff;
    padding: 3px 8px;
    border-radius: 5px;
}

/* Duplicate */
.duplicate {
    color: red;
    font-weight: bold;
}

.btn-back {
    display: inline-block;
    margin-bottom: 15px;
    padding: 6px 12px;
    background: #6c757d;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9em;
}

.btn-back:hover {
    background: #5a6268;
}

.sidebar {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* menu takes full space */
.menu {
    flex: 1;
}

/* bottom section */
.sidebar-bottom {
    margin-top: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* inbox button */
.inbox-btn {
    display: block;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    background: #f1f1f1;
    color: #333;
    font-weight: 500;
}

.inbox-btn:hover {
    background: #ddd;
}

/* active state */
.inbox-btn.active {
    background: #007bff;
    color: white;
}

/* logout */
.logout a {
    display: block;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    background: #ff4d4d;
    color: white;
    text-align: center;
}

.logout a:hover {
    background: #e60000;
}

/* ===============================
   FLOATING INBOX (RIGHT SIDE)
=================================*/
.floating-inbox {
    position: fixed;
    right: 20px;
    bottom: 20px;

    width: 55px;
    height: 55px;

    background: #2bb8a9; /* your theme color */
    color: #000;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 24px;
    text-decoration: none;

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

    z-index: 9999;

    transition: 0.3s ease;
}

/* hover effect (same style as sidebar hover) */
.floating-inbox:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-3px);
}

.due-badge {
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 700;
    display: inline-block;
    font-size: 13px;
}

/* OVERDUE */
.due-overdue {
    background: #fee2e2;
    color: #b91c1c;
}

/* URGENT (0–3 days) */
.due-critical {
    background: #ffedd5;
    color: #c2410c;
}

/* SOON (4–7 days) */
.due-soon {
    background: #fef9c3;
    color: #92400e;
}

/* SAFE */
.due-safe {
    background: #dcfce7;
    color: #166534;
}

/* =========================
   LOGO
========================= */

.logo-container {
    text-align: center;
    padding: 20px 10px;
}

.logo {
    width: 80px;
    height: auto;
    object-fit: contain;
}

/* =========================
   RIGHT PANEL
========================= */

.equipment-preview-card{
    display:flex;
    flex-direction:column;
    gap:20px;
}

/* =========================
   IMAGE
========================= */

.equipment-image-wrapper{
    background:#ffffff;
    border-radius:18px;
    padding:20px;
    border:1px solid #d7f3ef;
    text-align:center;
}

.equipment-preview-image{
    width:100%;
    max-width:180px;
    height:180px;
    object-fit:cover;
    border-radius:18px;
    border:4px solid #e6fffb;
    box-shadow:0 4px 14px rgba(0,0,0,0.08);
}

/* =========================
   EQUIPMENT INFO CLEAN UI
========================= */

.equipment-info-card{
    background:#ffffff;
    border-radius:18px;
    padding:24px;
    border:1px solid #d7f3ef;
}

.info-title{
    margin:0 0 20px;
    color:#0f766e;
    font-size:20px;
    display:flex;
    align-items:center;
    gap:10px;
}

.info-list{
    display:flex;
    flex-direction:column;
    gap:16px;
}

.info-item{
    background:#f8fffe;
    border:1px solid #dff7f3;
    border-radius:14px;
    padding:14px 16px;
    transition:0.2s ease;
}

.info-item:hover{
    transform:translateY(-2px);
    box-shadow:0 4px 10px rgba(13,148,136,0.08);
}

.info-label{
    display:block;
    font-size:12px;
    color:#6b7280;
    margin-bottom:6px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:0.5px;
}

.info-value{
    font-size:16px;
    font-weight:700;
    color:#0f172a;
    word-break:break-word;
}

/* =========================
   MOBILE
========================= */

@media(max-width:768px){

    .equipment-preview-image{
        max-width:140px;
        height:140px;
    }

    .equipment-info-card{
        padding:18px;
    }

}

.alert{
    padding:10px 12px;
    margin-bottom:10px;
    border-radius:6px;
    font-size:14px;
}

.alert.error{
    background:#ffe5e5;
    color:#c0392b;
}

.alert.success{
    background:#e8f8f5;
    color:#1e8449;
}

.alert.warning{
    background:#fff3cd;
    color:#856404;
}