/* style.css - UI Profesional Enterprise (Layout & Estetika) */

/* Variabel Global (Palet Enterprise - Lebih Netral, Kontras Tinggi) */
:root {
    --color-primary: #0056b3; /* Biru Deep, profesional */
    --color-accent: #28a745; /* Hijau untuk status OK */
    --color-text-primary: #333333;
    --color-text-secondary: #6c757d;
    --color-background-light: #f4f7f9; /* Latar belakang yang sangat netral */
    --color-surface: #ffffff; /* Warna Kartu/Permukaan */
    --color-border: #e9ecef;
    --font-family: 'Inter', 'Roboto', 'Segoe UI', Arial, sans-serif;
    --shadow-light: 0 1px 2px rgba(0,0,0,0.08);
    --shadow-card: 0 4px 10px rgba(0,0,0,0.05);
}

/* 1. Base dan Layout Utama */
body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    background-color: var(--color-background-light);
    color: var(--color-text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* Tata Letak Utama (Menggunakan Grid untuk Desktop) */
.main-layout {
    display: grid;
    /* Lebar Sidebar 220px, Konten Sisanya */
    grid-template-columns: 220px 1fr; 
    min-height: 100vh;
}

.content-wrapper {
    padding: 0; 
    overflow-y: auto; 
}

.container {
    padding: 30px; /* Padding lebih besar untuk kesan luas */
    max-width: 100%; 
}

/* 2. HILANGKAN Navbar Atas */
.navbar {
    display: none; 
}


/* 3. Sidebar (Navigasi Kiri) - Lebih Tajam dan Jelas */
.sidebar {
    grid-column: 1 / 2;
    background-color: #2c3e50; /* Warna gelap khas sidebar pro */
    color: white;
    padding: 0; 
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}
.sidebar-header {
    /* Judul Aplikasi di dalam sidebar */
    padding: 20px 20px 20px 20px;
    font-size: 1.2em;
    font-weight: 700;
    color: white; /* Putih bersih */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Garis pemisah halus */
    margin-bottom: 10px;
}
.sidebar-nav a {
    display: block;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}
.sidebar-nav a:hover,
.sidebar-nav .active {
    background-color: #34495e;
    color: white;
    border-left: 4px solid var(--color-primary);
    padding-left: 16px; 
}

/* 4. Konten Utama (Header & Aksi) */
.mobile-header {
    display: none; /* Sembunyikan header mobile di desktop */
}
.dashboard-header {
    margin-bottom: 30px; /* Jarak lebih besar setelah judul */
}
.dashboard-header h2 {
    font-size: 1.8em; /* Judul utama lebih besar dan dominan */
    font-weight: 300; /* Font tipis modern */
    color: var(--color-text-primary);
    border: none;
    padding: 0;
    margin: 0;
}

/* Kontrol Atas (Search + Info Bar) */
.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.search-box {
    flex-grow: 1; /* Biarkan kotak pencarian mengambil ruang yang tersedia */
    max-width: 400px;
}

#searchInput {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 1em;
    box-shadow: var(--shadow-light);
    transition: border-color 0.3s;
}

#searchInput:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.info-bar {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 0; /* Dipindahkan ke dalam top-controls */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-light);
    font-size: 0.9em;
}

.action-button {
    background-color: var(--color-primary);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.3s;
}

.action-button:hover {
    background-color: #004080;
}

/* 5. Tabel Data (Kepadatan Informasi Tinggi) */
.data-surface {
    background-color: var(--color-surface);
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    overflow-x: auto;
    padding: 0;
}

.card-list {
    display: none; 
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px; 
}

thead th {
    background-color: #f8f9fa; /* Header tabel abu-abu muda */
    color: var(--color-text-secondary);
    text-align: left;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 0.85em; 
    text-transform: uppercase;
    border-bottom: 2px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 10;
    cursor: pointer; /* Dapat diklik untuk Sortir */
    user-select: none;
}
/* Non-Sortable Action Column */
thead th:last-child {
    cursor: default;
    user-select: auto;
}

.sort-icon {
    font-size: 0.8em;
    color: var(--color-primary); /* Warna ikon sortir biru */
    display: inline-block;
    width: 10px;
}

tbody tr {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--color-border);
}
tbody tr:hover {
    background-color: #f7f9fc;
}

tbody td {
    padding: 10px 15px; 
    vertical-align: middle;
    font-size: 0.85em;
    white-space: nowrap; 
}
tbody td:nth-child(2) {
    font-weight: 500;
    color: var(--color-primary);
}
/* Perataan kolom Rx Power */
tbody td:nth-child(7),
tbody td:nth-child(8) {
    text-align: right;
    font-weight: 600;
}


/* Status Tag: Jelas dan Terpadu */
.status-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px; 
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    min-width: 65px;
    text-align: center;
}

/* Palet Status Enterprise */
.status-tag.blue { background-color: #007bff; } 
.status-tag.yellow { background-color: #ffc107; color: #333; } 
.status-tag.cyan { background-color: #17a2b8; } 
.status-tag.green { background-color: var(--color-accent); } 
.status-tag.red { background-color: #dc3545; } 
.status-tag.black { background-color: #343a40; } 
.status-tag.gray { background-color: #adb5bd; } 
.status-tag.light { background-color: var(--color-border); color: var(--color-text-primary); }


/* --- 7. Gaya Tombol Aksi di dalam Tabel --- */

.action-buttons-cell {
    width: 150px; /* Lebar yang cukup untuk 3 tombol */
    text-align: center;
    white-space: nowrap;
}

.action-buttons-cell .btn {
    padding: 5px 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    margin: 0 2px;
    background-color: transparent;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

/* Gaya Ikon/Warna Default */
.action-buttons-cell .btn svg {
    vertical-align: middle;
    width: 1em;
    height: 1em;
    stroke-width: 2.5; /* Membuat ikon lebih tebal dan jelas */
}

/* Warna dan Hover untuk Edit */
.btn-edit {
    color: #4285f4; /* Biru Google */
}
.btn-edit:hover {
    background-color: #e8f0fe;
    border-color: #4285f4;
}

/* Warna dan Hover untuk Reboot */
.btn-reboot {
    color: #fbbc05; /* Kuning/Orange (Perhatian) */
}
.btn-reboot:hover {
    background-color: #fffde7;
    border-color: #fbbc05;
}

/* Warna dan Hover untuk Delete (DIKEMBALIKAN) */
.btn-delete {
    color: #ea4335; /* Merah (Bahaya) */
}
.btn-delete:hover {
    background-color: #fce8e6;
    border-color: #ea4335;
}


/* 6. Responsif (Mobile) */
@media (max-width: 992px) {
    
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none; 
    }
    
    .mobile-header {
        display: block;
        background-color: var(--color-surface);
        padding: 15px;
        box-shadow: var(--shadow-light);
        font-weight: 600;
        color: var(--color-primary);
        font-size: 1.1em;
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .container {
        padding: 15px 12px;
    }

    /* Kontrol Atas Mobile: Search dan Info menjadi tumpukan */
    .top-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .search-box {
        max-width: 100%;
        order: 1; /* Pindahkan Search ke atas */
    }
    .info-bar {
        order: 2; /* Info dan Refresh di bawah Search */
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }
    .info-bar strong {
        margin-bottom: 10px;
        display: block;
    }

    .data-surface {
        box-shadow: none;
        background-color: transparent;
    }
    
    table {
        display: none;
    }
    
    .card-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* Card Mobile Profesional */
    .onu-card {
        background-color: var(--color-surface);
        padding: 16px;
        border-radius: 8px;
        box-shadow: var(--shadow-light);
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px 10px;
        border-left: 5px solid var(--color-primary);
    }

    .onu-card-header {
        grid-column: 1 / 3;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding-bottom: 8px;
        border-bottom: 1px dashed var(--color-border);
    }
    
    .onu-path {
        font-weight: 600;
        color: var(--color-primary);
        font-size: 1em;
    }

    .onu-card-label {
        font-size: 0.75em;
        color: var(--color-text-secondary);
        text-transform: uppercase;
    }
    
    .onu-card-value {
        font-size: 0.85em;
        font-weight: 400;
    }

    /* Gaya Action Card Mobile */
    .onu-card .action-buttons-cell {
        grid-column: 1 / 3;
        margin-top: 10px;
        text-align: right;
        border-top: 1px dashed var(--color-border);
        padding-top: 8px;
        width: auto;
    }
    .onu-card .btn {
        padding: 8px 12px;
    }
}