.header-bar {
    background: repeating-linear-gradient(
        45deg,
        #2c2c2c,     /* dark gray stripe */
        #2c2c2c 10px,
        #3a3a3a 10px,
        #3a3a3a 20px  /* slightly lighter stripe */
    );
    color: #f8f8f8;             /* light text */
    padding: 12px 20px;
    font-family: sans-serif;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 0.5rem;
}

.action-button {
    color: var(--background-color); /* Typically black */
    background-color: var(--secondary-color); /* Bold yellow */
    padding: var(--standard-pad);
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    text-align: center;
    border: none;
    letter-spacing: 0.5px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(255, 255, 0, 0.2);
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    user-select: none;
}

.action-button:hover {
    background-color: var(--secondary-hover-color); /* Slightly darker yellow */
    box-shadow: 0 0 10px rgba(255, 221, 0, 0.5);
    transform: translateY(-1px);
}

.action-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(255, 255, 0, 0.2);
}

.action-button:disabled {
    background-color: #555;
    color: #aaa;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}


.account-button {
    color: white;
    background-color: black;
    padding: var(--standard-pad);
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    text-align: center;
    border: none;
    letter-spacing: 0.5px;
    border-radius: 4px;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    user-select: none;
}

.account-button:hover {
    transform: translateY(-1px);
}

.account-button:active {
    transform: translateY(0);
}

.account-button:disabled {
    background-color: #555;
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.6;
}


.emergency-button {
    color: var(--background-color); /* Typically black or white depending on your background */
    background-color: #cc0000; /* Bold red */
    padding: var(--standard-pad);
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    text-align: center;
    border: none;
    letter-spacing: 0.5px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(204, 0, 0, 0.4);
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.emergency-button:hover {
    background-color: #a30000; /* Darker red */
    box-shadow: 0 0 10px rgba(163, 0, 0, 0.7);
    transform: translateY(-1px);
}

.emergency-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(204, 0, 0, 0.2);
}

.emergency-button:disabled {
    background-color: #555;
    color: #aaa;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}


.emergency-toggle-container {
    display: inline-block;
    margin-bottom: 1em;
    user-select: none;
}

.emergency-toggle {
    position: relative;
    display: inline-block;
    height: 100%;
    padding-left: 2em;
    padding-right: 2em;
    cursor: pointer;
    perspective: 600px;
    vertical-align: middle;
}

.emergency-toggle input {
    display: none;
}

/* The flip cover (the red safety cover) */
.cover {
    position: absolute;
    height: 100%;
    padding-left: 2em;
    padding-right: 2em;

    background: var(--emergency-color, #c0392b); /* dark red */
    border-radius: 8px;
    box-shadow: 0 5px 10px rgba(0,0,0,0.3);
    transform-origin: left center;
    transition: transform 0.3s ease;
    z-index: 2;

    /* Add some text on cover */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-family: 'Arial Black', sans-serif;
    letter-spacing: 1.5px;
    font-size: 0.9rem;
    text-transform: uppercase;
    user-select: none;
}

/* Text behind the cover */
.switch-text {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    text-align: center;
    font-weight: 600;
    font-family: Arial, sans-serif;
    font-size: 0.85rem;
    color: var(--text-color, #eee);
    pointer-events: none;
    user-select: none;
    z-index: 1;
    letter-spacing: 1px;
}

/* When toggled, flip the cover up */
.emergency-toggle input:checked + .cover {
    transform: rotateY(-110deg);
    box-shadow: none;
    background: #27ae60; /* green to show “safe” open state */
    color: #fff;
}



input,
select {
    color: white !important;
    background-color: #111 !important; /* Deep black for contrast */
    border: 2px solid var(--secondary-color); /* Bold yellow border */
    border-radius: 4px;
    padding: var(--half-pad);
    color-scheme: dark;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.05);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

textarea {
    color: white !important;
    background-color: #111 !important;
    border: 2px solid var(--secondary-color);
    border-radius: 4px;
    padding: var(--half-pad);
    color-scheme: dark;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.05);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

/* Placeholder text */
input::placeholder,
textarea::placeholder {
    color: #bbb;
    opacity: 1;
}

/* Focus state */
input:focus,
select:focus,
textarea:focus {
    border-color: #ffc107; /* Brighter yellow on focus */
    box-shadow: 0 0 6px 2px rgba(255, 208, 0, 0.4);
}

/* Disabled inputs */
input:disabled,
select:disabled,
textarea:disabled {
    background-color: #222 !important;
    border-color: #555 !important;
    color: #777 !important;
    cursor: not-allowed;
}

input:read-only,
textarea:read-only {
    background-color: #1a1a1a !important;  /* Slightly lighter than active bg */
    color: #bbb !important;               /* Dimmed text */
    border-color: #444 !important;        /* Muted border */
    cursor: not-allowed;
/*     opacity: 0.8; */
}

input:read-only:hover,
textarea:read-only:hover {
    border-color: #555 !important;
}

/* Slider Switch */
.slide-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    touch-action: manipulation; /* better touch support */
}

.slide-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

/* Slider background */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--background-color);
    border: 2px solid var(--secondary-color);
    border-radius: 34px;
    transition: background-color 0.3s, border-color 0.3s;
}

/* Slider circle */
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    transition: transform 0.3s, background-color 0.3s;
}

/* Checked state */
.slide-switch input:checked + .slider {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.slide-switch input:checked + .slider:before {
    transform: translateX(24px);
    background-color: var(--background-color);
}

/* Hover effect */
.slider:hover {
    border-color: var(--secondary-hover-color);
}

.slide-switch input:checked + .slider:hover {
    background-color: var(--secondary-hover-color);
}

/* --- Mobile Responsive --- */
@media (max-width: 1000px) {
}



.tab-nav {
    display: flex;
    gap: var(--default-col-gap);
    border-bottom: 2px solid var(--secondary-color); /* yellow baseline under all tabs */
    margin-bottom: 0; /* so it visually touches the content */
}

/* Base tab style */
.tab-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    border-bottom: none; /* important: let the tab merge with content */
    color: #f8f8f8;
    font-weight: 500;
    text-transform: uppercase;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    border-radius: 6px 6px 0 0; /* rounded only on top */
    transition: background-color 0.2s ease, color 0.2s ease;
    position: relative;
    top: 2px; /* overlap tab-view border by a couple pixels */
}

/* Hover effect */
.tab-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Active tab */
.tab-button-active {
    background: #111; /* match the tab-view background */
    color: #fff;
    border: 2px solid var(--secondary-color);
    border-bottom: none; /* merge visually with panel */
    z-index: 2; /* keep above the panel border */
}

/* Tab view container */
.tab-view {
    background: #111;
    padding: 2rem;
    border: 2px solid var(--secondary-color); /* yellow border */
    border-top: none; /* so it connects to active tab */
    border-radius: 0 0 6px 6px; /* rounded bottom only */
    margin-top: 0; /* sits flush with tabs */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.07);
}


.close-button {
    position: absolute;
    top: 12px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.close-button:hover {
    color: var(--secondary-hover-color);
}


/* =============================================================== */
/* Card Modal Boxes */

.card {
    background: #1a1a1a; /* dark surface */
    border: 1px solid #333;
    border-radius: 0.75rem;
    margin: var(--standard-pad) 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.6);
    overflow: hidden;
    color: white;
    display: flex;
    flex-direction: column;
}

.card-header {
    background: #2a2a2a;
    padding: var(--half-pad) var(--standard-pad);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: calc(var(--standard-text-size) * 1.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


.card-body {
    display: flex;
    gap: var(--standard-pad);
    padding: var(--standard-pad);
    font-size: var(--standard-text-size);
}


/* Job-specific styling */
.job-card .card-header {
    background: rgba(245, 214, 33, 0.2); /* tint of your secondary yellow */
    color: var(--secondary-color);
}

/* Booking-specific styling */
.booking-card .card-header {
    background: rgba(90, 200, 250, 0.15); /* light blue tint */
    color: #5ac8fa;
}

/* Project-specific styling */
.project-card .card-header {
    background: rgba(46, 204, 113, 0.2); /* soft green tint */
    color: #2ecc71; /* vibrant green */
}

.project-card:hover {
    border-color: #2ecc71;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

/* Subtle hover */
.card:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(245, 214, 33, 0.3);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Default card footer buttons */
.card-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--half-pad);
    padding: var(--half-pad) var(--standard-pad);
}

.card-footer button {
    padding: 0.3rem 0.75rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: var(--standard-text-size);
    transition: background 0.2s;
}

/* Booking overdue styling (matches job-overdue) */
.booking-overdue,
.job-overdue {
    background: rgba(255, 77, 77, 0.15); /* soft red tint */
    border: 2px solid #ff4d4d;           /* vibrant red border */
    color: #a30000;                       /* dark red text */
    border-radius: 6px;
    animation: glow-red 1.5s infinite alternate;
}

.booking-overdue .card-header,
.job-overdue .card-header {
    background: rgba(255, 77, 77, 0.2); /* slightly stronger red for header */
    color: #ff1a1a;                      /* bright red text for header */
    font-weight: bold;
}

.booking-overdue:hover,
.job-overdue:hover {
    border-color: #ff1a1a;
    box-shadow: 0 4px 12px rgba(255, 77, 77, 0.3);
}

/* Common glow animation for overdue cards */
@keyframes glow-red {
    0% {
        box-shadow: 0 0 5px rgba(255, 77, 77, 0.5),
        0 0 10px rgba(255, 77, 77, 0.5),
        0 0 15px rgba(255, 77, 77, 0.3);
    }
    50% {
        box-shadow: 0 0 10px rgba(255, 77, 77, 0.8),
        0 0 20px rgba(255, 77, 77, 0.6),
        0 0 30px rgba(255, 77, 77, 0.4);
    }
    100% {
        box-shadow: 0 0 5px rgba(255, 77, 77, 0.5),
        0 0 10px rgba(255, 77, 77, 0.5),
        0 0 15px rgba(255, 77, 77, 0.3);
    }
}

/* Mobile adjustments */
@media (max-width: 1000px) {

    .day-icons{
        display: none;
    }
    .card-footer {
        flex-direction: row;
        align-items: center;
        gap: var(--standard-pad);
        justify-content: flex-start;
    }

    .card-footer button {
        width: 40%; /* make buttons bigger / full width-ish */
        padding: 0.6rem 1rem;
        font-size: calc(var(--standard-text-size) * 1.2);
    }
}

.btn-view {
    background-color: white;
    color: black;
}

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

.btn-contact{
    background-color: white;
    color: black;
}

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


.btn-complete{
    background-color: white;
    color: black;
}

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


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

.btn-report:hover {
    background-color: #c0392b;
}

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

.btn-delete:hover {
    background-color: #c0392b;
}

/* Shared icon style for all action buttons */
.btn-view i,
.btn-contact i,
.btn-complete i,
.btn-view-log i,
.btn-add-log i,
.worklog-upload-btn i,
.worklog-send-btn i,
.btn-complete-log i {
    color: black;
    text-shadow: 0 1px 8px #fff;
}

/* Shared hover effect for all buttons */
.btn-view:hover,
.btn-contact:hover,
.btn-complete:hover,
.btn-view-log:hover,
.btn-add-log:hover,
.worklog-upload-btn:hover,
.worklog-send-btn:hover,
.btn-complete-log:hover {
    background-color: var(--secondary-hover-color);
}


/* Avatar container */
.card-avatar {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--secondary-color);
}

.card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Details section */
.card-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-grow: 1;
}

/* Container for cards in the modal */
.modal-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 3 cards per row on desktop */
    column-gap: var(--default-col-gap);
    row-gap: var(--default-row-gap);
    padding: var(--standard-pad);
}

/* Mobile: single column layout */
@media (max-width: 1000px) {
    .modal-card-grid {
        grid-template-columns: 1fr;
        row-gap: calc(var(--default-row-gap) * 1.5);
    }
}
