/* CSS Custom Properties for Light/Dark Mode */
:root {
    /* Light mode colors (default) */
    --bg-primary: #f4f6f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: rgba(255,255,255,0.8);
    --bg-quaternary: rgba(0,123,255,0.05);
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;
    --border-primary: rgba(0,0,0,0.05);
    --border-secondary: rgba(0,0,0,0.1);
    --border-tertiary: rgba(0,0,0,0.15);
    --shadow-primary: 0 4px 24px rgba(0,0,0,0.08);
    --shadow-secondary: 0 8px 32px rgba(25,118,210,0.3);
    --shadow-tertiary: 0 2px 10px rgba(0,0,0,0.1);
    --gradient-primary: linear-gradient(90deg, #007bff 80%, #0056b3 100%);
    --gradient-secondary: linear-gradient(90deg, #28a745 80%, #218838 100%);
    --gradient-tertiary: linear-gradient(90deg, #007bff 60%, #28a745 100%);
    --gradient-sidebar: linear-gradient(180deg, #1e3c72 0%, #2a5298 100%);
    --gradient-header: linear-gradient(135deg, #1976d2 0%, #28a745 100%);
    --accent-primary: #007bff;
    --accent-secondary: #28a745;
    --accent-tertiary: #6c757d;
    --success-bg: rgba(40,167,69,0.1);
    --success-border: rgba(40,167,69,0.2);
    --success-color: #28a745;
    --error-bg: rgba(220,53,69,0.1);
    --error-border: rgba(220,53,69,0.2);
    --error-color: #dc3545;
    --warning-bg: rgba(255,193,7,0.1);
    --warning-border: rgba(255,193,7,0.2);
    --warning-color: #ffc107;
    --info-bg: rgba(23,162,184,0.1);
    --info-border: rgba(23,162,184,0.2);
    --info-color: #17a2b8;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark mode colors */
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --bg-tertiary: rgba(45,45,45,0.9);
        --bg-quaternary: rgba(100,149,237,0.1);
        --text-primary: #e8e8e8;
        --text-secondary: #c0c0c0;
        --text-tertiary: #999999;
        --border-primary: rgba(255,255,255,0.1);
        --border-secondary: rgba(255,255,255,0.15);
        --border-tertiary: rgba(255,255,255,0.2);
        --shadow-primary: 0 4px 24px rgba(0,0,0,0.4);
        --shadow-secondary: 0 8px 32px rgba(0,0,0,0.5);
        --shadow-tertiary: 0 2px 10px rgba(0,0,0,0.3);
        --gradient-primary: linear-gradient(90deg, #4a9eff 80%, #357abd 100%);
        --gradient-secondary: linear-gradient(90deg, #4caf50 80%, #388e3c 100%);
        --gradient-tertiary: linear-gradient(90deg, #4a9eff 60%, #4caf50 100%);
        --gradient-sidebar: linear-gradient(180deg, #242424 0%, #2d2d2d 100%);
        --gradient-header: linear-gradient(135deg, #1976d2 0%, #388e3c 100%);
        --accent-primary: #4a9eff;
        --accent-secondary: #4caf50;
        --accent-tertiary: #9e9e9e;
        --success-bg: rgba(76,175,80,0.2);
        --success-border: rgba(76,175,80,0.3);
        --success-color: #4caf50;
        --error-bg: rgba(244,67,54,0.2);
        --error-border: rgba(244,67,54,0.3);
        --error-color: #f44336;
        --warning-bg: rgba(255,152,0,0.2);
        --warning-border: rgba(255,152,0,0.3);
        --warning-color: #ff9800;
        --info-bg: rgba(33,150,243,0.2);
        --info-border: rgba(33,150,243,0.3);
        --info-color: #2196f3;
    }
}

/* General Styles */
body {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    margin-left: 260px; /* Account for sidebar width */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Adjust body margin for mobile when sidebar is collapsed */
@media (max-width: 768px) {
    body {
        margin-left: 80px; /* Account for collapsed sidebar width */
    }
}

@media (max-width: 480px) {
    body {
        margin-left: 70px; /* Account for smaller collapsed sidebar width */
    }
}

/* Dashboard and main content containers */
.dashboard-container {
    margin: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-primary);
    color: var(--text-primary);
    min-height: calc(100vh - 60px);
    transition: all 0.3s ease;
}

.main-content {
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

/* CTA Buttons */
.cta-buttons {
    text-align: right;
    padding: 20px 40px 0 0;
}
.cta-buttons a {
    background: var(--gradient-tertiary);
    color: #fff;
    padding: 12px 28px;
    border-radius: 25px;
    text-decoration: none;
    margin-left: 12px;
    font-weight: 600;
    font-size: 1.08em;
    box-shadow: var(--shadow-tertiary);
    border: none;
    outline: none;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    display: inline-block;
    letter-spacing: 0.5px;
    position: relative;
    top: 0;
}
.cta-buttons a:first-child {
    background: var(--gradient-primary);
}
.cta-buttons a:last-child {
    background: var(--gradient-secondary);
}
.cta-buttons a:hover, .cta-buttons a:focus {
    transform: translateY(-2px) scale(1.04);
    box-shadow: var(--shadow-secondary);
    filter: brightness(1.07);
}

/* Container */
.container {
    max-width: 950px;
    margin: 40px auto 0 auto;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-primary);
    padding: 40px 30px 30px 30px;
}

/* Headings */
h1, .dashboard-header {
    text-align: center;
    margin-bottom: 18px;
    font-size: 2.2em;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Notification Styles */
.notification {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 18px;
    font-size: 1.08em;
    font-weight: 500;
    box-shadow: 0 2px 12px #e5737320;
    border: 1.5px solid transparent;
    animation: notifFadeIn 0.3s;
}
@keyframes notifFadeIn {
    from { opacity: 0; transform: translateY(-10px);}
    to { opacity: 1; transform: translateY(0);}
}
.success {
    background: #e6f9ed;
    color: #219150;
    border: 1.5px solid #38c172;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 1.08em;
    font-weight: 600;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px #38c17222;
    display: flex;
    align-items: center;
    gap: 10px;
}
.success::before {
    content: "✔️";
    font-size: 1.3em;
}
.error {
    background: #ffeaea;
    color: #c0392b;
    border: 1.5px solid #e74c3c;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 1.08em;
    font-weight: 600;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px #e74c3c22;
    display: flex;
    align-items: center;
    gap: 10px;
}
.error::before {
    content: "⚠️";
    font-size: 1.3em;
}
.error-notification {
    background: #ffeaea;
    color: #b71c1c;
    border-color: #e57373;
}
.notif-icon {
    font-size: 1.7em;
    margin-right: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Login/Register Forms */
.login-container, .register-container {
    max-width: 480px;
    margin: 60px auto 0 auto;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-primary);
    padding: 36px 30px 30px 30px;
}
.login-container h2, .register-container h2 {
    text-align: center;
    color: #28a745;
    margin-bottom: 24px;
}
.login-container form, .register-container form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.login-container input[type="text"],
.login-container input[type="password"],
.register-container input,
.register-container select {
    padding: 12px;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    font-size: 1em;
    background: #f9fafb;
    transition: border 0.2s;
}
.login-container input:focus,
.register-container input:focus,
.register-container select:focus {
    border-color: #28a745;
    background: #fff;
    outline: none;
}
.login-container button,
.register-container button {
    background: var(--gradient-secondary);
    color: #fff;
    padding: 12px 0;
    border: none;
    border-radius: 25px;
    font-size: 1.08em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(40,123,255,0.10);
}
.login-container button:hover,
.register-container button:hover {
    filter: brightness(1.07);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 18px rgba(40,123,255,0.18);
}
.login-container .register-link,
.register-container .login-link {
    text-align: center;
    margin-top: 18px;
    font-size: 1em;
}
.login-container .register-link a,
.register-container .login-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}
.login-container .register-link a:hover,
.register-container .login-link a:hover {
    text-decoration: underline;
}
.section-title {
    font-weight: 700;
    color: #1976d2;
    margin: 18px 0 8px 0;
    font-size: 1.09em;
    letter-spacing: 0.5px;
}

.role-fields input[type="text"],
.role-fields input[type="number"],
.role-fields input[type="email"],
.role-fields select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 7px;
    border: 1.5px solid #cfd8dc;
    font-size: 1em;
    background: #f9fafb;
    margin-bottom: 13px;
    transition: border 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}

.role-fields input[type="text"]:focus,
.role-fields input[type="number"]:focus,
.role-fields input[type="email"]:focus,
.role-fields select:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px #1976d233;
    background: #fff;
}

.trade-group {
    margin-bottom: 13px;
}

#new_trade_input {
    margin-top: 8px;
    margin-bottom: 0;
    background: #e8f0fe;
    border: 1.5px solid #90caf9;
}

.insurance-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.98em;
    margin-bottom: 10px;
    color: #1976d2;
    font-weight: 500;
}

/* Role Toggle */
.role-toggle {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-bottom: 18px;
}
.role-toggle input[type="radio"] {
    display: none;
}
.role-btn {
    padding: 12px 28px;
    border-radius: 25px;
    border: 2px solid #cfd8e3;
    background: #f4f6f8;
    color: #444;
    font-weight: 600;
    font-size: 1.08em;
    cursor: pointer;
    transition: background 0.2s, border 0.2s, color 0.2s;
    user-select: none;
}
.role-btn.homeowner-btn { border-color: #28a745; }
.role-btn.pro-btn { border-color: #007bff; }
.role-toggle input[type="radio"]:checked + .role-btn {
    background: var(--gradient-secondary);
    color: #fff;
    border-color: #28a745;
}
.role-toggle input[type="radio"]:checked + .pro-btn {
    background: var(--gradient-primary);
    color: #fff;
    border-color: #007bff;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px 28px;
    margin-bottom: 18px;
}
@media (max-width: 700px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}
.section-title {
    font-weight: 700;
    color: #1976d2;
    margin-bottom: 8px;
    font-size: 1.09em;
    letter-spacing: 0.5px;
    grid-column: 1 / -1;
}
.role-fields {
    background: #f7fafd;
    border-radius: 10px;
    padding: 18px 18px 10px 18px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px #1976d211;
}
.form-grid input,
.form-grid select,
.form-grid button {
    margin-bottom: 0;
}

.role-fields input[type="text"],
.role-fields input[type="number"],
.role-fields input[type="email"],
.role-fields select {
    width: 100%;
    margin-bottom: 0;
}

#find-address-btn {
    grid-column: 2;
    margin-left: 0;
    margin-bottom: 0;
    align-self: end;
}

#address-select {
    grid-column: 1 / -1;
}

@media (max-width: 700px) {
    #find-address-btn, #address-select {
        grid-column: 1;
    }
        .profile-form-wide {
        grid-template-columns: 1fr;
    }
}

/* Problems Table */
.problems-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 16px #0001;
}
.problems-table th, .problems-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}
.problems-table th {
    background: #f5f5f5;
    font-weight: 600;
}

/* Action Buttons */
.action-btn {
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 6px 14px;
    margin: 2px 0;
    font-size: 0.98em;
    cursor: pointer;
    transition: background 0.18s;
}
.action-btn:hover {
    background: #0d47a1;
}
.action-btn.cancel-btn:focus {
    background: #e0e0e0 !important;
    color: #222 !important;
    border-color: #888 !important;
}
.cancel-btn {
    background: #bdbdbd !important;
    color: #222 !important;
    margin-left: 8px;
}
.cancel-btn:hover {
    background: #888 !important;
    color: #fff !important;
}
.cancel-btn {
    background: #f5f5f5 !important;
    color: #444 !important;
    border: 1.5px solid #bdbdbd !important;
    margin-left: 10px;
    transition: background 0.18s, color 0.18s, border 0.18s;
    border-radius: 5px;
    padding: 6px 14px;
    margin: 2px 0;
    font-size: 0.98em;
    cursor: pointer;
}
.cancel-btn:hover,
.cancel-btn:focus {
    background: #e0e0e0 !important;
    color: #222 !important;
    border-color: #888 !important;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(44, 62, 80, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}
.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 38px 36px 28px 36px;
    box-shadow: var(--shadow-primary);
    text-align: left;
    min-width: 340px;
    max-width: 95vw;
    animation: modalPop .25s cubic-bezier(.4,2,.6,1) 1;
}
@keyframes modalPop {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.modal-content h3 {
    margin-top: 0;
    font-size: 1.4em;
    color: #222;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.modal-form-group {
    margin-bottom: 18px;
}
.modal-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #222;
    font-size: 1.05em;
}
.modal-content input[type="text"],
.modal-content textarea {
    width: 100%;
    padding: 13px 15px;
    border-radius: 7px;
    border: 1.5px solid #cfd8dc;
    font-size: 1.08em;
    background: #f7fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    outline: none;
    margin-bottom: 0;
}
.modal-content input[type="text"]:focus,
.modal-content textarea:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px #1976d233;
    background: #fff;
}
.modal-content textarea {
    min-height: 90px;
    resize: vertical;
}
.modal-content.delete-modal {
    background: #fff;
    border-radius: 18px;
    padding: 38px 36px 28px 36px;
    box-shadow: 0 8px 40px #2225;
    text-align: center;
    min-width: 340px;
    max-width: 95vw;
    animation: modalPop .25s cubic-bezier(.4,2,.6,1) 1;
}
.delete-modal-icon {
    font-size: 3em;
    color: #e53935;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.delete-modal h3 {
    margin-top: 0;
    font-size: 1.5em;
    color: #e53935;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.delete-modal p {
    color: #444;
    font-size: 1.08em;
    margin-bottom: 28px;
}
.delete-modal-actions {
    display: flex;
    gap: 18px;
    justify-content: center;
    margin-top: 18px;
}

.delete-modal-actions .delete-account-btn {
    background: #e53935;
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 1.08em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, filter 0.18s;
    min-width: 180px;
}

.delete-modal-actions .delete-account-btn:hover {
    background: #b71c1c;
    filter: brightness(1.07);
}

.delete-modal-actions .cancel-btn {
    background: #f5f5f5;
    color: #444;
    border: 1.5px solid #bdbdbd;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 1.08em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border 0.18s;
    min-width: 120px;
}

.delete-modal-actions .cancel-btn:hover {
    background: #e0e0e0;
    color: #222;
    border-color: #888;
}

/* Profile Card */
.profile-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-secondary);
    border-radius: 18px;
    box-shadow: var(--shadow-primary);
    padding: 48px 40px;
    margin-top: 24px;
    max-width: 1100px;
    width: 100%;
    gap: 32px;
}
.profile-pic-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    min-width: 200px;
}
.profile-pic-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #28a745;
    background: #f5f7fa;
    margin-bottom: 10px;
    box-shadow: 0 2px 12px #e3e7ed;
}
.profile-form-btn,
.upload-btn {
    min-width: 200px;
    padding: 14px 0;
    border-radius: 25px;
    font-size: 1.15em;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s, filter 0.18s;
    box-shadow: 0 2px 8px #1976d211;
    color: #fff;
    background: #28a745;
    margin: 0;
    display: inline-block;
    text-align: center;
    outline: none;
    user-select: none;
}
.profile-form-btn:hover,
.upload-btn:hover {
    filter: brightness(1.07);
}
.upload-btn:hover, .upload-btn:focus {
    background: #218838;
}
.profile-form-wide {
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1 1 0;
}
.profile-form label {
    flex: 1 1 45%;
    min-width: 220px;
    font-weight: 500;
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.profile-form-wide {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px 32px;
    margin-bottom: 18px;
    align-items: end;
}
.profile-section-title {
    font-weight: bold;
    color: #1976d2;
    margin: 10px 0 0 0;
    font-size: 1.1em;
    letter-spacing: 0.5px;
    grid-column: 1 / -1;
}
.profile-form-wide label {
    display: flex;
    flex-direction: column;
    font-weight: 500;
    gap: 4px;
}
.profile-form-wide input[type="text"],
.profile-form-wide input[type="email"],
.profile-form-wide input[type="number"] {
    height: 40px;
    font-size: 1em;
    border-radius: 7px;
    padding: 0 10px;
    border: 1px solid #cfd8dc;
    background: #f7fafc;
}
.profile-form input[type="text"]:focus,
.profile-form input[type="email"]:focus,
.profile-form input[type="number"]:focus {
    border-color: #28a745;
    background: #fff;
    outline: none;
}
.profile-form-actions {
    display: flex;
    gap: 18px;
    margin-top: 18px;
    justify-content: center;
}
.profile-form-actions button,
.profile-form-actions .delete-account-btn {
    min-width: 200px;
    padding: 14px 0;
    border-radius: 25px;
    font-size: 1.15em;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s, filter 0.18s;
    box-shadow: 0 2px 8px #1976d211;
    color: #fff;
    background: #28a745;
    margin: 0;
    display: inline-block;
}
.profile-form-actions .delete-account-btn {
    background: #e53935;
}
.profile-form-actions button:hover,
.profile-form-actions .delete-account-btn:hover {
    filter: brightness(1.07);
}
.custom-checkbox-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    /*background: #f7fafd;*/
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
}
.custom-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1976d2;
}  
.custom-checkbox-label span:last-child {
    margin-left: 4px;
}
.custom-checkbox-input {
    display: none;
}
.custom-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #28a745;
    border-radius: 6px;
    background: #fff;
    display: inline-block;
    position: relative;
    transition: border-color 0.2s;
}
.custom-checkbox-label .custom-checkbox-input:checked + .custom-checkbox {
    background: #28a745;
    border-color: #28a745;
}
.custom-checkbox::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    opacity: 0;
    transform: scale(0.8) rotate(45deg);
    transition: opacity 0.2s;
}
.custom-checkbox-label .custom-checkbox-input:checked + .custom-checkbox::after {
    opacity: 1;
}

.problems-table {
    max-width: 1100px;
    margin: 0 auto 24px auto;
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 2px 16px #0001;
    background: var(--bg-secondary);
}

/* Modern Glassmorphic Modal for View Applications */
.app-details-container {
    max-width: 540px;
    margin: 56px auto 0 auto;
    background: rgba(255,255,255,0.75);
    border-radius: 22px;
    box-shadow: 0 8px 32px #1e3c7240;
    padding: 0 0 36px 0;
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(30,60,114,0.13);
    animation: fadeIn 0.4s;
}
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gradient-header);
    color: #fff;
    border-radius: 22px 22px 0 0;
    padding: 22px 32px 12px 32px;
    font-size: 1.25em;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 12px #1976d220;
}
.slider-title {
    font-size: 1.1em;
    font-weight: 700;
}
.slider-count {
    font-size: 0.98em;
    font-weight: 400;
    opacity: 0.85;
}
.app-slide {
    display: none !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    padding: 0 32px;
}
.app-slide.active { display: flex !important; }
.app-card {
    background: rgba(255,255,255,0.92);
    border-radius: 18px;
    box-shadow: 0 4px 24px #1e3c7240;
    padding: 32px 28px 24px 28px;
    margin: 24px 0 10px 0;
    width: 100%;
    border: 1px solid #e3e8f0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    animation: fadeIn 0.3s;
    backdrop-filter: blur(6px);
}
.app-details-title {
    text-align: center;
    color: #1976d2;
    font-size: 1.3em;
    font-weight: 800;
    margin-bottom: 18px;
    letter-spacing: 0.5px;
}
.app-details-section {
    margin-bottom: 18px;
}
.app-details-row {
    margin-bottom: 10px;
    font-size: 1.08em;
    display: flex;
    align-items: flex-start;
}
.app-details-label {
    color: #219150;
    min-width: 120px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: inline-block;
}
.app-details-value {
    color: #222;
    font-weight: 500;
    word-break: break-word;
    flex: 1;
}
.tradie-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #1976d2;
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1em;
    margin-right: 8px;
    box-shadow: 0 2px 8px #1976d220;
}
.tradie-email {
    color: #888;
    font-size: 0.98em;
    margin-left: 4px;
}
.app-form {
    margin-bottom: 14px;
}
.app-textarea {
    width: 100%;
    min-height: 60px;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid #cfd8dc;
    font-size: 1em;
    resize: vertical;
    background: #f8fafc;
    transition: border 0.2s;
}
.app-textarea:focus {
    border: 1.5px solid #1976d2;
    outline: none;
    background: #fff;
}
.slider-controls {
    display: flex;
    justify-content: space-between;
    margin: 0 32px 0 32px;
    gap: 10px;
}
.slider-btn {
    background: var(--gradient-header);
    color: #fff;
    padding: 10px 26px;
    border-radius: 16px;
    border: none;
    font-weight: 700;
    font-size: 1.08em;
    cursor: pointer;
    box-shadow: 0 2px 8px #1976d220;
    transition: background 0.2s, box-shadow 0.2s;
}
.slider-btn:disabled {
    background: #e0e7ef;
    color: #aaa;
    cursor: not-allowed;
    box-shadow: none;
}
.slider-btn:not(:disabled):hover {
    background: linear-gradient(90deg, #155a8a 60%, #1976d2 100%);
    box-shadow: 0 4px 16px #1976d220;
}
.app-btn-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}
.send-btn {
    min-width: 140px;
}
.approveBtn {
    min-width: 180px;
    margin-top: 8px;
    width: 100%;
    background: linear-gradient(90deg, #38c172 60%, #43e97b 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1.08em;
    border-radius: 16px;
    border: none;
    padding: 10px 0;
    box-shadow: 0 2px 8px #38c17220;
    transition: background 0.2s, box-shadow 0.2s;
}
.approveBtn:hover {
    background: linear-gradient(90deg, #219150 60%, #38c172 100%);
    box-shadow: 0 4px 16px #38c17220;
}
.replyStatus, .approveStatus {
    display: block;
    margin-top: 6px;
    font-size: 0.98em;
    min-height: 18px;
}
@media (max-width: 700px) {
    .app-details-container {
        padding: 0 0 18px 0;
    }
    .slider-header {
        padding: 14px 8vw 8px 8vw;
        font-size: 1em;
    }
    .app-slide {
        padding: 0 4vw;
    }
    .slider-controls {
        margin: 0 4vw 0 4vw;
    }
}

/* Responsive */
@media (max-width: 1100px) {
    body {
        margin-left: 0; /* Remove sidebar margin on very small screens */
    }
    .dashboard-container { 
        margin: 20px 0 0 0; 
    }
}

/* Modern select/dropdown styling for modal */
.modal-content select,
.modal-form-group select {
    width: 100%;
    padding: 13px 15px;
    border-radius: 7px;
    border: 1.5px solid #cfd8dc;
    font-size: 1.08em;
    background: #f7fafc;
    color: #222;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    outline: none;
    margin-bottom: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,<svg width='16' height='16' fill='gray' xmlns='http://www.w3.org/2000/svg'><path d='M4 6l4 4 4-4'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
}
.modal-content select:focus,
.modal-form-group select:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px #1976d233;
    background: #fff;
}
.sidebar-nav {
    width: 260px;
    background: var(--gradient-sidebar);
    color: #fff;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100vh;
    box-shadow: var(--shadow-secondary);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(2px);
}

.sidebar-nav .nav-header {
    font-size: 1.7em;
    font-weight: 800;
    padding: 38px 0 24px 0;
    text-align: center;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.04);
    margin-bottom: 12px;
    color: #fff;
    text-shadow: 0 2px 12px #1e3c7240;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1 1 auto;
}

.sidebar-nav ul li {
    margin: 0;
    position: relative; 
    display: inline-block; /* Make list items display inline */
    vertical-align: top; /* Align items properly */
}

.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    color: #e3eafc;
    text-decoration: none;
    font-size: 1.08em;
    font-weight: 500;
    letter-spacing: 0.5px;
    border-left: 4px solid transparent;
    transition: background 0.18s, color 0.18s, border 0.18s, padding 0.18s;
    border-radius: 30px 0 0 30px; /* Rounded corners on the left */
    position: relative;
}
.sidebar-nav ul li a img {
    width: 24px;
    height: 24px;
    background: #1e3c72; 
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    display: inline-block;
    object-fit: contain; 
}

.sidebar-nav ul li a.active,
.sidebar-nav ul li a:hover,
.sidebar-nav ul li a:focus {
    background: rgba(255,255,255,0.13);
    color: #fff;
    border-left: 4px solid #fff;
    padding-left: 36px;
    text-shadow: 0 2px 8px #2a529855;
}

.sidebar-nav ul li a:active {
    background: rgba(255,255,255,0.18);
}

/* --- Notification Bell and Bubble --- */
.notif-bell {
    font-size: 1.2em;
    display: inline-block;
    position: relative;
    width: 1.5em;
    text-align: center;
}
.notif-bubble {
    display: inline-block;
    position: absolute;
    top: -7px;
    right: -10px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #e74c3c;
    color: #fff;
    border-radius: 12px;
    font-size: 0.95em;
    font-weight: bold;
    text-align: center;
    line-height: 20px;
    box-shadow: 0 1px 4px #0002;
    vertical-align: middle;
    z-index: 2;
    border: 2px solid #fff;
}

/* --- Logout Button --- */
.logout-link {
    margin: 0 0 32px 0;
    text-align: center;
}

.logout-link a {
    display: inline-block;
    background: var(--gradient-header);
    color: #fff;
    padding: 10px 32px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.08em;
    box-shadow: 0 2px 8px rgba(30,60,114,0.10);
    border: none;
    outline: none;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    margin-top: 18px;
}

.logout-link a:hover, .logout-link a:focus {
    filter: brightness(1.09);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 18px rgba(30,60,114,0.18);
}

/* --- Responsive Sidebar --- */
@media (max-width: 768px) {
    .sidebar-nav {
        width: 80px; /* Reduce width for smaller screens */
    }

    .sidebar-nav ul li a span {
        display: none; /* Hide text labels */
    }

    .sidebar-nav ul li a {
        justify-content: center; /* Center icons */
        padding: 16px; /* Adjust padding */
    }

    .sidebar-nav .nav-header {
        font-size: 1.2em; /* Reduce header size */
    }

    .logout-link a {
        font-size: 0.9em; /* Adjust logout button size */
        padding: 8px 16px;
    }
}

/* --- Force only the active application to show --- */
.app-slide { display: none !important; }
.app-slide.active { display: flex !important; }