/* =========================================
1. GLOBAL & RESET STYLES
========================================= */
* {
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
}

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

.dh-container-app {
    margin-top: 80px;
    justify-content: center;
    background-size: cover;
    background-color: #fff6ea;
    padding: 40px 20px;
    border-radius: 10px;
    border: 1px solid #f0c17b9c;
}

.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;
}

/* =========================================
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;
}

.preview-title {
    margin-top: 10px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.col-center {
    text-align: center;
}

.marquee-hover {
    max-width: 350px; 
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block; 
}

.text-lawan {
    color: #e67e22;
    font-size: 13px;
    margin-top: 4px;
    font-weight: 500;
}

/* =========================================
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;
}

.btn-group {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Icon Spacing */
.btn i, .tab-btn i {
    margin-right: 6px;
}

/* 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);
}

.btn-download {
    background-color: #27ae60; 
    color: white; 
    padding: 8px 15px;
    font-size: 14px;
}

.btn-download:hover:not(:disabled) {
    background-color: #219a52;
}

.btn-apply {
    background-color: #3498db;
    color: white;
}

.btn-apply:hover:not(:disabled) {
    background-color: #2980b9;
}

.btn-warning {
    background-color: #e67e22;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background-color: #d35400;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
}

.btn-delete:hover:not(:disabled) {
    background-color: #c0392b;
}

/* Tab Buttons */
.tab-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s, color 0.3s;
}

.tab-btn:hover:not(:disabled) {
    background-color: #d5d5d5;
}

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

.tab-btn:disabled {
    background-color: #bdc3c7 !important;
    color: #7f8c8d !important;
    cursor: not-allowed;
    opacity: 0.7;
}

/* =========================================
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;
}

/* Inline Editable Text */
.editable-text {
    cursor: pointer;
    color: #2980b9;
    border-bottom: 1px dashed #3498db;
    display: inline-block;
    min-width: 50px;
    padding: 2px;
    transition: background-color 0.2s;
    font-weight: bold;
}

.editable-text:hover {
    background-color: #fff3cd;
}

.edit-input {
    width: 120px;
    box-sizing: border-box;
    padding: 4px;
    font-size: 14px;
    border: 1px solid #3498db;
    border-radius: 4px;
}

/* Global Admin Fee Input */
#globalAdminFee {
    width: 50px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    margin-top: 5px;
}

/* =========================================
7. TOOLBARS (SEARCH & MASS ACTIONS)
========================================= */
/* Mass Action Bar */
.mass-action-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.mass-action-bar input[type="number"], 
.mass-action-bar input[type="text"] {
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    transition: background 0.3s;
}

.mass-action-bar input[type="number"] {
    width: 140px;
}

.mass-action-bar input:disabled {
    background-color: #f2f2f2;
    color: #95a5a6;
    cursor: not-allowed;
}

.mass-action-bar button {
    padding: 10px 20px;
    font-size: 14px;
}

.delete-actions {
    display: flex;
    gap: 10px;
}

/* Search Container */
.search-container {
    margin-left: auto; 
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box {
    padding: 10px 15px;
    border: 1px solid #bdc3c7;
    border-radius: 5px;
    width: 300px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.search-box:focus {
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* =========================================
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 */
#previewTable tbody tr:nth-child(even) { background-color: #fff9f2; }
#previewTable tbody tr:hover { background-color: #ffe9d1; }

/* =========================================
9. ALERTS, DIVIDERS & MISCELLANEOUS
========================================= */
.alert {
    padding: 15px;
    background-color: #d0e8ff;
    color: #31708f;
    margin-bottom: 15px;
    border-left: 5px solid #3498db;
    border-radius: 4px;
    display: none;
}

.dh-pengingat {
    color: #333;
    padding: 70px 15px;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.divider {
    width: 1px;
    height: 35px;
    background-color: #bdc3c7;
    margin: 0 5px;
}
.row-checkbox, #selectAllRows {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #ff8c00;
}

/* =========================================
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; /* Diperlebar sedikit agar rapi setelah di-group */
    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;
}