.calendar-job-editable-hover {
    box-shadow: 0 0 0px 0px #00000000;
    /*transform: scale(1.01);*/
    color: #fff;
    z-index: 9999;
    opacity: 1 !important;
    animation: selectEdit 1.2s infinite;
    transition: all 0.5s;
}
@keyframes selectEdit {
    /*0% { box-shadow: 0 0 0 0px #0033ff00, 0 0px 0px 0px rgba(0, 38, 255, 0); }
    0% { box-shadow: 2px 0 0 0px #003cff, -2px 0px 0px 0px #000000; }
    100% { box-shadow: 2px 0 0 0px #000000, -2px 0px 0px 0px #003cff; }*/
  0%  { 
    transition: all 0.2s !important;
    box-shadow: 1px 0 10px 1px #21284128, -1px 0 10px 1px #2f485728;
  }
  25% { box-shadow: 0px 1px 10px 1px #21284128, 0px -1px 10px 1px #2f485728; }
  50% { box-shadow: -1px 0 10px 1px #21284128, 1px 0 10px 1px #2f485728; }
  75% { box-shadow: 0px -1px 10px 1px #21284128, 0px 1px 10px 1px #2f485728; }
  100% { box-shadow: 1px 0 10px 1px #21284128, -1px 0 10px 1px #2f485728; }

}
.calendar-job-editable {
    /*outline: 2px dashed #3a7bd5;*/
    cursor: pointer !important;
    box-shadow: 0 0 0 0px #3a7bd500;
    transition: all 0.2s !important;
    opacity: .4;
}

/* Calendar Edit Toggle Button */
.calendar-edit-toggle-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}
.calendar-edit-toggle {
    background: #1a2340;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.6em 1.5em;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(26,35,64,0.08);
    transition: background 0.2s, color 0.2s, transform 0.2s, scale .1s;
    outline: none;
    width: fit-content;
}
.calendar-edit-toggle:hover {
    background: #13192e;
    color: #fff;
    scale: 1.02;
}

.calendar-edit-toggle.editing {
    background: #3a7bd5;
    color: #fff;
    box-shadow: 0 4px 16px rgba(58,123,213,0.13);
    width: fit-content;
    padding: 0.6em 1.5em;
}
/*
.calendar-job-editable {
    outline: 2px dashed #3a7bd5;
    cursor: pointer !important;
    box-shadow: 0 0 0 4px #3a7bd544;
    transition: outline 0.2s, box-shadow 0.2s;
}
*/    
.global-success-animation.active svg polyline {
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: checkmark-draw 0.4s cubic-bezier(.4,0,.2,1) forwards;
}

@keyframes checkmark-draw {
    to {
        stroke-dashoffset: 0;
    }
}
/* --- Modern, Beautiful, Responsive Millwork Dashboard --- */
/* Delete Range Button */
.delete-range-btn {
    background: #e81123;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.5em 1em;
    font-size: 1em;
    cursor: pointer;
    margin-right: 0.5em;
    transition: background 0.2s, transform 0.2s;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(232,17,35,0.08);
    margin-bottom: 1rem;
}
.delete-range-btn:hover {
    background: #b4001a;
    transform: scale(1.02);
}

body {
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
    /*background: #f7f9fc;*/
    background:linear-gradient(120deg, #fbfcff 0%, #e6eaf5 30%, #e6eaf5 100%);
    margin: 0;
    color: #1a2340;
    min-height: 100vh;
}

header {
    background: #1a2340;
    color: #fff;
    box-shadow: 0 2px 12px rgba(26,35,64,0.10);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0rem 1rem;
    height: auto;
    gap: 0.6rem;
    flex-wrap: nowrap;
    margin-bottom: 4vh;
    /*width: 100%;*/
}

h1, h2, h3 {
    font-weight: 700;
    /*margin: 0.5em 0;*/
    color: #1a2340;
    letter-spacing: 0.5px;
}
h1.title {
    color: #fff;
    font-size: 2.5rem;
    letter-spacing: 1px;
    width: 10vw;
    /*flex: 1 1 auto;*/
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.header-actions {
    display: flex;
    /*gap: .6rem;*/
    width: 60%;
    justify-content: flex-end;
    /*flex-wrap: wrap;*/
    margin-right: 0%;
}
.add-project-btn, .add-contractor-btn, .add-installer-btn,
.manage-projects-btn, .manage-contractors-btn, .manage-installers-btn {
    background: #1a2340;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0.7em 1.7em;
    height: 100%;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(26,35,64,0.08);
    transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
    outline: none;
}
.add-project-btn:hover, .add-contractor-btn:hover, .add-installer-btn:hover,
.manage-projects-btn:hover, .manage-contractors-btn:hover, .manage-installers-btn:hover {
    background: #161d35;
    background-image: -moz-radial-gradient(#293764 0%, #ffffff 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(26,35,64,0.13);
    scale: 1.02;
    border-radius: 10px;
}

main {
    /*width: min(1200px, 96vw);*/
    max-width: 90%;
    margin: 0 auto;
    padding: 0;
}

.dashboard {
    max-width: 1300px;
    margin: 2.5rem auto;
    padding: 2.5rem 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(26,35,64,0.08);
}

.install-calendar {
    margin-bottom: 2.5rem;
}
.install-calendar-controls {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.2rem;
}
.install-calendar-controls button {
    background: #1a2340;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.5em 1.2em;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(26,35,64,0.08);
    transition: background 0.2s, transform 0.2s;
}
.install-calendar-controls button:hover {
    background: #404a6e;
    transform: scale(1.0);
}
.calendar-project-select {
    margin-bottom: 1.2rem;
    display: flex;
    margin-right: 20%;
    align-items: center;
    gap: 1.2rem;
    width: 100%;
    transition: all 0.2s;
}
.calendar-project-select label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.calendar-project-select .checkBox {
    width: 18px;
    height: 18px;
    accent-color: #1a2340; /* modern, simple brand tint */
    cursor: pointer;
    transition: transform 0.08s ease;
}
.calendar-project-select .checkBox:active { transform: scale(0.92); }
.calendar-project-select .checkBox:focus-visible {
    outline: 2px solid #3a7bd5;
    outline-offset: 2px;
    border-radius: 4px;
}
.calendar-instructions {
    color: #25305a;
    font-size: 1em;
    font-weight: 500;
}

#calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    /*gap: 12px;*/
    background: linear-gradient(120deg, #f4f8ff 60%, #e6eaf5 100%);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(26,35,64,0.06);
    padding: 1.5rem;
    min-height: 340px;
    margin-bottom: 2rem;
    overflow-x: auto;         
    width: 100%;  /* allow horizontal scroll on small screens */
    /*min-width: 840px;*/           /* keep 7 columns readable */
}
/*
.calendar-day {
    background: #f7f9fc;
    border-radius: 4px;
    min-height: 10rem;
    box-shadow: 0 1px 4px rgba(26,35,64,0.04);
    position: relative;
    padding: 8px 10px;
    transition: box-shadow 0.2s, background 0.2s, transform 0.2s;
    cursor: pointer;
    font-size: 1.1em;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    border: 1px solid #e6eaf5;
}
*/
.calendar-day.today >div{
    /*border: 1px solid #1a2340;*/
    background: linear-gradient(120deg, #e6eaf5 70%, #f7f9fc 100%);
    /*box-shadow: 0 0 0 4px #25305a22, 0 2px 8px rgba(26,35,64,0.10);*/
    position: relative;
    animation: todayPulse 1.2s infinite alternate;
}

@keyframes todayPulse {
    0% { box-shadow: 0 0 0 1px #0033ff33, 0 1px 16px rgba(0, 30, 197, 0.13); }
    50% { box-shadow: 0 0 0 2px #003cff33, 0 1px 24px rgba(4, 88, 214, 0.18); }
    100% { box-shadow: 0 0 0 1px #1a234033, 0 1px 30px rgba(73, 75, 78, 0.18); }
}
.calendar-day.dragging >div {
    background: #d0e6fa;
    border: dashed 1px #1a2340;
    animation: selectPulse 1.2s infinite alternate;
}
@keyframes selectPulse {
    0% { box-shadow: 0 0 0 1px #0033ff33, 2px 1px 16px rgba(0, 30, 197, 0.13); }
    50% { box-shadow: 0 0 0 2px #003cff33, 0 1px 24px rgba(4, 88, 214, 0.18); }
    100% { box-shadow: 0 0 0 1px #1a234033, 0 1px 30px rgba(73, 75, 78, 0.18); }
}
:root { --calendar-day-height: 10.5rem; }
.dayWrapper {
    display: flex;
    flex-direction: column;
    background: #f8fbff;
    border-radius: 4px;
    height: var(--calendar-day-height); /* fixed height to prevent row stretching */
    box-shadow: 0 1px 2px rgba(26,35,64,0.04);
    position: relative;
    /*padding: 8px 10px;*/
    transition: box-shadow 0.2s, background 0.2s, transform 0.2s;
    cursor: pointer;
    font-size: 1.1em;
    /*border: 1px solid #e6eaf5;*/
    border: 1px solid #caced8;    
    margin: 4px;
    overflow: hidden; /* trim overflow so all cells stay even */
    /*width: 100%;*/
    min-height: 20vh;
}
.dayDiv {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 2px;
    margin-left: 6px;
    margin-top: 4px;
    color: #25305a;
}
.calendar-jobs-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
    width: 100%;
    overflow: hidden;    /* prevent growth from long lists */
    flex: 1;             /* fill remaining space under the date number */
}
.calendar-jobs-row .job { flex: 0 0 auto !important; }
.calendar-day:hover .calendar-jobs-row {
    overflow-y: auto; /* allow scroll on hover to inspect hidden items */
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.job {
    border-radius: 0px;
    padding: 6px 6px;
    font-size: 0.8rem;
    font-weight: 600;
    /*white-space: nowrap;*/
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    box-shadow: 0 1px 4px rgba(26,35,64,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    background: #1a2340;
    color: #fff;
    height: fit-content;
}
.job-start {
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
    margin-left: 15px;
}
.job-end {
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
    margin-right: 15px;
}

.project-list {
    margin-top: 2.5rem;

}
#projectsTable, #contractorsTable, #installersTable, #projectStatusTable {
    /*width: 100%;*/
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(26,35,64,0.06);
    overflow: hidden;
    margin-bottom: 2rem;
}
.project-list {
    margin-top: 2.5rem;
}
#projectsTable th, #projectsTable td,
#contractorsTable th, #contractorsTable td,
#installersTable th, #installersTable td,
#projectStatusTable th, #projectStatusTable td {
    padding: 1em 1.2em;
    text-align: left;
    font-size: 1em;
    word-break: break-word;
}
#projectsTable th, #contractorsTable th, #installersTable th, #projectStatusTable th {
    background: #e6eaf5;
    color: #1a2340;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #d0e6fa;
}
#projectsTable tr, #contractorsTable tr, #installersTable tr, #projectStatusTable tr {
    border-bottom: 1px solid #e3e6ee;
    transition: background 0.2s;
}
#projectsTable tr:last-child, #contractorsTable tr:last-child, #installersTable tr:last-child, #projectStatusTable tr:last-child {
    border-bottom: none;
}
#projectsTable tr:hover, #contractorsTable tr:hover, #installersTable tr:hover, #projectStatusTable tr:hover {
    background: #f7f9fc;
}

/* --- Project Status table tweaks --- */
#projectStatusTable { display: none; }
#projectStatusTable thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}
#projectStatusTable tbody tr:nth-child(even) { background: #fafbfe; }
#projectStatusTable td {
  padding: 0.6em 0.8em; 
  vertical-align: middle; 
  word-break: break-word; 
  white-space: normal;
  cursor: pointer; 
}
#projectStatusTable th {
  padding: 1em 1em;

}
/* Keep Project Status headers on a single line */
#projectStatusTable thead th { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#projectStatusTable .ps-input {
    width: 100%;
    background: #f7f9fc;
    border: 1px solid #e3e6ee;
    border-radius: 6px;
    padding: 0.45rem 0.55rem;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border .15s ease, box-shadow .15s ease, background .15s ease;
}
#projectStatusTable .ps-input:focus {
    outline: none;
    border-color: #1a2340;
    background: #fff;
    box-shadow: 0 1px 6px rgba(26,35,64,0.12);
}
#projectStatusTable input[type="number"].ps-input { text-align: right; }

/* Multi-line textareas for long fields */
#projectStatusTable .ps-textarea {
    display: block;
    min-height: 34px;
    max-height: 220px;
    resize: vertical;
    overflow: auto;
    line-height: 1.25;
    white-space: pre-wrap;
}

/* Read-only value cells */
.ps-value { color: #1a2340; white-space: pre-wrap; }
.ps-empty { color: #94a0b8; font-style: italic; }
.ps-num { text-align: right; }
/* Each material-ordered line stays on a single row */
.ps-lines .ps-list-line { 
  display:block; 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis;
  margin-bottom: .2rem;
}
.ps-lines .ps-list-line::before { content: '- '; color: inherit; }


/* --- Project Status Accordion --- */
.ps-accordion { display: flex; flex-direction: column; gap: 10px; }
.ps-item { border: 1px solid #e6eaf5; border-radius: 8px; background: #fff; box-shadow: 0 2px 8px rgba(26,35,64,0.06); overflow: hidden; }
.ps-header { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0.9rem 1rem; background: #e6eaf5; color: #1a2340; font-weight: 700; border: none; cursor: pointer; text-align: left; }
.ps-header:hover { background: #dfe4f1; }
.ps-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-chev { transition: transform .2s ease; }
.ps-item.open .ps-chev { transform: rotate(180deg); }
.ps-body { max-height: 0; overflow: hidden; opacity: 0; background: #f7f9fc; border-top: 1px solid #e6eaf5; transition: max-height .25s cubic-bezier(.4,0,.2,1), opacity .25s ease; }
.ps-item.open .ps-body { opacity: 1; }
.ps-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 12px; }
.ps-field { background: #fff; border: 1px solid #e6eaf5; border-radius: 6px; padding: 10px 12px; box-shadow: 0 1px 4px rgba(26,35,64,0.04); }
.ps-field .ps-label { font-size: 0.92rem; color: #25305a; margin-bottom: 6px; font-weight: 600; }
.ps-field .ps-editable { cursor: pointer; border-radius: 4px; padding: 2px; }
.ps-field .ps-editable:hover { background: #f1f4fb; box-shadow: inset 0 0 0 1px #d0d8ee; }
.ps-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 12px 12px; }

@media (max-width: 1100px) { .ps-fields { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px) { .ps-fields { grid-template-columns: 1fr; } }

/* Material Ordered list editor (single-field modal) */
#editStatusFieldModal .mo-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 1rem;}
#editStatusFieldModal .mo-row {
  display: grid;
  grid-template-columns: 1fr 1fr 120px 36px;
  gap: 8px;
  align-items: center;
}
#editStatusFieldModal .mo-row input { width: 100%; margin-bottom: 0px; }
#editStatusFieldModal .mo-del {
  background: #e81123; color: #fff; border: none; border-radius: 6px; width: 36px; height: 36px; cursor: pointer;
}

/* Elevations + Programmed linked editor */
#editStatusFieldModal .el-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 1rem; }
#editStatusFieldModal .el-row {
  display: grid;
  grid-template-columns: 1fr 220px 1fr 36px; /* name | status | custom | delete */
  gap: 8px;
  align-items: center;
}
#editStatusFieldModal .el-row input, #editStatusFieldModal .el-row select { width: 100%; margin-bottom: 0; }
#editStatusFieldModal .el-del { background: #e81123; color: #fff; border: none; border-radius: 6px; width: 36px; height: 36px; cursor: pointer; }



/* Wider first column, balanced others */
#projectStatusTable th:nth-child(1),
#projectStatusTable td:nth-child(1) { width: 16rem; }
#projectStatusTable th:nth-child(9),
#projectStatusTable td:nth-child(9) { width: 10rem; }

#projectStatusTable th{
  width: fit-content;
}

/* Align action buttons to the right and keep them on one line */
#projectsTable td:last-child,
#projectsTable th:last-child,
#contractorsTable td:last-child,
#contractorsTable th:last-child,
#installersTable td:last-child,
#installersTable th:last-child {
    text-align: right;
    white-space: nowrap;
    width: 1%;
}
.action-btn {
    background: #1a2340;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.5em 1em;
    font-size: 1em;
    cursor: pointer;
    margin-right: 0.5em;
    transition: background 0.2s, transform 0.2s;
    font-weight: 600;
}
.action-btn:hover {
    background: #575f80;
    transform: scale(1.02);
}
.closeEdit {
    background: #1a2340;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.5em 1em;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    font-weight: 600;
    width: 100%;
}
.closeEdit:hover {
    background: #575f80;
}
input, select, textarea {
    font-family: inherit;
    font-size: 1em;
    padding: 0.7rem;
    border: 1px solid #e3e6ee;
    border-radius: 4px;
    margin-bottom: 1rem;
    width: 100%;
    box-sizing: border-box;
    transition: border 0.2s, box-shadow 0.2s;
    background: #f7f9fc;
}
input:focus, select:focus, textarea:focus {
    border: 1.5px solid #1a2340;
    box-shadow: 0 2px 8px rgba(26,35,64,0.08);
    background: #fff;
}
label {
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: block;
    color: #25305a;
    font-size: 1em;
}

/* Modals */
/* Modal overlays */
.project-modal, .contractor-modal, .installer-modal, .edit-ranges-modal, .installer-select-modal, .manage-modal{
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26, 35, 64, 0.548);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(.4,0,.2,1);
}
.project-modal.active, .contractor-modal.active, .installer-modal.active, .edit-ranges-modal.active, .installer-select-modal.active, .manage-modal.active{
    display: flex;
    opacity: 1;
}
.project-modal-content, .contractor-modal-content, .installer-modal-content, .edit-ranges-modal-content, .installer-select-modal-content, .manage-modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(26,35,64,0.10);
    padding: 2rem 2rem;
    min-width: 320px;
    max-width: 90vw;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.25s cubic-bezier(.4,0,.2,1), transform 0.25s cubic-bezier(.4,0,.2,1);
    animation: none;
}
.project-modal.active .project-modal-content,
.contractor-modal.active .contractor-modal-content,
.installer-modal.active .installer-modal-content,
.edit-ranges-modal.active .edit-ranges-modal-content, .installer-select-modal-content,
.manage-modal.active .manage-modal-content {
    opacity: 1;
    transform: scale(1);
    animation: modalPop 0.25s cubic-bezier(.4,0,.2,1);
}

/* Edit Project Status: wider content with grid */
#editProjectStatusModal .eps-modal {
    width: 72vw;
    max-width: 1200px;
    max-height: 84vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#editProjectStatusModal .eps-project-name {
    font-weight: 700;
    margin-bottom: 8px;
}
#editProjectStatusModal .eps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    overflow: auto;
    flex: 1;
}
#editProjectStatusModal .eps-grid label { margin: 0; display: flex; flex-direction: column; gap: 6px; }
#editProjectStatusModal .eps-grid textarea,
#editProjectStatusModal .eps-grid input[type="number"] {
    width: 100%;
    background: #f7f9fc;
    border: 1px solid #e3e6ee;
    border-radius: 6px;
    padding: 0.6rem 0.7rem;
    font-size: 0.95rem;
    box-sizing: border-box;
}
#editProjectStatusModal .eps-grid textarea { resize: vertical; min-height: 80px; }
#editProjectStatusModal .eps-grid .eps-span-2 { grid-column: span 2; }

#editProjectStatusModal .eps-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 8px;
}

@media (max-width: 1100px) {
  #editProjectStatusModal .eps-modal { width: 92vw; }
  #editProjectStatusModal .eps-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  #editProjectStatusModal .eps-grid { grid-template-columns: 1fr; }
}

/* Single field edit modal */
#editStatusFieldModal .epsf-modal {
  width: fit-content;
  max-width: 140vw;
  max-height: 70vh;
  overflow: auto;
}

.el-name {
  width: 20vw !important;
}

#editStatusFieldModal .eps-actions {
  display:flex; gap:10px; margin-top: 12px;
}
#editStatusFieldModal textarea,
#editStatusFieldModal input[type="number"],
#editStatusFieldModal input[type="text"] {
  width: 100%;
  background: #f7f9fc;
  border: 1px solid #e3e6ee;
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
  font-size: 0.95rem;
  box-sizing: border-box;
}
#editStatusFieldModal textarea { resize: vertical; min-height: 120px; }

/* Close animation state: keep active for fade/scale, then JS removes */
.project-modal.active.closing,
.contractor-modal.active.closing,
.installer-modal.active.closing,
.edit-ranges-modal.active.closing,
.installer-select-modal.active.closing,
.manage-modal.active.closing {
    opacity: 0;
}
.project-modal.closing .project-modal-content,
.contractor-modal.closing .contractor-modal-content,
.installer-modal.closing .installer-modal-content,
.edit-ranges-modal.closing .edit-ranges-modal-content,
.installer-select-modal.closing .installer-select-modal-content,
.manage-modal.closing .manage-modal-content {
    animation: modalClose 0.22s cubic-bezier(.4,0,.2,1) forwards;
}

/* Manage modal specific layout */
.manage-modal-content {
    width: 90vw;
    height: 82vh;
    display: flex;
    flex-direction: column;
}
.manage-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.manage-close {
    background: #1a2340;
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.table-scroll {
    overflow: auto;
    max-height: 60vh;
    border: 1px solid #e6eaf5;
    border-radius: 6px;
}

/* Ensure edit modals sit above manage modal when both are open */
.manage-modal { z-index: 9000; }

@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes modalClose {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.96); }
}

.global-success-animation {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    /*background: rgba(26,35,64,0.10);*/
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}
.global-success-animation.active {
    display: flex;
}
.global-success-animation svg {
    width: 60px;
    height: 60px;
    background: #1a2340;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(26,35,64,0.10);
    padding: 8px;
}
.submit {
  background-color: #1a2340;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5em 1em;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.1s, transform 0.1s;
  font-weight: 600;
  width: 100%;
  height: 5vh;
}
.submit:hover {
  background: #575f80;
}



/* Responsive */
@media (max-width: 1100px) {
    .dashboard {
        padding: 1rem;
    }
    :root { --calendar-day-height: 9.5rem; }
    #calendar {
        padding: 0.5rem;
        min-height: 220px;
    }
}
@media (max-width: 700px) {
    header { font-size: 1.05em; }
    .header-actions {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .header-actions::-webkit-scrollbar { height: 8px; }
    .header-actions::-webkit-scrollbar-thumb { background: #2c3558; border-radius: 4px; }
    h1.title { font-size: clamp(1.25rem, 2.5vw + 1rem, 2rem); }
    .dashboard {
        padding: 0.5rem;
        border-radius: 4px;
    }
    #calendar {
        min-height: 120px;
        border-radius: 4px;
        /*min-width: 700px;*/
    }
    .project-modal-content, .contractor-modal-content, .installer-modal-content, .edit-ranges-modal-content {
        padding: 1rem;
        min-width: 98vw;
        max-width: 99vw;
        border-radius: 4px;
    }
    .install-calendar-controls { flex-wrap: wrap; }
    .calendar-project-select { flex-wrap: wrap; }
    .calendar-edit-toggle { width: auto; }
}

/* ---- Header Dropdowns ---- */
.dropdown { position: relative; }
.menu-btn {
    background: #1a2340;
    color: #ffffff;
    border: 0;
    border-radius: 10px;
    padding: 0.65em 1.0em;
    font-size: 1.05em;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(26,35,64,0.08);
    transition: background .2s, transform .15s, box-shadow .2s;
}
.menu-btn .menu-leading-icon { font-size: 1.15em; line-height: 1; }
.menu-btn .chev { transition: transform .18s ease; opacity: .9; }
.dropdown.open .menu-btn .chev { transform: rotate(180deg); }
.menu-btn:hover { background:#161d35; box-shadow:0 4px 16px rgba(26,35,64,0.13); transform: translateY(-1px); }

.dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #1a2340;
    color: #fff;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,.25);
    padding: 8px;
    opacity: 0;
    transform: translateY(-10px) scale(1);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity .2s ease, transform .3s ease;
    z-index: 1000;
    overflow: hidden;
}
.dropdown.open .dropdown-panel { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.menu-item {
    width: 100%;
    text-align: center;
    background: transparent;
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: .7em .9em;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, transform .12s ease, scale .12s ease;
}
.menu-item:hover { 
  background: #2b355e; 
  /*transform: translateX(1px);*/
  /*scale: 1.1;*/
}
.menu-item + .menu-item { margin-top: 0px; }

#projectStatusTable { 
  table-layout: auto;
  min-width: 1200px; 
  margin-bottom: 0px;
}
.calendar-filters {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: nowrap;
}

#calendarProjectSelect {
    min-width: 10vw;
    max-width: 20vw;
}
