/* =========================================
2. LAYOUT & CONTAINERS
========================================= */
.container {
    width: 98%;
    max-width: none;
    margin: 0 auto;
}


.dh-container-app p {
    color: #555;
    font-size: 1em;
    margin-bottom: 30px;
    line-height: 1.5em;
}

.dh-box-app {
    max-width: 700px;
    margin: 20px auto;
    text-align: center;
}

.preview-section {
    margin-top: 30px;
    display: none;
}

.dh-box-supplier {
    width: 100%;
    max-width: 1300px;
    margin: 30px auto 0;
}

/* =========================================
3. HEADER & NAVIGATION (NAVBAR)
========================================= */
.dh-navbar {
    background-color: #fff7;
    color: #555;
    padding: 15px 20px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.dh-navbar h1 {
    margin: 0;
    font-size: 1.5em;
    font-weight: bold;
}

.dh-navbar-subtitle {
    font-size: 0.9em;
    color: #888;
}

.dh-navbar-subtitle a {
    color: #ff8c00;
    text-decoration: none;
    font-weight: 400;
}

.dh-logo-img {
    width: 40px;
    height: 40px;
    margin-right: 15px;
}

.dh-logo-img img {
    width: 100%;
    height: 100%;
}

.dh-branding {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* =========================================
4. TYPOGRAPHY & TEXT UTILITIES
========================================= */
h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
}

/* =========================================
6. FORMS, INPUTS & FILE UPLOAD
========================================= */
/* Upload Section */
.upload-section {
    border: 2px dashed #ff8c00;
    padding: 70px 30px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 20px;
    background: #ffb45e24;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.upload-section.drag-over {
    background: #ffdbb0;
    border-color: #d35400;
    border-style: solid;
    transform: scale(1.02);
}

input[type="file"] {
    display: none;
}

.file-label {
    background: #ff9e1f;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    display: inline-block;
    transition: background 0.3s;
}

.file-label:hover {
    background: #d47c09;
}

.file-name {
    display: block;
    margin-top: 15px;
    font-size: 0.9em;
    color: #7f8c8d;
}

.top-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

/* =========================================
5. BUTTONS
========================================= */
/* General Button */
.btn {
    background: #2ecc71;
    color: #fff;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    transition: background 0.3s;
}

.btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* Specific Button Variants */
.btn-big {
    padding: 30px;
    font-size: 26px;
    background-color: #ff9e1f;
}

.btn-big:disabled {
    background: #ff9e1f75;
    cursor: not-allowed;
    backdrop-filter: blur(10px);
}

/* Style untuk Tab */
.tabs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}
.tab {
    padding: 8px 15px;
    background: #ecf0f1;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.tab:hover {
    background: #dfe6e9;
}
.tab.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}
/* Titik Indikator */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0,0,0,0.2);
}
.status-dot.off {
    background-color: #e74c3c; /* Merah */
}
.status-dot.on {
    background-color: #2ecc71; /* Hijau */
}

button, input[type="file"] {
    padding: 10px;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid #ccc;
}
.btn-export {
    background-color: #27ae60;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    padding: 10px 15px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-export:hover:not(:disabled) {
    background-color: #219150;
}
.btn-wa {
    background-color: #25D366;
    color: white;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 5px;
}
.btn-wa:hover {
    background-color: #1ebe57;
}
.btn-wa:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Search Bar */
#search-product {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    font-size: 15px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    box-sizing: border-box;
    margin-bottom: 10px;
    display: none; 
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}
th {
    background-color: #f2f2f2;
    color: #333;
}
tfoot th {
    background-color: #ecf0f1;
    color: #2c3e50;
    font-weight: bold;
}
input.qty {
    width: 100%;
    max-width: 100px;
    padding: 8px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
}
input.qty:disabled {
    background-color: #e0e0e0;
    cursor: not-allowed;
    border: 1px solid #bdc3c7;
}
.supplier-info {
    background: #ecf0f1;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    display: none;
    align-items: flex-start;
    gap: 15px;
}
.supplier-info p {
    margin: 5px 0;
}
.supplier-card {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}
.supplier-data {
    display: block;
    line-height: 1.6em;
    border-radius: 5px;
    background: #f9f9f9;
    padding: 10px;
    flex: 1;
}
.dh-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}
.dh-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.toggle-container {
    margin: 0 -15px 0 -15px;
    margin-top: 15px;
    padding: 15px 15px 0;
    width: calc(100% + 30px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #bdc3c7;
}
.summary-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #2c3e50;
    color: white;
    border-radius: 8px;
    display: none;
}
.summary-section h3 {
    margin-top: 0;
    border-bottom: 1px solid #7f8c8d;
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.summary-section ul {
    list-style-type: none;
    padding: 0;
    font-size: 16px;
}
.summary-section ul li {
    padding: 5px 0;
    display: flex;
    justify-content: space-between;
}

/* UPDATE: Grand Total Layout untuk sejajar dengan Tombol Export */
.grand-total {
    font-size: 20px;
    font-weight: bold;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed #7f8c8d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* =========================================
8. TABLES
========================================= */
.table-wrapper {
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
}
table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap; 
}

thead th {
    background-color: #f2f2f2;
    text-align: left;
}

th, td {
    border: 1px solid #ddd;
    padding: 10px;
    font-size: 14px;
    vertical-align: middle;
}

tr:nth-child(even) { background-color: #f9f9f9; }
tr:hover { background-color: #f1f2f6; } 

/* Specific Table Overrides */
#data-table tbody tr:nth-child(even) { background-color: #fff9f2; }
#data-table tbody tr:hover { background-color: #ffe9d1; }

/* =========================================
10. APP MENU DROPDOWN
========================================= */
.dh-navbar-actions {
    margin-left: auto;
    position: relative;
}

.app-menu-btn {
    background: transparent;
    border: 0px;
    padding: 10px 20px;
    font-size: 0.9em;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    transition: background 0.3s, border-color 0.3s;
}

.app-menu-btn:hover {
    background: #ff8c0011;
    color: #ff8c00;
}

.app-dropdown-menu {
    position: absolute;
    top: 130%; 
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    padding: 15px;
    display: none; 
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 360px;
    z-index: 1001;
}

.app-dropdown-menu.show {
    display: grid; 
}

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #555;
    padding: 15px 10px;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
    font-size: 0.85em;
    font-weight: 400;
}
.app-item span {
    margin-top: 5px;
    font-size: 0.8em;
}

.app-item i {
    font-size: 2.4em;
    margin-bottom: 8px;
    color: #ff8c00;
    transition: transform 0.2s;
}

.app-item:hover {
    background: #fff6ea;
    color: #d35400;
}

.app-item:hover i {
    transform: scale(1.1);
}

/* =========================================
11. APP MENU DROPDOWN GROUPING
========================================= */
.app-group-title {
    grid-column: 1 / -1; 
    font-size: 0.75em;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    padding-bottom: 5px;
    border-bottom: 1px dashed #ecf0f1;
    margin-top: 15px;
    margin-bottom: 5px;
    text-align: left;
    padding-left: 10px;
}

.app-dropdown-menu .app-group-title:first-child {
    margin-top: 0;
}

/* =========================================
12. SWITCH TOGGLE (ON/OFF)
========================================= */

/* Reset & Base */
.switch-container * {
box-sizing: border-box;
}

.switch-container {
    display: inline-block;
}

.switch-wrapper {
    display: flex;
    align-items: center;
}

.dh-switch-label {
    margin-left: 10px;
}

/* Sembunyikan checkbox asli */
.switch-input {
display: none;
}

/* Background/Track Switch */
.switch-label {
outline: 0;
display: block;
width: 4em;
height: 2em;
position: relative;
cursor: pointer;
user-select: none;
background: #fbfbfb;
border-radius: 2em;
padding: 2px;
transition: all 0.4s ease;
border: 1px solid #e8eae9;
}

/* Bulatan/Knob Switch */
.switch-label:after {
content: "";
position: relative;
display: block;
width: 50%;
height: 100%;
left: 0;
border-radius: 2em;
background: #fff;
transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 4px 0 rgba(0, 0, 0, 0.08);
}

/* Efek saat diklik (Active) */
.switch-label:active {
box-shadow: inset 0 0 0 2em #e8eae9;
}

.switch-label:active:after {
padding-right: 0.8em;
}

/* State: Checked (ON) */
.switch-input:checked + .switch-label {
background: #25D366;
}

.switch-input:checked + .switch-label:after {
left: 50%;
}

.switch-input:checked + .switch-label:active:after {
margin-left: -0.8em;
}