/* Daily Earnings Monitor - CSS Stylesheet */
/* Brand Colors:
   - New Biru (Utama): #293FCC
   - Lembut (Background lembut): #DFF8FF
   - Muda (Accent): #2ED3FF
   - Tua (Text/Element gelap): #170B56
   - Lainnya (Background lain): #F8F9F9
*/

:root {
    --brand-primary: #293FCC;
    --brand-soft: #DFF8FF;
    --brand-light: #2ED3FF;
    --brand-dark: #170B56;
    --brand-bg: #F8F9F9;
    --brand-primary-hover: #1E2FA3;
    --brand-light-hover: #1BB8E8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: var(--brand-bg);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Header Styles */
header {
    background: #fff;
    padding: 0;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 20px;
}

header h1 {
    color: var(--brand-dark);
    margin: 0;
    font-size: 2.2em;
    font-weight: 600;
    line-height: 1.2;
}

header nav {
    display: flex;
    gap: 20px;
}

header nav a {
    text-decoration: none;
    color: #7f8c8d;
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

header nav a:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

header nav a.active {
    background: var(--brand-primary);
    color: white;
}

header nav a.profile-link {
    background: var(--brand-light);
    color: white;
}

header nav a.profile-link:hover {
    background: var(--brand-light-hover);
    color: white;
}

header nav a.logout-link {
    background: #dc3545 !important;
    color: white !important;
    font-weight: 500 !important;
}

header nav a.logout-link:hover {
    background: #c82333 !important;
    color: white !important;
    transform: translateY(-1px);
}

/* Message Styles */
.message {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: 500;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--brand-dark);
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--brand-primary);
}

.form-group input[type="number"] {
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Button Styles */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--brand-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--brand-primary-hover);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Period Filter Styles */
/* Combined Filter Bar Styles */
.combined-filter-bar {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.combined-filter-bar .filter-form,
.combined-filter-bar .search-controls {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.combined-filter-bar .filter-form {
    flex-wrap: wrap;
}

.combined-filter-bar .filter-form .form-group {
    margin: 0;
    min-width: auto;
    flex: 0 0 auto;
}

.combined-filter-bar .filter-form .form-group:nth-child(1),
.combined-filter-bar .filter-form .form-group:nth-child(2) {
    min-width: 130px;
}

.combined-filter-bar .filter-form .form-group button {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.combined-filter-bar .search-controls {
    flex: 1;
    min-width: 0;
}

.combined-filter-bar .search-controls .form-group {
    margin: 0;
    min-width: 120px;
    flex: 1;
}

.combined-filter-bar .search-controls .form-group:last-child,
.combined-filter-bar .search-controls .form-group:nth-last-child(2),
.combined-filter-bar .search-controls .form-group:nth-last-child(1) {
    min-width: auto;
    flex: 0 0 auto;
}

.filter-form {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-form .form-group {
    margin: 0;
    min-width: 110px;
    flex: 0 0 auto;
}

.filter-form .form-group:last-child {
    align-self: flex-end;
    margin-bottom: 0;
}

.form-group.no-label {
    margin-bottom: 0;
    align-self: flex-end;
}

.filter-form .form-group.no-label:last-child {
    margin-bottom: 0;
}


/* Search Controls - Now part of Combined Filter Bar */
.search-controls {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.search-controls .form-group {
    margin: 0;
    min-width: 140px;
    flex: 1;
}

.search-controls .form-group:last-child {
    min-width: auto;
    flex: 0 0 auto;
}

.search-controls .form-group:nth-last-child(2),
.search-controls .form-group:nth-last-child(1) {
    min-width: auto;
    flex: 0 0 auto;
}

.search-input {
    width: 100% !important;
    padding: 12px !important;
    border: 2px solid #ddd !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    transition: border-color 0.3s ease !important;
}

.search-input:focus {
    outline: none;
    border-color: var(--brand-primary) !important;
}

.filter-select {
    width: 100% !important;
    padding: 12px !important;
    border: 2px solid #ddd !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    transition: border-color 0.3s ease !important;
}

.filter-select:focus {
    outline: none;
    border-color: var(--brand-primary) !important;
}

.no-results {
    background: #f8f9fa;
    padding: 40px 20px;
}

.no-results-content p {
    font-size: 1.1em;
    color: #7f8c8d;
    margin-bottom: 15px;
}

/* Dashboard Actions Styles */
.actions-cell {
    padding: 10px 5px;
    background: #f8f9fa;
    text-align: center;
}

.action-buttons {
    display: flex;
    flex-direction: row;
    gap: 5px;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.dashboard-btn {
    padding: 8px 12px;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    width: auto;
    min-width: 36px;
    transition: all 0.3s ease;
}

.dashboard-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.delete-form {
    margin: 0;
    display: inline-block;
}

.delete-form button {
    cursor: pointer;
    border: none;
    padding: 6px 12px;
    font-size: 11px;
    width: 100px;
    transition: all 0.3s ease;
}

.delete-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Delete Modal Styles */
.delete-modal-content {
    max-width: 450px;
    border-radius: 8px;
    overflow: hidden;
}

.delete-modal-header {
    background: #dc3545;
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delete-modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.modal-body {
    padding: 25px;
    text-align: center;
}

.modal-body p {
    margin: 0 0 20px 0;
    font-size: 1.1em;
    color: #333;
}

.delete-account-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 0;
}

.delete-account-info strong {
    color: #856404;
    font-size: 1.1em;
    display: block;
    margin-bottom: 10px;
}

.warning-text {
    margin: 0;
    color: #856404;
    font-size: 0.9em;
    line-height: 1.4;
}

.modal-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-radius: 0 0 8px 8px;
}

.modal-footer .btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.modal-footer .btn-secondary {
    background: var(--brand-light);
    color: white;
}

.modal-footer .btn-secondary:hover {
    background: var(--brand-light-hover);
    transform: translateY(-1px);
}

.modal-footer .btn-danger {
    background: #dc3545;
    color: white;
}

.modal-footer .btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.3);
}

/* Account Modal Styles */
.account-modal-content {
    max-width: 600px;
    border-radius: 8px;
    overflow: hidden;
}

.account-modal-header {
    background: var(--brand-primary);
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

/* Edit Account Modal Styles */
.edit-account-modal-content {
    max-width: 600px;
    border-radius: 8px;
    overflow: hidden;
}

.edit-account-modal-header {
    background: var(--brand-light);
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edit-account-modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

/* Profile Modal Styles */
.profile-modal-content {
    max-width: 500px;
    border-radius: 8px;
    overflow: hidden;
}

.profile-modal-header {
    background: var(--brand-dark);
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
}

.password-requirements {
    margin-top: 10px;
    padding: 10px;
    background: var(--brand-soft);
    border-radius: 5px;
    border-left: 4px solid var(--brand-primary);
}

.password-requirements small {
    color: var(--brand-dark);
    font-style: italic;
}

.account-form .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.account-form .form-group {
    flex: 1;
    margin-bottom: 15px;
}

.account-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--brand-dark);
}

.account-form input,
.account-form select,
.account-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
    resize: vertical;
}

/* Special styling for RDP/Bot input field */
.account-form .number-input {
    width: 200px !important;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.account-form input:focus,
.account-form select:focus,
.account-form textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
}

.account-form input[type="number"] {
    -moz-appearance: textfield;
}

.modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.btn-success {
    background: var(--brand-primary);
    color: white;
}

.btn-success:hover {
    background: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(41, 63, 204, 0.3);
}

/* Account Form Styles */
.account-form-section,
.accounts-list-section {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.account-form-section h2,
.accounts-list-section h2 {
    color: var(--brand-dark);
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

.accounts-table,
.earnings-dashboard {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.accounts-table th,
.earnings-dashboard th {
    background: var(--brand-dark);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.accounts-table td,
.earnings-dashboard td {
    padding: 12px 15px;
    border-bottom: 1px solid #ecf0f1;
}

.accounts-table tr:hover {
    background: #f8f9fa;
}

/* Dashboard Specific Styles */
.dashboard-section {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-section h2 {
    color: var(--brand-dark);
    margin: 0;
    font-size: 1.5em;
    flex-shrink: 0;
}

/* Grand Total Display Styles */
.grand-total-display {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.grand-total-label {
    font-size: 1.1em;
    font-weight: 600;
    color: #7f8c8d;
}

.grand-total-amount {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--brand-primary);
}

.earnings-dashboard {
    font-size: 12px;
}

.account-column {
    min-width: 200px;
    position: sticky;
    left: 0;
    background: var(--brand-dark);
    z-index: 9;
}

.type-column {
    min-width: 120px;
    position: sticky;
    left: 200px;
    background: var(--brand-dark);
    z-index: 9;
}

.status-column {
    min-width: 80px;
    position: sticky;
    left: 320px;
    background: var(--brand-dark);
    z-index: 9;
}

.target-column {
    min-width: 100px;
    position: sticky;
    left: 400px;
    background: var(--brand-dark);
    z-index: 9;
}

.actions-column {
    min-width: 120px;
    text-align: center;
    vertical-align: middle;
    position: sticky;
    left: 500px;
    background: var(--brand-dark);
    z-index: 9;
}

.progress-column {
    min-width: 150px;
    text-align: center;
    position: sticky;
    left: 650px;
    background: var(--brand-dark);
    z-index: 9;
}

.total-column {
    min-width: 100px;
    text-align: right;
    font-weight: bold;
    position: sticky;
    left: 800px;
    background: var(--brand-dark);
    z-index: 9;
}

.day-column {
    min-width: 80px;
    text-align: center;
}

.account-info {
    vertical-align: top;
    padding: 15px;
}

.account-email {
    font-weight: 600;
    color: var(--brand-primary);
    margin-bottom: 5px;
    font-size: 14px;
}

.account-details {
    font-size: 12px;
    color: #7f8c8d;
    line-height: 1.3;
}

.type-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.type-badge.new-account {
    background: var(--brand-soft);
    color: var(--brand-primary);
}

.type-badge.payout-account {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.type-badge.verif-account {
    background: #fff8e1;
    color: #f57c00;
}

.type-badge.banned-account {
    background: #ffebee;
    color: #d32f2f;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.status-badge.status-running {
    background: var(--brand-soft);
    color: var(--brand-primary);
}

.status-badge.status-done {
    background: #e8f5e8;
    color: var(--brand-dark);
}

.status-badge.status-pending {
    background: #fff8e1;
    color: #f57c00;
}

.account-status {
    text-align: center;
}

.optional-text {
    margin-top: 4px;
    font-size: 9px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
    border-left: 2px solid #6c757d;
    word-break: break-word;
    max-width: 100px;
}

.target-amount {
    font-weight: 600;
    color: var(--brand-dark);
}

.day-cell {
    text-align: center;
    border-left: 1px solid #ecf0f1;
    border-right: 1px solid #ecf0f1;
}

.day-cell.has-value {
    background: #e8f5e8;
}

.day-cell.zero-value {
    background: #f8f9fa;
}

.earning-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 8px;
    border-radius: 3px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.earning-link:hover {
    background: var(--brand-primary);
    color: white;
    transform: scale(1.05);
}

.monthly-total {
    background: var(--brand-soft);
    font-weight: 600;
    color: var(--brand-dark);
}

.progress-cell {
    padding: 10px;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-light));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 10px;
    color: #7f8c8d;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: var(--brand-dark);
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3em;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 0.7;
}

.earning-form {
    padding: 25px;
}

.earning-form .form-group input[readonly] {
    background: #f8f9fa;
    color: #7f8c8d;
}

/* Actions Column */
.actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.actions form {
    margin: 0;
}

/* No Accounts Message */
.no-accounts {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.no-accounts p {
    font-size: 1.1em;
    color: #7f8c8d;
}

.no-accounts a {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 600;
}

.no-accounts a:hover {
    text-decoration: underline;
}

/* Text Alignment */
.text-center {
    text-align: center;
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE FIRST APPROACH
   ======================================== */

/* Mobile Navigation Toggle */
.mobile-menu-toggle {
    display: none;
    background: var(--brand-primary);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 20px;
    z-index: 1001;
}

@media (max-width: 1200px) {
    .container {
        padding: 10px;
    }

    .dashboard-section {
        padding: 15px;
    }

    .earnings-dashboard {
        font-size: 11px;
    }

    .day-column {
        min-width: 70px;
    }

    header h1 {
        font-size: 1.6em;
    }
}

@media (max-width: 992px) {
    .combined-filter-bar {
        flex-direction: column;
        gap: 20px;
    }

    .filter-section {
        width: 100%;
    }

    .period-section {
        max-width: none;
    }

    .search-section {
        width: 100%;
    }

    .filter-form {
        flex-wrap: wrap;
    }

    .filter-form .form-group {
        flex: 1 1 200px;
    }
}

@media (max-width: 768px) {
    /* Header Mobile Styles */
    header {
        padding: 0;
        margin-bottom: 0;
        position: sticky;
        top: 0;
        min-height: 60px;
    }

    header .container {
        padding: 12px 15px;
        position: relative;
        min-height: 60px;
        display: flex;
        align-items: center;
    }

    header h1 {
        font-size: 1.3em;
        margin: 0;
        padding-right: 50px;
        line-height: 1.2;
    }

    .mobile-menu-toggle {
        display: block;
        position: absolute;
        top: 50%;
        right: 15px;
        transform: translateY(-50%);
        z-index: 100;
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    header nav {
        display: none !important;
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #ecf0f1;
    }

    header nav.active {
        display: flex !important;
    }

    header nav a {
        padding: 12px 15px;
        text-align: left;
        border-radius: 5px;
        margin-bottom: 5px;
        width: 100%;
    }

    header nav a:last-child {
        margin-bottom: 0;
    }

    /* Filter Bar Mobile */
    .combined-filter-bar {
        padding: 15px;
        margin-bottom: 15px;
        flex-direction: column;
        gap: 12px;
    }

    .combined-filter-bar .filter-form,
    .combined-filter-bar .search-controls {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .combined-filter-bar .filter-form {
        flex-wrap: wrap;
    }

    .combined-filter-bar .filter-form .form-group,
    .combined-filter-bar .search-controls .form-group {
        width: 100%;
        min-width: auto;
        margin-bottom: 0;
    }

    .combined-filter-bar .filter-form .form-group select,
    .combined-filter-bar .filter-form .form-group input,
    .combined-filter-bar .search-controls .form-group select,
    .combined-filter-bar .search-controls .form-group input,
    .search-input,
    .filter-select {
        width: 100%;
        font-size: 16px;
    }

    .combined-filter-bar .filter-form .form-group button,
    .combined-filter-bar .search-controls .form-group button {
        width: 100%;
    }

    /* Dashboard Header Mobile */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .dashboard-section h2 {
        font-size: 1.3em;
    }

    .grand-total-display {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
        padding: 10px;
        background: var(--brand-soft);
        border-radius: 6px;
    }

    .grand-total-display > span {
        display: inline-block;
    }

    .grand-total-label,
    .account-count-label,
    .grand-payout-label {
        font-size: 0.85em;
        font-weight: 600;
        color: var(--brand-dark);
    }

    .grand-total-amount,
    .account-count-amount,
    .grand-payout-amount,
    .grand-payout-rupiah {
        font-size: 0.9em;
        font-weight: 700;
        color: var(--brand-primary);
    }

    .grand-payout-rupiah {
        margin-left: 0;
        color: var(--brand-dark);
    }

    /* Table Mobile Styles */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        margin-top: 15px;
        padding-bottom: 10px; /* Space for scrollbar */
    }

    .table-responsive::-webkit-scrollbar {
        height: 8px;
    }

    .table-responsive::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }

    .table-responsive::-webkit-scrollbar-thumb {
        background: var(--brand-primary);
        border-radius: 10px;
    }

    .table-responsive::-webkit-scrollbar-thumb:hover {
        background: var(--brand-primary-hover);
    }

    .accounts-table,
    .earnings-dashboard {
        font-size: 11px;
        min-width: 900px; /* Ensures horizontal scroll on small screens */
    }

    .accounts-table th,
    .accounts-table td,
    .earnings-dashboard th,
    .earnings-dashboard td {
        padding: 10px 8px;
        white-space: nowrap;
    }

    /* Sticky columns adjustment for mobile */
    .account-column {
        min-width: 180px;
        left: 0;
    }

    .type-column {
        min-width: 110px;
        left: 180px;
    }

    .status-column {
        min-width: 80px;
        left: 290px;
    }

    .target-column {
        min-width: 90px;
        left: 370px;
    }

    .actions-column {
        min-width: 130px;
        left: 460px;
    }

    .progress-column {
        min-width: 130px;
        left: 590px;
    }

    .total-column {
        min-width: 90px;
        left: 720px;
    }

    /* Modal Mobile Styles */
    .modal-content,
    .delete-modal-content,
    .account-modal-content,
    .edit-account-modal-content,
    .profile-modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-body {
        max-height: calc(90vh - 150px);
        overflow-y: auto;
    }

    /* Form Elements Mobile */
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .account-form .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    /* Button Mobile Styles */
    .btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px; /* Touch-friendly size */
    }

    .btn-sm {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 36px;
    }

    .dashboard-btn,
    .delete-form button {
        width: auto;
        padding: 8px 12px;
        font-size: 14px;
        min-height: 36px;
        min-width: 36px;
    }

    .action-buttons {
        display: flex;
        flex-direction: row;
        gap: 5px;
        width: auto;
        justify-content: center;
    }

    .action-buttons .btn,
    .action-buttons .delete-form {
        width: auto;
    }
}

@media (max-width: 480px) {
    /* Extra Small Devices */
    .container {
        padding: 5px;
    }

    header {
        padding: 0;
        border-radius: 0;
        min-height: 55px;
    }

    header .container {
        padding: 10px 12px;
        min-height: 55px;
    }

    header h1 {
        font-size: 1.1em;
        margin: 0;
        padding-right: 45px;
        line-height: 1.2;
    }

    .mobile-menu-toggle {
        right: 12px;
        min-height: 40px;
        min-width: 40px;
        padding: 6px 10px;
        font-size: 16px;
    }

    .dashboard-section h2 {
        font-size: 1.2em;
    }

    .grand-total-display {
        padding: 8px;
        gap: 6px;
    }

    .grand-total-label,
    .grand-total-amount,
    .account-count-label,
    .account-count-amount,
    .grand-payout-label,
    .grand-payout-amount,
    .grand-payout-rupiah {
        font-size: 0.9em;
    }

    .mobile-menu-toggle {
        top: 50%;
        right: 12px;
        padding: 8px 12px;
        font-size: 18px;
        transform: translateY(-50%);
    }

    .combined-filter-bar {
        padding: 12px;
        margin-bottom: 10px;
    }

    .combined-filter-bar h2 {
        font-size: 1em;
    }

    .filter-form {
        gap: 10px;
    }

    .dashboard-section {
        padding: 10px;
    }

    .dashboard-section h2 {
        font-size: 1.2em;
    }

    /* Table adjustments */
    .accounts-table,
    .earnings-dashboard {
        font-size: 10px;
        min-width: 850px;
    }

    .accounts-table th,
    .accounts-table td,
    .earnings-dashboard th,
    .earnings-dashboard td {
        padding: 8px 5px;
    }

    .account-column {
        min-width: 150px;
    }

    .type-column {
        min-width: 100px;
        left: 150px;
    }

    .status-column {
        min-width: 70px;
        left: 250px;
    }

    .target-column {
        min-width: 80px;
        left: 320px;
    }

    .actions-column {
        min-width: 120px;
        left: 400px;
    }

    .progress-column {
        min-width: 120px;
        left: 520px;
    }

    .total-column {
        min-width: 80px;
        left: 640px;
    }

    /* Progress bar mobile */
    .progress-bar-container {
        height: 16px;
    }

    .progress-text {
        font-size: 9px;
    }

    /* Modal adjustments */
    .modal-header,
    .delete-modal-header,
    .account-modal-header,
    .edit-account-modal-header,
    .profile-modal-header {
        padding: 15px;
    }

    .modal-header h3,
    .delete-modal-header h3,
    .account-modal-header h3,
    .edit-account-modal-header h3,
    .profile-modal-header h3 {
        font-size: 1.1em;
        padding-right: 25px;
    }

    .close {
        font-size: 24px;
        position: absolute;
        top: 15px;
        right: 15px;
    }

    .modal-body,
    .delete-modal-body {
        padding: 15px;
    }

    .modal-footer,
    .delete-modal-footer {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
        border-radius: 0 0 8px 8px;
    }

    .modal-footer .btn,
    .delete-modal-footer .btn {
        width: 100%;
        padding: 14px;
        font-size: 15px;
        min-height: 48px;
    }

    /* Account form mobile */
    .account-form label {
        font-size: 13px;
    }

    .account-form input,
    .account-form select,
    .account-form textarea {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .password-requirements {
        padding: 10px;
    }

    .password-requirements small {
        font-size: 12px;
    }

    /* Message styles mobile */
    .message {
        padding: 12px;
        font-size: 13px;
    }

    /* Type badge mobile */
    .type-badge,
    .status-badge {
        padding: 4px 8px;
        font-size: 9px;
    }

    .optional-text {
        font-size: 8px;
        max-width: 120px;
    }

    /* Today summary mobile */
    .today-summary {
        padding: 15px;
    }

    .today-summary h3 {
        font-size: 1.1em;
    }

    .today-stats {
        flex-direction: column;
        gap: 15px;
    }

    .stat-item {
        padding: 10px;
        background: var(--brand-soft);
        border-radius: 8px;
    }

    .stat-value {
        font-size: 1.3em;
    }

    .stat-label {
        font-size: 0.85em;
    }

    /* Focused table mobile */
    .focused-table {
        font-size: 11px;
        min-width: 850px;
    }

    .focused-table th,
    .focused-table td {
        padding: 10px 6px;
    }

    .account-column .account-email {
        font-size: 11px;
    }

    .account-column .account-details {
        font-size: 9px;
    }

    .today-amount {
        font-size: 12px;
    }

    /* Quick actions mobile */
    .quick-actions {
        flex-direction: column;
    }

    .view-toggle {
        width: 100%;
        padding: 12px;
        text-align: center;
    }

    /* Delete modal specific */
    .delete-account-info {
        padding: 12px;
        font-size: 13px;
    }

    .delete-account-info strong {
        font-size: 14px;
    }

    .warning-text {
        font-size: 12px;
    }

    .modal-body p {
        font-size: 14px;
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        margin: 10% auto;
        max-height: 80vh;
    }

    .modal-body {
        max-height: calc(80vh - 120px);
    }

    header h1 {
        font-size: 1.3em;
    }
}

/* Print styles */
@media print {
    .mobile-menu-toggle,
    header nav,
    .combined-filter-bar,
    .action-buttons,
    .btn {
        display: none !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .table-responsive {
        overflow: visible;
    }

    .accounts-table,
    .earnings-dashboard {
        min-width: auto;
        font-size: 10px;
    }

    .account-column,
    .type-column,
    .status-column,
    .target-column,
    .actions-column,
    .progress-column,
    .total-column {
        position: static;
    }
}