/*
 * Apartment Booking System - Styling
 * Premium responsive dark-theme design system.
 */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans:opsz,wght@8..144,100..1000&display=swap');

:root {
    color-scheme: dark;
    /* Colors */
    --bg-primary: #0b0f19;
    --bg-secondary: #151c2c;
    --bg-card: rgba(22, 28, 45, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.1);

    /* Flat Status Colors */
    --status-vacant: #ffffff;
    --status-vacant-bg: rgba(255, 255, 255, 0.05);
    --status-vacant-border: rgba(255, 255, 255, 0.2);
    --status-vacant-text: #f8fafc;

    --status-booked: #22c55e;
    --status-booked-bg: rgba(34, 197, 94, 0.15);
    --status-booked-border: #22c55e;
    --status-booked-text: #4ade80;

    --status-blocked: #eab308;
    --status-blocked-bg: rgba(234, 179, 8, 0.15);
    --status-blocked-border: #eab308;
    --status-blocked-text: #facc15;

    --status-paid: #3b82f6;
    --status-paid-bg: rgba(59, 130, 246, 0.15);
    --status-paid-border: #3b82f6;
    --status-paid-text: #60a5fa;

    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-text: #f87171;

    /* Fonts & Radii */
    --font-main: 'Google Sans', system-ui, -apple-system, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --blur-glass: 8px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/*
Source - https://stackoverflow.com/a/64499164
Posted by ierdna
Retrieved 2026-07-13, License - CC BY-SA 4.0
*/




a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* App Header & Navbar */
.app-header {
    background-color: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(var(--blur-glass));
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-item {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-logout {
    color: var(--danger-text);
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
}

/* Main Container */
.container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Auth Screens */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: 2rem 1.5rem;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur-glass));
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* Forms controls */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    background-color: rgba(11, 15, 25, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%2394a3b8' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
    cursor: pointer;
}

select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

select option:checked {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}

/* Custom Select Container Wrapper */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.custom-select-wrapper.open {
    z-index: 1050;
}

.custom-select-wrapper select.custom-select-initialized {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

/* Custom Select Trigger Button */
.custom-select-trigger {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
    background-color: rgba(11, 15, 25, 0.5);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    outline: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    min-height: 42px;
    gap: 0.5rem;
}

.custom-select-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.custom-select-trigger:hover {
    background-color: rgba(11, 15, 25, 0.7);
    border-color: rgba(255, 255, 255, 0.15);
}

.custom-select-wrapper.focused .custom-select-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.custom-select-caret {
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select-wrapper.open .custom-select-caret {
    transform: rotate(180deg);
}

/* Custom Options Dropdown List */
.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    margin-top: 4px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-glass);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
    backdrop-filter: blur(var(--blur-glass));
}

.custom-select-wrapper.open .custom-options {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.custom-option {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-option:hover {
    background-color: rgba(79, 70, 229, 0.15);
    color: var(--text-primary);
}

.custom-option.selected {
    background-color: var(--primary);
    color: #ffffff;
    font-weight: 500;
}

.custom-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.custom-select-wrapper.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.custom-select-wrapper.disabled .custom-select-trigger {
    pointer-events: none;
    background-color: rgba(11, 15, 25, 0.2);
}

/* Enable native select behaviors on mobile/touch devices */
@media (max-width: 768px),
(pointer: coarse) {
    .custom-select-wrapper select.custom-select-initialized {
        pointer-events: auto !important;
        z-index: 2 !important;
        cursor: pointer;
    }

    .custom-options {
        display: none !important;
    }
}


textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--primary);
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Alert messages */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: var(--danger-bg);
    color: var(--danger-text);
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-success {
    background-color: var(--status-booked-bg);
    color: var(--status-booked-text);
    border-color: rgba(34, 197, 94, 0.2);
}

/* Dashboard Cards & Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-value.vacant {
    color: var(--status-vacant-text);
}

.stat-value.booked {
    color: var(--status-booked-text);
}

.stat-value.blocked {
    color: var(--status-blocked-text);
}

.stat-value.paid {
    color: var(--status-paid-text);
}

/* Main Section Split Layout */
.section-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .section-layout {
        grid-template-columns: 1fr;
    }
}

.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.site-section-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.site-section-header .section-title {
    width: 100%;
}

.flats-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

.wing-section {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    width: 100%;
    box-sizing: border-box;
}

.floor-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px dashed rgb(126 126 126);
    padding: 0.8rem 0;
    gap: 0.75rem;
    width: 100%;
}

.floor-label {
    width: 100%;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.floor-flats {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Site Lists */
.site-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.site-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s, border-color 0.2s;
}

.site-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
}

.site-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    min-width: 150px;
}

.site-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.site-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Apartment Grid Screen */
.status-legends {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid transparent;
}

.legend-color.vacant {
    background-color: #ffffff;
    border-color: #e2e8f0;
}

.legend-color.booked {
    background-color: var(--status-booked-bg);
    border-color: var(--status-booked-border);
}

.legend-color.blocked {
    background-color: var(--status-blocked-bg);
    border-color: var(--status-blocked-border);
}

.legend-color.paid {
    background-color: var(--status-paid-bg);
    border-color: var(--status-paid-border);
}

/* Flats Grid */
.flats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.flat-box {
    aspect-ratio: 1.1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.2;
    transition: transform 0.15s, box-shadow 0.15s;
    user-select: none;
    text-align: center;
    position: relative;
    border: 1px solid transparent;
    padding: 0.25rem;
}

.flat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Custom styles for Flat box statuses */
.flat-box.vacant {
    background-color: #ffffff;
    border-color: #e2e8f0;
    color: #0b0f19;
}

.flat-box.booked {
    background-color: var(--status-booked-bg);
    border-color: var(--status-booked-border);
    color: var(--status-booked-text);
}

.flat-box.blocked {
    background-color: var(--status-blocked-bg);
    border-color: var(--status-blocked-border);
    color: var(--status-blocked-text);
}

.flat-box.paid {
    background-color: var(--status-paid-bg);
    border-color: var(--status-paid-border);
    color: var(--status-paid-text);
}

.flat-box .flat-desc {
    font-size: 0.65rem;
    font-weight: 500;
    margin-top: 2px;
    opacity: 0.8;
    text-transform: uppercase;
}

.flat-box .timer-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.55rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.4);
    padding: 1px 4px;
    border-radius: 3px;
    color: #facc15;
    margin-top: 10px;
}

/* Modals */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal-body {
    flex: 1 1 auto;
    min-height: 0 !important;
    overflow-y: auto !important;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal-backdrop.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close,
.btn-close {
    background: transparent !important;
    border: none !important;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.5rem;
    outline: none;
    box-shadow: none;
    transition: color 0.2s ease;
}

.modal-close:hover,
.btn-close:hover {
    color: var(--text-primary);
    background: transparent !important;
}

.status-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.status-option-btn {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.status-option-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.status-option-btn.active {
    border-width: 2px;
}

.status-option-btn.vacant.active {
    border-color: #ffffff;
    background-color: #ffffff;
    color: #0b0f19;
}

.status-option-btn.booked.active {
    border-color: var(--status-booked-border);
    background-color: var(--status-booked-bg);
    color: var(--status-booked-text);
}

.status-option-btn.blocked.active {
    border-color: var(--status-blocked-border);
    background-color: var(--status-blocked-bg);
    color: var(--status-blocked-text);
}

.status-option-btn.paid.active {
    border-color: var(--status-paid-border);
    background-color: var(--status-paid-bg);
    color: var(--status-paid-text);
}

.mobile-delete-btn {
    display: none !important;
}

/* Customers Page */
.customer-search {
    margin-bottom: 1.5rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive th,
.table-responsive td {
    white-space: nowrap;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    text-align: left;
}

th,
td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Payment Timeline UI */
.timeline-container {
    position: relative;
    padding-left: 2rem;
    margin: 1.5rem 0;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -29px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    z-index: 10;
}

.timeline-item.paid .timeline-dot {
    border-color: var(--status-booked-border);
    background-color: var(--status-booked-border);
}

.timeline-item.pending .timeline-dot {
    border-color: var(--status-blocked-border);
    background-color: var(--bg-secondary);
}

.timeline-content {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline-details p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.timeline-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.paid {
    background-color: var(--status-booked-bg);
    color: var(--status-booked-text);
}

.badge.pending {
    background-color: var(--status-blocked-bg);
    color: var(--status-blocked-text);
}

.badge.flat {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Utility Layouts */
.flex-space-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-1 {
    gap: 1rem;
}

.gap-2 {
    gap: 2rem;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.text-muted {
    color: var(--text-muted);
}

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

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-icon.danger:hover {
    background-color: var(--danger-bg);
    color: var(--danger-text);
}

/* App Sidebar Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.app-sidebar {
    width: 260px;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-primary);
    width: calc(100% - 260px);
}

.mobile-topbar {
    display: none;
    background-color: rgba(18, 24, 38, 0.95) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    align-items: center;
    justify-content: space-between;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 56px !important;
    z-index: 999 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.mobile-brand {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hamburger-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 998;
}

.sidebar-brand {
    padding: 1.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-menu {
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.35);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    background-color: var(--primary-light);
    color: #818cf8;
    border-left: 3px solid var(--primary);
}

.sidebar-footer {
    padding: 1.25rem 1rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-user {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

.sidebar-user-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.sidebar-username {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Tasks UI styling */
.task-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.task-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.task-filter-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.task-filter-btn:hover {
    color: var(--text-primary);
}

.task-filter-btn.active {
    background-color: var(--primary-light);
    color: #818cf8;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: all 0.2s;
}

.task-card.completed {
    opacity: 0.6;
}

.task-check-wrapper {
    margin-top: 2px;
}

.task-checkbox-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s;
}

.task-card.completed .task-checkbox {
    background-color: var(--status-booked-border);
    border-color: var(--status-booked-border);
    color: white;
}

.task-checkbox:hover {
    border-color: var(--primary);
}

.task-body {
    flex: 1;
}

.task-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.task-card.completed .task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.task-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.task-badge.due {
    background-color: rgba(234, 179, 8, 0.1);
    color: #facc15;
}

.task-badge.due.overdue {
    background-color: var(--danger-bg);
    color: var(--danger-text);
}

.task-badge.flat-tag {
    background-color: var(--primary-light);
    color: #818cf8;
}

/* Calendar Styles */
.calendar-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calendar-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.calendar-nav {
    display: flex;
    gap: 0.5rem;
}

.calendar-responsive {
    width: 100%;
    overflow-x: auto;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-width: 700px;
}

.calendar-weekday {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-day {
    background-color: var(--bg-primary);
    min-height: 120px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
    transition: background-color 0.2s;
}

.calendar-day:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

.calendar-day.other-month {
    background-color: rgba(0, 0, 0, 0.15);
    opacity: 0.4;
}

.calendar-day.today {
    background-color: rgba(79, 70, 229, 0.05);
}

.calendar-day.today::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary);
}

.calendar-day-number {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    align-self: flex-start;
}

.calendar-day.today .calendar-day-number {
    color: #818cf8;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    flex: 1;
}

.calendar-event {
    font-size: 0.7rem;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    border-left: 3px solid transparent;
}

.calendar-event.payment {
    background-color: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border-left-color: #3b82f6;
}

.calendar-event.payment.paid {
    background-color: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border-left-color: #22c55e;
}

.calendar-event.task-pending {
    background-color: rgba(234, 179, 8, 0.12);
    color: #facc15;
    border-left-color: #eab308;
}

.calendar-event.task-completed {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-left-color: var(--text-muted);
    text-decoration: line-through;
}

.calendar-event.blocked-expiry {
    background-color: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-left-color: #ef4444;
}

/* Sidebar Responsive Logic */
@media (max-width: 992px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding-top: 56px !important;
    }

    .mobile-topbar {
        display: flex;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .container {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 900px) {
    .task-layout {
        grid-template-columns: 1fr;
    }
}

/* Hide number input spinners globally */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* Premium Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pagination-link:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.pagination-link.active {
    color: #ffffff;
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    cursor: default;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Progress Circle Card */
.progress-circle-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.progress-circle-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__background {
    stroke: rgba(255, 255, 255, 0.05);
}

.progress-ring__circle {
    stroke-dasharray: 314.16;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1), stroke 1.2s cubic-bezier(0.4, 0, 0.2, 1), filter 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: 50% 50%;
}

.progress-circle-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-stats h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.progress-stats .stats-grid {
    display: flex;
    gap: 2rem;
    margin-top: 0.75rem;
}

.stat-row {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-row span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-row strong {
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Filters Layout */
.filter-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.preset-btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.preset-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.08);
}

.preset-btn.active {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: #818cf8;
}

.custom-date-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.custom-date-range-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.custom-date-range-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-input {
    width: auto !important;
    max-width: 180px;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
}

.custom-date-inputs .btn-primary-sm,
.custom-date-inputs .btn-secondary-sm,
.custom-date-inputs .btn-primary,
.custom-date-inputs .btn-secondary {
    padding: 0.75rem 1.25rem !important;
    font-size: 0.9rem !important;
    height: 44px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.date-sep {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.btn-primary-sm,
.btn-secondary-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
}

.btn-primary-sm {
    background-color: var(--primary);
    color: white;
}

.btn-primary-sm:hover {
    background-color: var(--primary-hover);
}

.btn-secondary-sm {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary-sm:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.1);
}

/* Tasks Table View */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.task-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.task-table th,
.task-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.task-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: rgba(255, 255, 255, 0.01);
}

.task-row {
    transition: background-color 0.2s;
}

.task-row:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.task-row.completed {
    opacity: 0.65;
}

/* Checklist Checkbox */
.task-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    background: transparent;
}

.task-checkbox:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.task-checkbox.checked {
    background-color: #22c55e;
    border-color: #22c55e;
    color: white;
}

/* Task Details Cell */
.task-details-cell {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.task-name-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.task-row.completed .task-name-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-desc-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.task-metadata-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.meta-item {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.vendor-tag {
    border-color: rgba(59, 130, 246, 0.2);
    background-color: rgba(59, 130, 246, 0.05);
    color: #60a5fa;
}

.location-tag {
    border-color: rgba(234, 179, 8, 0.2);
    background-color: rgba(234, 179, 8, 0.05);
    color: #facc15;
}

.weight-badge {
    background-color: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
    font-size: 0.75rem;
}

.task-date-cell {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Solution Styling */
.task-solution-cell {
    max-width: 250px;
}

.solution-content {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Deadline Cell */
.task-due-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
}

.task-due-badge.overdue {
    background-color: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
    font-weight: 500;
}

.overdue-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    background-color: var(--danger);
    color: white;
    padding: 0.05rem 0.25rem;
    border-radius: 3px;
    font-weight: 600;
}

/* Form Stickiness and Grids */
.sticky-form {
    position: sticky;
    top: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Full Width Task Layout */
.task-layout-full {
    width: 100%;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

/* Modal Card */
.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    animation: modalAppear 0.3s ease-out;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0.25rem;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.modal-card form {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1.5rem;
    gap: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ==========================================================================
   Calendar Task Scheduler & Timeline UI
   ========================================================================== */

.timeline-wrapper {
    position: relative;
    padding-left: 55px;
    margin: 2rem 0;
}

/* Vertical line track */
.timeline-line-container {
    position: absolute;
    left: 23px;
    /* Centers in a 48px timeline area */
    top: 15px;
    bottom: 15px;
    width: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

/* Active animated progress bar with gradient */
.timeline-line-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to bottom, #ef4444, #f97316, #22c55e);
    border-radius: 4px;
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

.timeline-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.timeline-item {
    position: relative;
    display: flex;
    align-items: flex-start;
}

.timeline-node {
    position: absolute;
    left: -55px;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

/* Checkbox timeline node button */
.timeline-checkbox-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-checkbox {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.timeline-checkbox-btn:hover .timeline-checkbox {
    border-color: #f97316;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
}

.timeline-checkbox.checked {
    background-color: #22c55e;
    border-color: #22c55e;
    color: white;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

/* Timeline task content card */
.timeline-content-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur-glass));
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    width: 100%;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.timeline-content-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background-color: rgba(22, 28, 45, 0.85);
}

.timeline-item.completed .timeline-content-card {
    opacity: 0.6;
    border-color: rgba(34, 197, 94, 0.15);
    background-color: rgba(34, 197, 94, 0.02);
}

.timeline-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.timeline-task-time {
    font-size: 0.8rem;
    font-weight: 600;
    color: #818cf8;
    background: rgba(129, 140, 248, 0.1);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.timeline-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.timeline-task-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.timeline-item.completed .timeline-task-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.timeline-task-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Congratulations Daily Greet Card */
.greet-card {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(22, 163, 74, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.1), inset 0 0 10px rgba(34, 197, 94, 0.05);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: greetAppear 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.greet-icon {
    font-size: 2.2rem;
    color: #4ade80;
    animation: pulseIcon 2s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.greet-body {
    flex: 1;
}

.greet-body h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #4ade80;
    margin-bottom: 0.2rem;
}

.greet-body p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

@keyframes greetAppear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes pulseIcon {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
        text-shadow: 0 0 10px rgba(74, 222, 128, 0.6);
    }

    100% {
        transform: scale(1);
    }
}

/* ==========================================
   Small Progress Ring in Task Rows
   ========================================== */
.small-progress-wrapper {
    position: relative;
    width: 56px;
    height: 56px;
    margin: 0 auto;
    cursor: pointer;
}

.small-progress-ring {
    transform: rotate(-90deg);
}

.small-progress-ring__background {
    stroke: rgba(255, 255, 255, 0.05);
}

.small-progress-ring__circle {
    stroke-dasharray: 125.66;
    stroke-dashoffset: 125.66;
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.6s ease, stroke 0.6s ease, filter 0.6s ease;
}

.small-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    pointer-events: none;
    transition: color 0.6s ease;
}

/* ==========================================
   Accordion & Subtasks Checklist
   ========================================== */
.accordion-row {
    background-color: rgba(11, 15, 25, 0.2);
}

.accordion-content {
    padding: 1.25rem 2rem 1.5rem 3.5rem;
    border-bottom: 1px solid var(--border-color);
}

.subtasks-container {
    background: rgba(21, 28, 44, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 0.5rem;
}

.subtasks-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subtask-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.subtask-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.subtask-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.subtask-item.completed {
    opacity: 0.65;
}

.subtask-checkbox-wrapper {
    margin-top: 0.15rem;
}

.subtask-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    background: transparent;
}

.subtask-checkbox:hover {
    border-color: var(--primary);
}

.subtask-checkbox.checked {
    background-color: #22c55e;
    border-color: #22c55e;
    color: white;
}

.subtask-checkbox.checked i {
    font-size: 0.65rem;
}

.subtask-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.subtask-title {
    font-size: 0.92rem;
    font-weight: 550;
    color: var(--text-primary);
}

.subtask-item.completed .subtask-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.subtask-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.subtask-solution {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    border-left: 2px solid var(--primary);
    margin-top: 0.25rem;
    white-space: pre-wrap;
}

/* ==========================================
   Sub Tasks Manager in Modal
   ========================================== */
.modal-subtasks-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    margin-top: 1.25rem;
}

.modal-subtasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-subtask-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.modal-subtask-grid-top {
    display: grid;
    grid-template-columns: 1fr 120px 40px;
    gap: 0.75rem;
    align-items: center;
}

.modal-subtask-grid-bottom {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.btn-remove-subtask {
    background: transparent;
    border: none;
    color: var(--danger-text);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-remove-subtask:hover {
    color: var(--danger);
}

.personal-badge {
    border-color: rgba(34, 197, 94, 0.2);
    background-color: rgba(34, 197, 94, 0.05);
    color: #4ade80;
}

.team-badge {
    border-color: rgba(168, 85, 247, 0.2);
    background-color: rgba(168, 85, 247, 0.05);
    color: #c084fc;
}

/* ==========================================
   Calendar Day Grid & 15-Minute Scheduler View
   ========================================== */

.calendar-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.calendar-summary-bar .summary-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #a5b4fc;
}

.calendar-summary-bar .summary-count {
    color: var(--text-primary);
    margin-left: 0.25rem;
}

.calendar-summary-bar .summary-percentage {
    font-size: 0.9rem;
    font-weight: 700;
    color: #818cf8;
}

.calendar-day-header h4 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.calendar-day-header .day-progress {
    font-size: 0.9rem;
    font-weight: 550;
    color: var(--text-secondary);
}

.calendar-day-header .day-progress::before {
    content: '— ';
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.calendar-days-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.calendar-day-container {
    background: rgba(21, 28, 44, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.calendar-day-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.calendar-day-header h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: capitalize;
}

/* All Day Section styling matching screenshot */
.calendar-all-day-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
}

.all-day-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    width: 60px;
    text-align: right;
    text-transform: lowercase;
}

.all-day-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
}

.all-day-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    /* Default badge style (greenish) */
    background-color: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #4ade80;
}

.all-day-pill.completed {
    opacity: 0.6;
    text-decoration: line-through;
}

/* Scrollable Scheduler grid */
.calendar-grid-body {
    max-height: 520px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    background: rgba(11, 15, 25, 0.4);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    scroll-behavior: smooth;
}

.calendar-time-row {
    display: flex;
    min-height: 44px;
    align-items: stretch;
}

.calendar-time-row.hour-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.calendar-time-row.quarter-row {
    border-bottom: 1px dashed rgba(255, 255, 255, 0.015);
}

/* Time Label Left Column */
.calendar-time-label {
    width: 90px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-right: 1.25rem;
    font-weight: 500;
    user-select: none;
    margin-top: -0.45rem;
}

.calendar-time-label.hour-label {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 700;
}

.calendar-time-label.quarter-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Grid Cell Right Column */
.calendar-grid-cell {
    flex: 1;
    display: flex;
    align-items: stretch;
    position: relative;
    padding: 0;
}

.calendar-grid-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
    z-index: 1;
}

.calendar-grid-cell:after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.05);
}

.calendar-cell-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Eye-soothing Highlight Task Pill & Multi-slot merging */
.calendar-task-pill {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border-radius: 0;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    width: 100%;
    background: rgba(168, 85, 247, 0.15);
    border-left: 4px solid #a855f7;
    color: #e9d5ff;
    box-shadow: 0 2px 6px rgba(168, 85, 247, 0.1);
    transition: all 0.2s ease;
    user-select: none;
    height: 100%;
    min-height: 44px;
    box-sizing: border-box;
}

.calendar-task-pill:hover {
    background: rgba(168, 85, 247, 0.25);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
}

.calendar-task-pill.completed {
    background: rgba(34, 197, 94, 0.08);
    border-left-color: #22c55e;
    color: #a7f3d0;
    opacity: 0.75;
}

/* Merging adjacent slots visually to fill duration */
.calendar-task-pill.pill-single {
    border-radius: 4px;
}

.calendar-task-pill.pill-start {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}

.calendar-task-pill.pill-middle {
    border-radius: 0;
    border-top: none;
    border-bottom: none;
}

.calendar-task-pill.pill-end {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
}

/* Status checkbox inside calendar tasks */
.calendar-task-pill .task-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    background: transparent;
}

.calendar-task-pill .task-checkbox:hover {
    border-color: #e9d5ff;
    box-shadow: 0 0 4px rgba(168, 85, 247, 0.3);
}

.calendar-task-pill .task-checkbox.checked {
    background-color: #22c55e;
    border-color: #22c55e;
    color: white;
}

.task-pill-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.5rem;
}

.calendar-task-pill.completed .task-pill-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-pill-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

.task-pill-continuation {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.task-pill-time-subtle {
    font-size: 1.2rem;
    color: rgba(168, 85, 247, 0.25);
    line-height: 1;
}

/* Custom Delete Confirmation Modal */
.delete-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 15, 25, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.delete-confirm-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.delete-confirm-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 420px;
    padding: 2.25rem 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(239, 68, 68, 0.05);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.delete-confirm-overlay.show .delete-confirm-card {
    transform: translateY(0) scale(1);
}

.delete-confirm-icon-wrapper {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.05));
    border: 1.5px solid rgba(239, 68, 68, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.75rem;
    color: var(--danger-text);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
    animation: pulse-danger 2s infinite ease-in-out;
}

@keyframes pulse-danger {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
        border-color: rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 25px rgba(239, 68, 68, 0.3);
        border-color: rgba(239, 68, 68, 0.7);
    }
}

.delete-confirm-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.delete-confirm-message {
    font-size: 0.925rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.75rem;
}

.delete-confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.delete-confirm-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
}

.delete-confirm-btn.cancel {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.delete-confirm-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.delete-confirm-btn.danger {
    background: var(--danger);
    color: #ffffff;
}

.delete-confirm-btn.danger:hover {
    background: #dc2626;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

.delete-confirm-btn.danger:active {
    transform: translateY(0);
}

/* Responsive Overrides for Mobile & Tablet (<= 768px) */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        margin-bottom: 1.5rem !important;
    }

    .dashboard-grid .stat-card {
        padding: 1rem 0.75rem !important;
    }

    .dashboard-grid .stat-title {
        font-size: 0.75rem !important;
    }

    .dashboard-grid .stat-value {
        font-size: 1.6rem !important;
    }


    .site-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1.25rem !important;
    }

    .site-actions {
        width: 100% !important;
        align-items: stretch !important;
        min-width: 0 !important;
    }

    .container {
        padding: 1rem 0.75rem !important;
    }

    .section-title {
        font-size: 14px;
    }
}

/* Responsiveness overrides for customers.php accounts page */

.cost-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.receipts-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    text-align: center;
}

.log-payment-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.followup-overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    text-align: center;
}

.milestone-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.project-info-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Tablet, iPad & Landscape Responsive Logic (<= 1024px) */
@media (max-width: 1024px) {
    .section-layout {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .left-col,
    .right-col {
        display: contents;
    }

    /* Reordering elements via display: contents and flex order */
    .section-card {
        min-width: 0;
        width: 100%;
    }

    .receipts-card {
        order: 1;
    }

    .directory-card {
        order: 2;
        min-width: 0;
        width: 100%;
        overflow: hidden;
    }

    .details-card,
    .no-customer-card {
        order: 3;
    }

    .costs-form {
        order: 4;
        width: 100%;
    }

    .followups-card {
        order: 5;
    }

    .cost-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .receipts-overview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .log-payment-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .milestone-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile & Portrait Responsive Logic (<= 768px) */
@media (max-width: 768px) {
    .timeline-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        width: 100%;
    }

    .timeline-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.5rem;
        margin-top: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-color);
    }

    .timeline-actions-main {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .timeline-actions-main .btn-primary,
    .timeline-actions-main .badge {
        flex: 1;
        justify-content: center;
        padding: 0.5rem;
    }

    .timeline-actions-secondary {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .timeline-actions-secondary button,
    .timeline-actions-secondary a {
        flex: 1;
        justify-content: center;
        padding: 0.5rem;
    }

    .details-header button,
    .project-info-row a {
        width: 100%;
        justify-content: center;
    }

    .desktop-delete-btn {
        display: none !important;
    }

    .mobile-delete-btn {
        display: inline-flex !important;
        width: 100%;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
    }

    .followup-overview-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Extra Small Screens (<= 576px) */
@media (max-width: 576px) {
    .cost-grid {
        grid-template-columns: 1fr;
    }

    .receipts-overview-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .log-payment-grid {
        grid-template-columns: 1fr;
    }

    .milestone-form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .modal-subtask-grid-top {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding-right: 2.2rem;
    }

    .modal-subtask-grid-top div:last-child {
        position: absolute;
        right: 0.75rem;
        top: 0.75rem;
        height: 38px;
    }

    .modal-subtask-grid-bottom {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* ==========================================
   Responsive Overrides for Calendar & Task Modal
   ========================================== */

/* Tablet & iPad Portrait + Mobile Viewports (<= 768px) */
@media (max-width: 768px) {
    .calendar-grid-body {
        overflow-x: hidden;
    }

    .calendar-time-row {
        min-width: 0 !important;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .modal-subtask-grid-top {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding-right: 2.2rem;
    }

    .modal-subtask-grid-top div:last-child {
        position: absolute;
        right: 0.75rem;
        top: 0.75rem;
        height: 38px;
    }

    .modal-subtask-grid-bottom {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}



/* Mobile Portrait & Extra Small Screens (<= 576px) */
@media (max-width: 576px) {



    .calendar-summary-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .calendar-summary-bar .summary-text {
        width: 100%;
    }

    .calendar-day-header h4 {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .calendar-day-header .day-progress::before {
        content: '';
        margin-right: 0;
    }

    .modal-overlay {
        padding: 1.5rem 0.5rem !important;
    }

    .modal-card {
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 85vh;
        border-radius: var(--radius-md) !important;
    }

    .modal-card form {
        padding: 1.25rem 1rem !important;
    }

    .modal-header {
        padding: 1rem 1.25rem !important;
    }

    .modal-subtask-row {
        padding: 0.5rem;
    }

    .modal-subtask-grid-top {
        padding-right: 1.8rem;
    }

    .modal-subtask-grid-top div:last-child {
        right: 0.5rem;
        top: 0.5rem;
    }

    .modal-footer {
        flex-direction: column-reverse !important;
        gap: 0.5rem;
    }

    .modal-footer button,
    .modal-footer a,
    .modal-footer .btn {
        width: 100% !important;
        justify-content: center;
    }
}

/* Custom Native Date & Time Selector Styles */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
    position: relative !important;
    overflow: hidden !important;
    max-width: 80% !important;
}

input[type="date"],
input[type="datetime-local"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5m-9-6h.008v.008H12v-.008zM12 15h.008v.008H12V15zm0 2.25h.008v.008H12v-.008zM9.75 15h.008v.008H9.75V15zm0 2.25h.008v.008H9.75v-.008zM7.5 15h.008v.008H7.5V15zm0 2.25h.008v.008H7.5v-.008zm6.75-4.5h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V15zm0 2.25h.008v.008h-.008v-.008zm2.25-4.5h.008v.008H16.5v-.008zm0 2.25h.008v.008H16.5V15z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 18px 18px !important;
    padding-right: 38px !important;
}

input[type="time"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 18px 18px !important;
    padding-right: 38px !important;
}

/* Hide webkit default icon and span it over the entire input for tap-anywhere triggers */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    cursor: pointer !important;
}

/* Floating Back to Top Button Styling */
.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    border: none;
    color: #ffffff;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
}

.back-to-top-btn:active {
    transform: translateY(-1px);
}

/* ==========================================================================
   Flatpickr Custom Dark Theme Styles
   ========================================================================== */

/* Flatpickr input elements formatting */
.flatpickr-date-input,
.flatpickr-time-input {
    background-color: rgba(11, 15, 25, 0.5) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-main) !important;
    padding: 0.75rem 1rem !important;
    border-radius: var(--radius-sm) !important;
    outline: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
}

.flatpickr-date-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5m-9-6h.008v.008H12v-.008zM12 15h.008v.008H12V15zm0 2.25h.008v.008H12v-.008zM9.75 15h.008v.008H9.75V15zm0 2.25h.008v.008H9.75v-.008zM7.5 15h.008v.008H7.5V15zm0 2.25h.008v.008H7.5v-.008zm6.75-4.5h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V15zm0 2.25h.008v.008h-.008v-.008zm2.25-4.5h.008v.008H16.5v-.008zm0 2.25h.008v.008H16.5V15z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 18px 18px !important;
    padding-right: 38px !important;
}

.flatpickr-time-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 18px 18px !important;
    padding-right: 38px !important;
}

/* The actual calendar popup box */
.flatpickr-calendar {
    background: #151c2c !important;
    /* matches --bg-secondary */
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), var(--shadow-glass) !important;
    border-radius: var(--radius-md) !important;
    font-family: var(--font-main) !important;
    color: var(--text-primary) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.flatpickr-calendar.arrowTop:before,
.flatpickr-calendar.arrowTop:after {
    border-bottom-color: #151c2c !important;
}

.flatpickr-calendar.arrowBottom:before,
.flatpickr-calendar.arrowBottom:after {
    border-top-color: #151c2c !important;
}

/* Header (month, year selection) */
.flatpickr-months {
    padding: 0.5rem 0 !important;
}

.flatpickr-months .flatpickr-month {
    color: var(--text-primary) !important;
    fill: var(--text-primary) !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: var(--text-secondary) !important;
    fill: var(--text-secondary) !important;
    padding: 10px !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    top: 10px !important;
}


.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    color: var(--primary) !important;
    fill: var(--primary) !important;
}

.flatpickr-monthDropdown-months,
.numInputWrapper span {
    color: var(--text-primary) !important;
}

.flatpickr-monthDropdown-months option {
    background-color: #151c2c !important;
    color: var(--text-primary) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowUp:after {
    border-bottom-color: var(--text-secondary) !important;
}

.flatpickr-current-month .numInputWrapper span.arrowDown:after {
    border-top-color: var(--text-secondary) !important;
}

/* Weekdays */
span.flatpickr-weekday {
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
}

/* Days container */
.flatpickr-day {
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    transition: all 0.15s ease;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover,
.flatpickr-day.notHandled,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--text-muted) !important;
    background: transparent !important;
    border-color: transparent !important;
}

.flatpickr-day.today {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.flatpickr-day.today:hover {
    background: var(--primary-light) !important;
    color: var(--text-primary) !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}

.flatpickr-day.inRange,
.flatpickr-day.prevMonthDay.inRange,
.flatpickr-day.nextMonthDay.inRange,
.flatpickr-day.today.inRange,
.flatpickr-day.prevMonthDay.today.inRange,
.flatpickr-day.nextMonthDay.today.inRange,
.flatpickr-day:hover,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover,
.flatpickr-day:focus,
.flatpickr-day.prevMonthDay:focus,
.flatpickr-day.nextMonthDay:focus {
    background: rgba(79, 70, 229, 0.15) !important;
    border-color: transparent !important;
    color: var(--text-primary) !important;
}

/* Time Picker styling */
.flatpickr-time {
    border-top: 1px solid var(--border-color) !important;
    background: transparent !important;
}

.flatpickr-time input {
    color: var(--text-primary) !important;
}

.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:focus {
    background: rgba(255, 255, 255, 0.05) !important;
}

.flatpickr-time .numInputWrapper span.arrowUp:after {
    border-bottom-color: var(--text-secondary) !important;
}

.flatpickr-time .numInputWrapper span.arrowDown:after {
    border-top-color: var(--text-secondary) !important;
}

.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
    color: var(--text-primary) !important;
}

/* ==========================================================================
   PAYROLL & LABOR MANAGEMENT STYLES
   ========================================================================== */

.payroll-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.payroll-stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--blur-glass));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.payroll-stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.3);
}

.payroll-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.payroll-stat-icon.primary {
    background: rgba(79, 70, 229, 0.15);
    color: #818cf8;
}

.payroll-stat-icon.success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.payroll-stat-icon.warning {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
}

.payroll-stat-icon.info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.payroll-stat-details h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.payroll-stat-details .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.payroll-tabs {
    display: flex;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.75rem;
    overflow-x: auto;
    padding-bottom: 2px;
}

.payroll-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    text-decoration: none;
}

.payroll-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.payroll-tab-btn.active {
    color: #818cf8;
    border-bottom-color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Attendance toggle group */
.att-btn-group {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: var(--radius-sm);
    gap: 4px;
    border: 1px solid var(--border-color);
}

.att-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.att-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.att-btn.active.full_day {
    background: rgba(34, 197, 94, 0.25);
    color: #4ade80;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.att-btn.active.half_day {
    background: rgba(234, 179, 8, 0.25);
    color: #facc15;
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
}

.att-btn.active.absent {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.badge-type {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-type.employee {
    background: rgba(79, 70, 229, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-type.individual_labor {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-pay {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ==========================================================================
   Pop-up Toast Notification System
   ========================================================================== */
.delete-toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.delete-toast-card {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: rgba(18, 24, 38, 0.95);
    border: 1px solid rgba(239, 68, 68, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(239, 68, 68, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-md, 12px);
    color: #ffffff;
    min-width: 320px;
    max-width: 440px;
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.delete-toast-card.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.delete-toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.delete-toast-body {
    flex: 1;
    min-width: 0;
}

.delete-toast-title {
    font-size: 0.925rem;
    font-weight: 600;
    color: #fca5a5;
    margin: 0 0 2px 0;
}

.delete-toast-msg {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    word-break: break-word;
    line-height: 1.35;
}

.delete-toast-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    margin-left: 0.5rem;
}

.delete-toast-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.delete-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #ef4444, #f87171);
    width: 100%;
}

/* ==========================================================================
   Custom Month & Date Picker Input Styling
   ========================================================================== */
input[type="month"],
input[type="date"] {
    color-scheme: dark;
    accent-color: #6366f1;
}

.month-picker-input,
input[type="month"].styled-month-input,
input[type="date"].styled-date-input {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.85)) !important;
    border: 1px solid rgba(99, 102, 241, 0.35) !important;
    color: #f8fafc !important;
    padding: 0.55rem 1rem 0.55rem 0.9rem !important;
    border-radius: var(--radius-sm, 8px) !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    outline: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    font-family: inherit !important;
}

.month-picker-input:hover,
input[type="month"].styled-month-input:hover,
input[type="date"].styled-date-input:hover {
    border-color: #818cf8 !important;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95)) !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    transform: translateY(-1px);
}

.month-picker-input:focus,
input[type="month"].styled-month-input:focus,
input[type="date"].styled-date-input:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35), 0 8px 25px rgba(0, 0, 0, 0.4) !important;
}

/* Custom Webkit Calendar Indicator Styling */
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(0.85) sepia(100%) hue-rotate(190deg) saturate(200%);
    opacity: 0.85;
    padding: 2px;
    border-radius: 4px;
    transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

input[type="month"]::-webkit-calendar-picker-indicator:hover,
input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    transform: scale(1.18);
    filter: invert(1) drop-shadow(0 0 6px rgba(99, 102, 241, 0.8));
}

/* Payroll Month Filter Form Group */
.payroll-month-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(15, 23, 42, 0.5);
    padding: 0.4rem 0.85rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.payroll-month-label {
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.payroll-month-label i {
    color: #818cf8;
    font-size: 1rem;
}

/* Section Header Badges in Summary */
.payroll-section-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #818cf8;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    padding-bottom: 0.75rem;
}

.payroll-section-header.warning-theme {
    color: #facc15;
}

.payroll-section-header .section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    font-size: 0.9rem;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.payroll-section-header.warning-theme .section-icon {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.25);
}

/* Table Enhancements */
.payroll-summary-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.payroll-summary-table thead th {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.85rem 1rem;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.payroll-summary-table tbody tr {
    transition: background 0.15s ease, transform 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.payroll-summary-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.payroll-summary-table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

/* ==========================================================================
   Custom Glassmorphism Month Picker Popup & Popover Enhancements
   ========================================================================== */
.custom-month-picker-popup {
    position: absolute;
    z-index: 10000;
    width: 320px;
    background: linear-gradient(165deg, rgba(30, 41, 59, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 30px rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 1.15rem;
    color: #f8fafc;
    font-family: inherit;
    animation: monthPickerFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

@keyframes monthPickerFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header & Year Selector */
.month-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.month-picker-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.month-picker-title i {
    color: #818cf8;
    font-size: 1rem;
}

.month-year-selector {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.2rem 0.4rem;
}

.month-year-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.month-year-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #ffffff;
}

.month-year-display {
    font-weight: 700;
    font-size: 0.95rem;
    color: #818cf8;
    min-width: 48px;
    text-align: center;
}

/* 12 Month Grid Layout */
.month-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.55rem;
    margin-bottom: 0.85rem;
}

.month-picker-cell {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 0.65rem 0.25rem;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 600;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.month-picker-cell:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.month-picker-cell.active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    border-color: #818cf8 !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.5);
}

.month-picker-cell.is-today {
    border-color: rgba(245, 158, 11, 0.6);
}

.month-picker-cell.is-today::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f59e0b;
}

.month-picker-cell.active.is-today::after {
    background: #ffffff;
}

/* Footer Actions */
.month-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.month-picker-quick-btn {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #818cf8;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.month-picker-quick-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #ffffff;
    border-color: #6366f1;
}

.month-picker-close-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.month-picker-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

/* Payroll & Vendor Header Action Buttons Sizing & iPad / Tablet Responsive Support */
.payroll-header-actions,
.vendor-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    flex-wrap: wrap;
}

.payroll-header-actions .payroll-header-btn,
.payroll-header-actions .btn,
.vendor-header-actions .vendor-header-btn,
.vendor-header-actions .btn-primary,
.vendor-header-actions .btn-secondary {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    text-align: center !important;
}

.payroll-header-btn {
    padding: 0.75rem 1.25rem !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    border-radius: var(--radius-sm) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    min-height: 44px !important;
    line-height: 1.2 !important;
}

.vendor-header-btn {
    padding: 0.35rem 0.75rem !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    border-radius: var(--radius-sm) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4rem !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    line-height: 1.2 !important;
}

.btn-danger-advance {
    background: #d87171 !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.3) !important;
    transition: background 0.2s ease, transform 0.1s ease !important;
}

.btn-danger-advance:hover {
    background: #c85a5a !important;
}

.btn-danger-advance:active {
    transform: scale(0.98);
}

/* Purchase Orders Summary Cards Grid */
.po-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {

    .payroll-stats-grid,
    .po-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
    }

    .payroll-header-actions,
    .vendor-header-actions {
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 0.75rem;
    }

    .payroll-header-actions .btn,
    .payroll-btn-full-mobile,
    .payroll-header-btn,
    .vendor-header-actions .btn-primary,
    .vendor-header-actions .btn-secondary,
    .vendor-header-actions .vendor-header-btn {
        flex: 1 1 0% !important;
        min-width: 0 !important;
        width: auto !important;
        text-align: center !important;
        justify-content: center !important;
        display: inline-flex !important;
        align-items: center !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 768px) {
    .po-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }

    .po-fulfillment-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.25rem !important;
    }

    .po-fulfillment-title,
    .po-fulfillment-details {
        width: 100% !important;
        display: block !important;
    }
}

@media (max-width: 640px) {
    .payroll-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.6rem !important;
    }

    .payroll-stat-card {
        padding: 0.85rem 0.7rem !important;
        gap: 0.6rem !important;
    }

    .payroll-stat-icon {
        width: 38px !important;
        height: 38px !important;
        font-size: 1.1rem !important;
        border-radius: 8px !important;
    }

    .payroll-stat-details h3 {
        font-size: 0.72rem !important;
        margin-bottom: 0.2rem !important;
        letter-spacing: 0px !important;
    }

    .payroll-stat-details .stat-value {
        font-size: 1.05rem !important;
    }

    .po-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }

    .po-stats-grid .card {
        padding: 0.75rem 0.6rem !important;
        gap: 0.5rem !important;
    }

    .po-stats-grid .card>div:first-child {
        width: 36px !important;
        height: 36px !important;
        font-size: 1.1rem !important;
        border-radius: 8px !important;
    }

    .po-stats-grid .card>div:nth-child(2)>div:first-child {
        font-size: 0.78rem !important;
    }

    .po-stats-grid .card>div:nth-child(2)>div:nth-child(2) {
        font-size: 0.9rem !important;
    }

    .po-stats-grid .card>div:nth-child(2)>div:nth-child(3) {
        font-size: 0.7rem !important;
    }

    .payroll-header-actions,
    .vendor-header-actions {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        width: 100% !important;
        align-items: stretch !important;
    }

    .payroll-header-actions .btn,
    .payroll-header-actions .payroll-btn-full-mobile,
    .payroll-header-actions .payroll-header-btn,
    .vendor-header-actions .btn-primary,
    .vendor-header-actions .btn-secondary,
    .vendor-header-actions .vendor-header-btn {
        flex: 1 1 0% !important;
        min-width: 0 !important;
        width: auto !important;
        padding: 0.65rem 0.35rem !important;
        font-size: 0.78rem !important;
        text-align: center !important;
        justify-content: center !important;
        display: inline-flex !important;
        align-items: center !important;
        white-space: normal !important;
        line-height: 1.2 !important;
    }

    .payroll-btn-full-mobile:not(.payroll-header-actions *) {
        width: 100% !important;
        flex: none !important;
    }

    .custom-date-inputs {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        width: 100%;
    }

    .custom-date-range-row {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        width: 100%;
        flex-wrap: nowrap;
    }

    .custom-date-range-row .date-input {
        flex: 1 1 0%;
        min-width: 0;
        width: 100% !important;
        max-width: none !important;
        padding: 0.6rem 0.4rem;
        font-size: 0.82rem;
    }

    .custom-date-range-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
    }

    .custom-date-range-actions .btn-primary,
    .custom-date-range-actions .btn-secondary,
    .custom-date-range-actions .btn-primary-sm,
    .custom-date-range-actions .btn-secondary-sm {
        flex: 1;
        width: 100%;
        justify-content: center;
    }

    .payroll-modal-grid {
        grid-template-columns: 1fr !important;
    }

    #poItemsTable {
        min-width: 680px !important;
        border-collapse: separate !important;
        border-spacing: 0.6rem 0.35rem !important;
    }

    #poDetailsContent {
        padding: 0.85rem !important;
    }

    .payroll-modal-grid .flatpickr-date,
    .payroll-modal-overlay .flatpickr-date,
    #addPaymentModal .flatpickr-date,
    #addStageModal .flatpickr-date {
        width: 83% !important;
    }
}

/* Responsive Truck Delivery Logs Table for Mobile, iPad & Tablet */
.truck-delivery-card {
    padding: 0 !important;
    overflow-x: auto !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

.truck-delivery-table {
    width: 100% !important;
    min-width: 1050px !important;
    border-collapse: collapse !important;
    table-layout: auto !important;
    text-align: left;
}

.truck-delivery-table th {
    padding: 0.95rem 1.25rem !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom: 1px solid var(--border-color) !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--text-muted) !important;
    vertical-align: middle !important;
}

.truck-delivery-table td {
    padding: 0.95rem 1.25rem !important;
    border-bottom: 1px solid var(--border-color) !important;
    vertical-align: middle !important;
    font-size: 0.9rem !important;
    color: var(--text-primary) !important;
}

.truck-delivery-table tr:hover td {
    background: rgba(255, 255, 255, 0.02) !important;
}

.truck-delivery-table tr:last-child td {
    border-bottom: none !important;
}

/* Specific column min-widths & spacing rules */
.truck-delivery-table .col-del-date {
    width: 12%;
    min-width: 135px !important;
    white-space: nowrap !important;
    font-weight: 600;
}

.truck-delivery-table .col-del-site {
    width: 17%;
    min-width: 175px !important;
}

.truck-delivery-table .col-del-material {
    width: 17%;
    min-width: 175px !important;
    font-weight: 600;
}

.truck-delivery-table .col-del-truck {
    width: 14%;
    min-width: 145px !important;
    white-space: nowrap !important;
}

.truck-delivery-table .col-del-qty {
    width: 13%;
    min-width: 135px !important;
    white-space: nowrap !important;
    font-weight: 700;
    color: #4ade80;
}

.truck-delivery-table .col-del-supervisor {
    width: 13%;
    min-width: 135px !important;
    color: var(--text-secondary);
}

.truck-delivery-table .col-del-po {
    width: 17%;
    min-width: 180px !important;
}

.truck-delivery-table .col-del-actions {
    width: 7%;
    min-width: 100px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

/* Responsive optimizations for iPad, Tablet & Mobile devices */
@media (max-width: 1024px) {

    .truck-delivery-table th,
    .truck-delivery-table td {
        padding: 0.85rem 1.15rem !important;
    }
}

@media (max-width: 768px) {

    .truck-delivery-table th,
    .truck-delivery-table td {
        padding: 0.8rem 1rem !important;
    }

    .modal-backdrop {
        padding: 0.5rem !important;
    }

    .modal-content,
    .delivery-modal-content {
        width: 95% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 640px) {
    .modal-backdrop {
        width: 100% !important;
        max-width: 100vw !important;
        padding: 0.5rem !important;
        overflow-x: hidden !important;
    }

    .modal-content {
        width: 96% !important;
        max-width: 100% !important;
        max-height: 90vh !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }

    /* Edit/Log Truck Delivery Modal: Compact modal size on mobile without shrinking font sizes */
    .delivery-modal-content {
        width: 92% !important;
        max-width: 410px !important;
        max-height: 82vh !important;
        margin: 0 auto !important;
        border-radius: 14px !important;
        box-sizing: border-box !important;
    }

    .delivery-modal-content .form-label {
        font-size: 0.95rem !important;
        font-weight: 600 !important;
    }

    .delivery-modal-content .form-control {
        font-size: 1rem !important;
        padding: 0.65rem 0.85rem !important;
    }

    .delivery-modal-content .modal-header h3 {
        font-size: 1.1rem !important;
    }

    .delivery-modal-content .modal-body-container {
        padding: 1rem 0.95rem !important;
        overflow-x: hidden !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .delivery-modal-content .modal-form-grid,
    .delivery-modal-content .modal-form-grid-3 {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .delivery-modal-content .modal-header {
        padding: 0.9rem 1rem !important;
    }

    .delivery-modal-content .modal-footer {
        padding: 0.85rem 1rem !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
    }

    .delivery-modal-content .modal-footer .btn-secondary,
    .delivery-modal-content .modal-footer .btn-primary {
        flex: 1 1 auto;
        justify-content: center;
        font-size: 0.95rem !important;
        padding: 0.65rem 0.85rem !important;
    }
}

/* Vendor Payment Top Summary Cards Responsiveness */
@media (max-width: 1024px) {

    .vendor-container .metrics-grid,
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
}

@media (max-width: 767px) {

    .vendor-container .metrics-grid,
    .metrics-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
}

/* Quick Selection Badges in Vendor Payment Modals */
.quick-badge-btn {
    border-radius: 6px;
    background: transparent;
    padding: 5px 10px;
    border: 1px solid #383c46;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-color, inherit);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.quick-badge-btn:hover {
    background: rgba(79, 70, 229, 0.08);
    border-color: #4f46e5;
}

/* Contract Info Summary Banner in Stage Log Modals */
.contract-info-banner {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
}

.contract-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.contract-info-item label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.contract-info-item span {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* Vendor Payment & Stage Log Modal Mobile Field Stacking & Overflow Prevention */
html,
body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
}

.container,
.main-content,
.modal-backdrop {
    max-width: 100vw !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

.modal-content {
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.modal-body {
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    word-break: break-word !important;
}

select.form-control,
input.form-control,
textarea.form-control,
.form-control {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
}

select option {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

@media (max-width: 768px) {
    .modal-form-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .contract-info-banner {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .contract-info-item,
    .contract-info-banner>div,
    .contract-info-item[style*="grid-column"] {
        grid-column: auto !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .vendor-card-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }

    .vendor-card-actions {
        width: 100% !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
    }

    .vendor-card-actions .btn-secondary,
    .vendor-card-actions .btn-danger,
    .vendor-card-actions form {
        /* flex: 1 1 auto !important; */
        text-align: center !important;
        justify-content: center !important;
        display: inline-flex !important;
    }

    #filterForm div[style*="width: 180px"] {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ==========================================================================
   PROJECT MANAGEMENT PAGE STYLES
   ========================================================================== */
.pm-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    backdrop-filter: blur(var(--blur-glass));
    position: relative;
    z-index: 100;
}

.pm-project-select-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    white-space: nowrap;
    position: relative;
    z-index: 101;
    max-width: 100%;
}

.pm-select-label {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    margin: 0;
    flex-shrink: 0;
}

.pm-project-dropdown,
.pm-project-select-wrapper .custom-select-wrapper {
    width: 280px !important;
    min-width: 200px;
    max-width: 100%;
    font-size: 0.9rem;
    margin: 0;
    flex-shrink: 0;
    box-sizing: border-box;
}

.pm-top-bar .btn {
    width: auto;
}

/* Button Variants */
.btn-danger, .btn-delete-project {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff !important;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
    white-space: nowrap;
    text-decoration: none;
}

.btn-danger:hover, .btn-delete-project:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.45);
    transform: translateY(-1px);
    color: #ffffff !important;
}

.btn-danger:active, .btn-delete-project:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.2);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.1);
}

/* Hero Header Card */
.pm-hero-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.pm-hero-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.18) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

.pm-building-icon-box {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.pm-project-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
    word-break: break-word;
}

.pm-project-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.pm-total-cost-badge-container {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 1rem 2.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.pm-total-cost-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #818cf8;
    margin-bottom: 0.25rem;
}

.pm-total-cost-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: #4ade80;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(74, 222, 128, 0.2);
}

/* Accordion Controls Bar */
.pm-accordion-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.pm-accordion-bar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pm-accordion-btn-group {
    display: flex;
    gap: 0.5rem;
}

/* Category Accordion Item */
.pm-accordion-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pm-accordion-item:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

.pm-accordion-item.active {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.15);
}

.pm-accordion-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: rgba(21, 28, 44, 0.6);
    user-select: none;
    transition: background 0.2s ease;
    gap: 1rem;
}

.pm-accordion-header:hover {
    background: rgba(30, 41, 59, 0.8);
}

.pm-accordion-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.pm-cat-number {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(79, 70, 229, 0.15);
    color: #818cf8;
    border: 1px solid rgba(129, 140, 248, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.pm-accordion-item.has-value .pm-cat-number {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.3);
}

.pm-cat-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-accordion-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.pm-cat-cost-badge {
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 700;
    font-size: 0.9rem;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pm-cat-cost-badge.has-amount {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.pm-cat-file-count {
    padding: 0.35rem 0.65rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.pm-cat-chevron {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    font-size: 1rem;
    margin-left: 0.25rem;
}

.pm-accordion-item.active .pm-cat-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

.pm-accordion-body {
    display: none;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.5);
    border-top: 1px solid var(--border-color);
}

.pm-accordion-item.active .pm-accordion-body {
    display: block;
    animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Category Content Styling */
.pm-cat-form-group {
    margin-bottom: 1.25rem;
}

.pm-cat-form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.pm-input-with-currency {
    position: relative;
    display: flex;
    align-items: center;
}

.pm-currency-prefix {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1.1rem;
    pointer-events: none;
}

.pm-input-with-currency input {
    padding-left: 2.2rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #4ade80;
}

.pm-input-with-calendar {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.pm-input-with-calendar input.form-control,
.pm-input-with-calendar input {
    padding-right: 2.6rem !important;
    padding-left: 0.85rem !important;
    width: 100% !important;
    cursor: pointer !important;
}

.pm-input-with-calendar .pm-calendar-icon-btn {
    position: absolute;
    right: 0.85rem;
    color: #818cf8;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: transform 0.2s ease, color 0.2s ease;
    user-select: none;
}

.pm-input-with-calendar .pm-calendar-icon-btn:hover {
    color: #a5b4fc;
    transform: scale(1.18);
}

/* Taxes Dynamic List Styling */
.pm-taxes-table-wrapper {
    background: rgba(21, 28, 44, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin-bottom: 1rem;
}

.pm-taxes-table-wrapper::-webkit-scrollbar {
    height: 6px;
}
.pm-taxes-table-wrapper::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 4px;
}
.pm-taxes-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 4px;
}
.pm-taxes-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.7);
}

.pm-tax-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pm-tax-row:last-child {
    border-bottom: none;
}

.pm-tax-name-input,
.pm-sdeed-name-input,
.pm-mutation-name-input,
.pm-noc-name-input,
.pm-construction-name-input {
    flex: 2;
}

.pm-tax-amount-input {
    flex: 1.5;
}

.pm-tax-remove-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.pm-tax-remove-btn:hover {
    background: #ef4444;
    color: #ffffff;
}

/* File Upload Zone */
.pm-file-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.pm-file-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pm-dropzone {
    border: 2px dashed rgba(99, 102, 241, 0.35);
    background: rgba(15, 23, 42, 0.4);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1.25rem;
}

.pm-dropzone:hover,
.pm-dropzone.dragover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.08);
}

.pm-browse-btn {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.35rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.pm-browse-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.pm-dropzone-icon {
    font-size: 2rem;
    color: #818cf8;
    margin-bottom: 0.5rem;
}

.pm-dropzone-text {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.pm-dropzone-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.pm-file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.85rem;
}

.pm-file-item {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: border-color 0.2s ease, background 0.2s ease;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.pm-file-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(30, 41, 59, 0.8);
}

.pm-file-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(79, 70, 229, 0.2);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.pm-file-icon.pdf {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.pm-file-icon.img {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.pm-file-icon.doc {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.pm-file-info {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.pm-file-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
    word-break: break-all;
}

.pm-file-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.15rem;
}

.pm-file-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    margin-left: auto;
}

.pm-file-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none;
}

.pm-file-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.pm-file-btn.delete {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
}

.pm-file-btn.delete:hover {
    color: #ffffff;
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Empty Project Card */
.pm-empty-card {
    background: var(--bg-card);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 3.5rem 2rem;
    text-align: center;
    max-width: 550px;
    margin: 2rem auto;
}

.pm-empty-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1.25rem;
    opacity: 0.9;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .pm-hero-card {
        padding: 1.75rem 1.25rem;
    }
    .pm-building-icon-box {
        width: 70px;
        height: 70px;
        font-size: 1.9rem;
        margin-bottom: 1rem;
    }
    .pm-project-title {
        font-size: 1.85rem;
    }
    .pm-total-cost-badge-container {
        padding: 0.85rem 1.75rem;
    }
    .pm-total-cost-value {
        font-size: 1.95rem;
    }

    .pm-contractor-tabs {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        gap: 0.4rem;
        padding: 0.35rem;
    }
    .pm-contractor-tabs::-webkit-scrollbar {
        display: none;
    }
    .pm-contractor-tab-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.55rem 1rem;
        font-size: 0.88rem;
    }

    .pm-contractor-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
    }
    .pm-contractor-stat-card.progress-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    input.form-control,
    select.form-control,
    textarea.form-control,
    .pm-cat-form-group input,
    .pm-input-with-currency input,
    .pm-tax-name-input,
    .tax-amount-field {
        font-size: 16px !important;
    }

    .container {
        padding: 1rem 0.75rem !important;
    }

    .pm-top-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 0.85rem;
    }

    .pm-project-select-wrapper {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.4rem !important;
    }

    .pm-project-dropdown,
    .pm-project-select-wrapper .custom-select-wrapper {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .pm-top-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .pm-top-actions .btn {
        width: 100% !important;
        justify-content: center;
        min-height: 42px;
        font-size: 0.88rem;
        padding: 0.6rem 0.8rem;
    }

    .pm-hero-card {
        padding: 1.35rem 0.85rem;
        margin-bottom: 1.25rem;
        border-radius: var(--radius-md);
    }

    .pm-hero-card::before {
        width: 250px;
        height: 250px;
    }

    .pm-building-icon-box {
        width: 58px;
        height: 58px;
        font-size: 1.6rem;
        margin-bottom: 0.75rem;
    }

    .pm-project-title {
        font-size: 1.45rem;
        margin-bottom: 0.25rem;
        line-height: 1.25;
    }

    .pm-project-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .pm-total-cost-badge-container {
        width: 100%;
        max-width: 100%;
        padding: 0.75rem 1rem;
        box-sizing: border-box;
    }

    .pm-total-cost-label {
        font-size: 0.75rem;
        letter-spacing: 1px;
    }

    .pm-total-cost-value {
        font-size: 1.6rem;
    }

    .pm-accordion-bar {
        margin-bottom: 0.85rem;
        gap: 0.5rem;
    }

    .pm-accordion-bar-title {
        font-size: 1.05rem;
    }

    .pm-accordion-bar .btn {
        font-size: 0.82rem;
        padding: 0.4rem 0.75rem;
    }

    .pm-accordion-header {
        padding: 0.95rem 1rem;
        gap: 0.65rem;
        flex-wrap: wrap;
    }

    .pm-accordion-header-left {
        gap: 0.65rem;
        min-width: 0;
        flex: 1 1 auto;
    }

    .pm-cat-number {
        width: 32px;
        height: 32px;
        font-size: 0.82rem;
        border-radius: 8px;
    }

    .pm-cat-title {
        font-size: 1rem;
        white-space: normal;
        line-height: 1.3;
    }

    .pm-accordion-header-right {
        gap: 0.45rem;
        flex-shrink: 0;
    }

    .pm-cat-cost-badge {
        font-size: 0.82rem;
        padding: 0.3rem 0.65rem;
    }

    .pm-cat-file-count {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .pm-accordion-body {
        padding: 1.15rem 0.85rem;
    }

    .pm-contractor-add-panel {
        padding: 1rem;
    }

    .pm-contractor-input-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }

    .pm-contractor-input-row input.form-control {
        min-width: 100%;
        width: 100%;
    }

    .pm-contractor-input-row .btn {
        width: 100%;
        justify-content: center;
        min-height: 42px;
    }

    .pm-contractor-table thead th.sticky-col {
        position: sticky !important;
        left: 0 !important;
        z-index: 12 !important;
        background: #0f172a !important;
        box-shadow: 3px 0 8px rgba(0, 0, 0, 0.45);
    }

    .pm-contractor-table tbody td.sticky-col {
        position: sticky !important;
        left: 0 !important;
        z-index: 8 !important;
        background: #1e293b !important;
        box-shadow: 3px 0 8px rgba(0, 0, 0, 0.45);
    }

    .pm-cell-check-wrap {
        padding: 6px;
        min-width: 38px;
        min-height: 38px;
    }

    .pm-stage-checkbox {
        width: 20px;
        height: 20px;
    }

    .pm-tax-row {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        gap: 0.6rem !important;
        padding: 0.85rem !important;
        background: rgba(15, 23, 42, 0.55);
        border-radius: 6px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        margin-bottom: 0.5rem;
    }

    .pm-tax-row > input[type="text"],
    .pm-tax-name-input,
    .pm-sdeed-name-input,
    .pm-mutation-name-input,
    .pm-noc-name-input,
    .pm-construction-name-input,
    .pm-oc-name-input,
    .pm-rera-name-input,
    .pm-ca-name-input,
    .pm-govt-name-input,
    .pm-misc-name-input {
        grid-column: 1 / -1 !important;
        width: 100% !important;
    }

    .pm-tax-amount-input {
        grid-column: 1 / 2 !important;
        width: 100% !important;
    }

    .pm-tax-remove-btn {
        grid-column: 2 / 3 !important;
        width: 44px !important;
        height: 42px !important;
        min-width: 44px;
        align-self: center;
    }

    .pm-sales-salary-container form div[style*="grid-template-columns"],
    .pm-accordion-body form div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    .pm-sales-salary-container form div[style*="display: flex; gap: 0.75rem;"],
    .pm-accordion-body form div[style*="display: flex; gap: 0.75rem;"] {
        flex-direction: column !important;
        width: 100% !important;
    }

    .pm-sales-salary-container form button,
    .pm-accordion-body form button[type="submit"] {
        width: 100% !important;
        min-height: 42px;
        justify-content: center;
    }

    .pm-dropzone {
        padding: 1.25rem 0.85rem;
    }

    .pm-dropzone-icon {
        font-size: 1.6rem;
    }

    .pm-file-list {
        grid-template-columns: 1fr !important;
        gap: 0.6rem;
    }

    .modal-card {
        width: 95% !important;
        max-width: 480px !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        margin: auto;
        padding: 1.25rem !important;
        box-sizing: border-box;
    }
}

@media (max-width: 540px) {
    .pm-top-actions {
        grid-template-columns: 1fr;
    }

    .pm-accordion-header {
        padding: 0.85rem;
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 0.45rem;
        align-items: center;
    }

    .pm-accordion-header-left {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
        gap: 0.55rem;
    }

    .pm-cat-chevron {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
        justify-self: end;
        align-self: center;
        font-size: 1rem;
        margin: 0;
    }

    .pm-accordion-header-right {
        grid-column: 1 / -1;
        grid-row: 2 / 3;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 0.45rem;
        flex-wrap: wrap;
        padding-top: 0.35rem;
        border-top: 1px dashed rgba(255, 255, 255, 0.08);
    }

    .pm-cat-number {
        width: 30px;
        height: 30px;
        font-size: 0.78rem;
    }

    .pm-cat-title {
        font-size: 0.94rem;
        line-height: 1.25;
    }

    .pm-cat-cost-badge {
        font-size: 0.8rem;
        padding: 0.25rem 0.6rem;
    }

    .pm-cat-file-count {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .pm-contractor-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem;
    }

    .pm-contractor-stat-card {
        padding: 0.65rem 0.75rem;
        gap: 0.55rem;
    }

    .pm-contractor-stat-card .stat-icon-wrap {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    .pm-contractor-stat-card .stat-title {
        font-size: 0.7rem;
    }

    .pm-contractor-stat-card .stat-number {
        font-size: 1.1rem;
    }

    .pm-outdoor-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .pm-outdoor-card-title {
        font-size: 0.95rem;
        flex-wrap: wrap;
    }
}