/* ============================================
   GREENROCK ENERGY CRM - CENTRALIZED STYLES
   ============================================ */

/* ============================================
   BASE & RESET
   ============================================ */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background-color: #f5f5f5;
    padding-top: 60px;
}

/* Full-page background via pseudo-element — fixed to viewport so it never
   stretches on tall pages and works correctly on iOS (no background-attachment: fixed) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('background-768.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

@media (min-width: 769px) {
    body::before {
        background-image: url('background-1280.jpg');
    }
}

@media (min-width: 1281px) {
    body::before {
        background-image: url('background-1920.jpg');
        background-image: -webkit-image-set(
            url('background-1920.webp') type('image/webp'),
            url('background-1920.jpg') type('image/jpeg')
        );
        background-image: image-set(
            url('background-1920.webp') type('image/webp'),
            url('background-1920.jpg') type('image/jpeg')
        );
    }
}

/* ============================================
   HEADER
   ============================================ */
header { 
    background: linear-gradient(
  135deg,
  #f9fffc99 0%,
  #b8c4cc99 50%,
  #f9fffc99 100%
);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white; 
    padding: 0.5rem 0.5rem; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-content { 
    max-width: 1400px; 
    margin: 0 auto; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.header-left { 
    display: flex; 
    align-items: center; 
    gap: 1.5rem; 
    flex: 0 0 auto;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: center;
}

.header-right-logout {
    flex: 0 0 auto;
}

.header-title { 
    font-size: 1.5rem; 
    margin: 0; 
    display: flex; 
    align-items: center; 
    gap: 0.75rem; 
    line-height: 1; 
}

.header-logo { 
    width: 80px; 
    height: 80px; 
    object-fit: contain; 
    display: block;
    filter: drop-shadow(0 2px 5px rgba(255,255,255,1)) drop-shadow(0 0 5px rgba(255,255,255,1));
    transition: filter 0.3s ease;
}

.header-logo:hover {
    filter: drop-shadow(0 2px 12px rgba(255,255,255,0.7)) drop-shadow(0 0 20px rgba(255,255,255,0.5));
}

.mobile-user-name {
    display: none;
    font-size: 0.9rem;
    color: white;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.welcome-text { 
    font-size: 1.2rem; 
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    color: white; 
    text-decoration: none; 
    background: #5e8ab4; 
    padding: 0.5rem 1rem; 
    border-radius: 4px; 
    font-size: 1rem; 
    font-weight: 600; 
    transition: background 0.2s;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.dropdown-toggle:hover {
    background: #4e7ca6;
}

.dropdown-toggle.contacts {
    background: #acbac3;
}

.dropdown-toggle.contacts:hover {
    background: #95a7b2;
}

.dropdown-toggle.funds {
    background: #596183;
}

.dropdown-toggle.funds:hover {
    background: #3b4e68;
}

.dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    min-width: 200px;
    display: none;
    z-index: 2000;
}

.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: #1f2937;
    text-decoration: none;
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: #f3f4f6;
}

.dropdown-menu a:last-child {
    border-bottom: none;
    border-radius: 0 0 6px 6px;
}

.dropdown-menu a:first-child {
    border-radius: 6px 6px 0 0;
}

.dropdown-menu span {
    display: block;
    font-size: 0.4375rem;
    color: #6b7280;
    margin-top: 0.1rem;
}

.logout-btn {
    color: white;
    text-decoration: none;
    background: #4d9367;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.2s;
    display: inline-block;
}

.logout-btn:hover {
    background: #315e41;
}

.mobile-logout {
    display: none;
}

/* Mobile Styles */
@media (max-width: 1024px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .header-left {
        order: 1;
        gap: 1rem;
    }
    
    .header-right-logout {
        order: 2;
    }
    
    .header-center {
        order: 3;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        margin-top: 0;
        background: rgba(94, 138, 180, 0.95);
        backdrop-filter: blur(8px);
        border-radius: 0 0 8px 8px;
    }
    
    .header-center.mobile-menu-open {
        max-height: 600px;
        margin-top: 0.5rem;
    }
    
    .header-center .dropdown {
        width: 100%;
    }
    
    .header-center .dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        border-radius: 0;
        padding: 1rem 1.25rem;
    }
    
    .header-center .dropdown-menu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        margin-top: 0;
        border-left: 3px solid rgba(255,255,255,0.3);
        background: rgba(255,255,255,0.95);
    }
    
    .header-center a.logout-btn {
        display: block;
        width: 100%;
        border-radius: 0;
        padding: 1rem 1.25rem;
        text-align: left;
    }
    
    .hamburger {
        display: flex;
    }
    
    .logout-btn:not(.mobile-logout) {
        display: none;
    }
    
    .mobile-logout {
        display: block;
    }
    
    .mobile-user-name {
        display: block;
    }
    
    .welcome-text {
        display: none;
    }
    
    .header-title {
        font-size: 1.2rem;
    }
    
    .header-logo {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .header-logo {
        width: 50px;
        height: 50px;
    }
    
    .header-title {
        font-size: 1rem;
    }
}

 /* POSTCODE SECTION */
    .postcode-section {
        background: #f9fffc;
        border: 3px solid #c4ced4;
        border-radius: 8px;
        padding: 1.25rem;
        margin-bottom: 1rem;
        transition: all 0.3s ease;
        display: block;
        width: 100%;
    }
    
    .postcode-section.minimized {
        background: #f9fafb;
        border: 1px solid #d1d5db;
        padding: 0.625rem 0.875rem;
        margin-bottom: 0.75rem;
    }
    
    .postcode-section.minimized .postcode-input-wrapper {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 0;
    }
    
    .postcode-section.minimized .postcode-input-group {
        max-width: 150px;
    }
    
    .postcode-section.minimized .postcode-input {
        padding: 0.375rem 0.625rem;
        font-size: 0.875rem;
        border: 1px solid #d1d5db;
    }
    
    .postcode-section.minimized .validation-status {
        font-size: 0.75rem;
    }
    
    .postcode-section.minimized .postcode-info-box,
    .postcode-section.minimized .postcode-confirm-btn,
    .postcode-section.minimized .postcode-info-group {
        display: none;
    }
    
    .postcode-input-wrapper {
        display: flex;
        gap: 2rem;
        align-items: start;
        margin-bottom: 1rem;
    }
    
    .postcode-input-group {
        flex: 0 0 250px;
        display: flex;
        flex-direction: column;
    }
    
    .postcode-info-group {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .postcode-input {
        width: 100%;
        padding: 0.75rem 1rem;
        border: 3px solid #c4ced4;
        border-radius: 6px;
        font-size: 1.25rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        text-align: center;
    }
    
    .postcode-input:focus {
        outline: none;
        border-color: #c4ced4;
        box-shadow: 0 0 0 4px rgba(89, 106, 115, 0.2);
    }
    
    .validation-status {
        display: flex;
        align-items: center;
        gap: 0.375rem;
        margin-top: 0.375rem;
        font-size: 0.8125rem;
        font-weight: 600;
    }
    
    .validation-status.checking { color: #6b7280; }
    .validation-status.valid { color: #4d9367; }
    .validation-status.warning { color: #ef8023; }
    .validation-status.invalid { color: #dc2626; }
    
    .postcode-help-text {
        color: #6b7280;
        font-size: 0.875rem;
        font-weight: 500;
        padding: 0.75rem 1rem;
        background: #f9fafb;
        border-left: 3px solid #c4ced4;
        border-radius: 4px;
        text-align: center;
        width: 100%;
    }
    
    .btn-lookup-royal-mail {
        padding: 0.625rem 1.5rem;
        background: #5e8ab4;
        color: white;
        border: none;
        border-radius: 6px;
        font-weight: 600;
        font-size: 0.875rem;
        cursor: pointer;
        white-space: nowrap;
        transition: all 0.2s;
    }
    
    .btn-lookup-royal-mail:hover {
        background: #3B5D7D;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(39, 62, 83, 0.3);
    }
    
    .btn-lookup-royal-mail:active {
        transform: translateY(0);
    }
    
    .postcode-confirm-btn {
        padding: 0.75rem 1.5rem;
        background: #15864ccc;
        color: white;
        border: none;
        border-radius: 6px;
        font-size: 1rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.2s;
        white-space: nowrap;
        display: none;
        margin-top: 1rem;
        margin-left: 0;
        margin-right: 0;
    }
    
    .postcode-confirm-btn.show {
        display: block;
    }
    
    .postcode-confirm-btn:hover {
        background: #116a3c;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    }
    
    .postcode-info-box {
        background: white;
        border: 2px solid #c4ced4;
        border-radius: 6px;
        padding: 0.75rem;
        margin-top: 0.75rem;
        display: none;
    }
    
    .postcode-info-box.show {
        display: block;
    }
    
    .postcode-info-title {
        font-weight: 700;
        color: #15864c;
        margin-bottom: 0.375rem;
        font-size: 0.9375rem;
    }
    
    .postcode-info-detail {
        font-size: 0.8125rem;
        color: #6b7280;
        margin: 0.1875rem 0;
    }
 
 /* ============================================
   DATA FIELDS
   ============================================ */  
.title-field {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin: 0;
    letter-spacing: 0.08em;
    text-align: center;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 3);
}

.subtitle-field {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f9fafb;
    margin: 0;
    letter-spacing: 0.08em;
    text-align: center;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 3);
}


/* ============================================
   CONTAINERS
   ============================================ */
.container { 
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 1rem; 
    margin-top: 3rem; /* or whatever height your fixed header is */
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
}

/* ============================================
   DASHBOARD/PROPERTY SPECIFIC
   ============================================ */
body {
    text-transform: uppercase;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    gap: 1rem;
    flex-wrap: wrap;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-badge {
    background: #5e8ab4;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.subtitle-badge {
    background: #5e8ab4;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.card-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.user-select {
    padding: 0.5rem 0.875rem;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    background: white;
    cursor: pointer;
    text-align: center;
    text-align-last: center;

    transition: all 0.2s;
}

.user-select:hover {
    border-color: #81B0D9;
}

.user-select:focus {
    outline: none;
    border-color: #81B0D9;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.job-search-box {
    padding: 0.5rem 0.875rem;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #1f2937;
    background: white;
    transition: all 0.2s;
    width: 275px;
}

.job-search-box:focus {
    outline: none;
    border-color: #81B0D9;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.job-search-box::placeholder {
    color: #9ca3af;
}

.job-search-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.result-limit-select {
    padding: 0.5rem 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.result-limit-select:hover {
    border-color: #81B0D9;
}

.result-limit-select:focus {
    outline: none;
    border-color: #81B0D9;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-results-info {
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

/* Search Section */
.search-box {
    margin-bottom: 1rem;
}

.search-form {
    display: flex;
    gap: 0.75rem;
}

.search-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s;
}

.search-form input:focus {
    outline: none;
    border-color: #81B0D9;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-form button {
    padding: 0.75rem 2rem;
    background: #5e8ab4;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.search-form button:hover {
    background: #5e8ab4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Scrollbar Styling */
.search-results-container::-webkit-scrollbar,
.jobs-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.search-results-container::-webkit-scrollbar-track,
.jobs-scroll-container::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.search-results-container::-webkit-scrollbar-thumb,
.jobs-scroll-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.search-results-container::-webkit-scrollbar-thumb:hover,
.jobs-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Search Results */
.search-results {
    margin-top: 1.5rem;
}

.search-results-container {
    max-height: 440px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.5rem;
}

.property-card {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.property-card:last-child {
    margin-bottom: 0;
}

.property-card:hover {
    background: #f9fafb;
    border-color: #c4ced4;
    transform: translateX(4px);
}

.property-info {
    flex: 1;
}

.property-ref {
    display: inline-block;
    background: #dbeafe;
    color: #5e8ab4;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.property-address {
    font-weight: 600;
    color: #1f2937;
}

.property-jobs {
    color: #6b7280;
    font-size: 0.875rem;
}

.view-btn {
    padding: 0.5rem 1.25rem;
    background: #5e8ab4;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    text-align: center;
    width: 100%;
}

.view-btn-small {
  padding: 0.5rem 1.25rem;
    background: #5e8ab4;
    color: white;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
    width: 200px;
}


.view-btn:hover {
    background: #4e7ca6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.status-btn {
    padding: 0.5rem 1.25rem;
    background: #81b0d9;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    width: 100%;
}

.status-btn-property {
    width: 250px;
}

.status-btn:hover {
    background: #629DD0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.folder-btn {
    padding: 0.5rem 1.25rem;
    background: #acbac3;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    text-align: center;
    width: 100%;
    display: inline-block;
}

.folder-btn:hover {
    background: #95a7b2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(149, 167, 178, 0.3);
}

.site-sheet-btn {
    padding: 0.5rem 1.25rem;
    background: #acbac3;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    text-align: center;
    width: 100%;
    display: inline-block;
}

.site-sheet-btn:hover {
    background: #95a7b2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(149, 167, 178, 0.3);
}

.job-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: auto;    /* Push the whole container right */
    width: 200px;
}

/* Job Item */
.jobs-scroll-container {
    max-height: 470px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.5rem;
}

.job-item:last-child {
    margin-bottom: 0;
}

.job-item:hover {
    background: #f3f4f6;
    border-color: #e0ebf6;
    transform: translateX(4px);
}

/* Properties with no jobs - distinct styling */
.no-jobs-property {
    background: #fff;
    border-color: #5e8ab4;
    border-left: 4px solid #5e8ab4;
}

.no-jobs-property:hover {
    background: #fdecec;
    border-color: #ef4444b3;
}

/* Archived properties - distinct styling */
.archived-property {
    background: #fff;
    border-color: #4d9367;
    border-left: 4px solid #4d9367;
    opacity: 0.85;
}

.archived-property:hover {
    background: #f1f9f0;
    border-color: #4d9367;
    opacity: 1;
}

.job-info {
    flex: 1;
}

.job-ref {
    font-family: monospace;
    background: #f3f4f6;
    color: #1f2937;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.875rem;
    display: inline-block;
    white-space: nowrap;
}

.job-address {
    font-weight: 600;
    color: #1f2937;
    display: inline-block;
}

.job-details {
    color: #6b7280;
    font-size: 0.875rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.job-status-badge {
    display: inline-block;
    background: #ACBAC3;
    color: #95a7b2;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.dash-badge {
    display: inline-block;
    background: #96bee080;
    color: #6b7280;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    font-style: italic;
    font-family: monospace;
    margin-right: 0.5rem;
    margin-top: 0.5rem;
}

.dash-badge.unknown {
    background: #96bee080;
    color: #6b7280;
    font-style: italic;
    font-weight: 600;
}

.archived {
    display: inline-block;
    background: #f0f4f8;
    color: #5e8ab4;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 700;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Two Column Layout for Reports */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

/* Reports Section */
.report-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.form-select,
.form-input {
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: #81B0D9;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-generate {
    background: #81B0D9;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-generate:hover {
    background: #629DD0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-view-diary {
    background: #81b0d9;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-view-diary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-view-diary:active {
    transform: translateY(0);
}

/* Coming Soon */
.coming-soon {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
    font-style: italic;
}

.coming-soon-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #9ca3af;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.no-data {
    text-align: center;
    padding: 2rem 1rem;
    color: #9ca3af;
    font-style: italic;
}

/* Page Title */
.page-title-section {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
}

.page-title {
    font-size: 4rem;
    font-weight: 800;
    color: white;
    margin: 0;
    letter-spacing: 0.08em;
    text-align: center;
    text-shadow: 0 8px 16px rgba(0, 0, 0, 3);
}

.folder-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #acbac3;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.folder-link:hover {
    background: #95a7b2;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.folder-notice {
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
    margin-bottom: 0.5rem;
}


.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.stat-label {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1f2937;
    margin: 0;
}

.filters-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 2rem;
}

.filters-card h2 {
    margin: 0 0 1.5rem 0;
    color: #1f2937;
    font-size: 1.5rem;
}

.filter-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-item label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.results-table {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.table-header {
    background: #96bee099;
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-group {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   TABLES
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: #1f2937;
}

tr:hover {
    background: #f9fafb;
}

tr:last-child td {
    border-bottom: none;
}

/* ============================================
   FORMS
   ============================================ */
.form-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 2rem;
}

.form-header {
    background: #96bee099;
    color: white;
    padding: 2rem;
    border-radius: 12px 12px 0 0;
    margin: -2rem -2rem 2rem -2rem;
}

.form-header h1,
.form-header h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="url"]:focus,
.form-group input[type="date"]:focus,
.form-group input[type="time"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #acbac3;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: normal;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

/* ============================================
   BUTTONS
   ============================================ */
button,
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

button:disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #5e8ab4;
    color: white;
    margin-left: 1.75rem;
    
}

.btn-primary:hover:not(:disabled) {
    background: #4e7ca6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: #a0b0ba;
    color: white;
    margin-left: 0.75rem;
}

.btn-secondary:hover:not(:disabled) {
    background: #899da9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(125, 147, 161, 0.3);
}

.btn-success {
    background: #1574394d;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #15743980;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-warning {
    background: #ffa50080;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #ffa500b3;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ============================================
   BADGES & LABELS
   ============================================ */
.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-pending {
    background: #f3f4f6;
    color: #6b7280;
}

.badge-confirmed {
    background: #d1fae5;
    color: #15864c;
}

.badge-completed {
    background: #dbeafe;
    color: #5e8ab4;
}

.badge-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: white;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal.active,
.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: #96bee099;
    color: white;
    padding: 2rem;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-loading {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

@media (max-width: 768px) {
    .modal-actions {
        flex-direction: column;
    }
}

/* ============================================
   STATUS MODAL
   ============================================ */

/* Modal Overlay */
.status-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.status-modal.show {
    display: block;
}

/* Modal Content Box */
.status-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Modal Header */
.status-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.status-modal-close {
    color: #9ca3af;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.status-modal-close:hover {
    color: #1f2937;
}

.status-modal-add-btn {
    background: #5e8ab4;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.status-modal-add-btn:hover {
    background: #4e7ca6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(78, 124, 166, 0.3);
}

/* Modal Body */
.status-modal-body {
    padding: 2rem;
    max-height: 75vh;
    overflow-y: auto;
}

/* Status Items */
.status-item {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #fafafa;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.status-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.status-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.status-action-btn {
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.status-edit-btn {
    background: #5e8ab4;
    color: white;
}

.status-edit-btn:hover {
    background: #4e7ca6;
    transform: translateY(-1px);
}

.status-delete-btn {
    background: #ef4444;
    color: white;
}

.status-delete-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.status-date {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 600;
}

.status-with {
    color: #5e8ab4;
    font-weight: 600;
    font-size: 0.875rem;
}

.status-description {
    background: #96bee099;
    color: #5e8ab4;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-text {
    margin-top: 0.5rem;
    color: #1f2937;
    white-space: pre-wrap;
    line-height: 1.5;
}

.status-loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.status-error {
    text-align: center;
    padding: 2rem;
    color: #ef4444;
}

.status-empty {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
    font-style: italic;
}

/* Created Line Styles */
.status-created-line {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.status-created-label {
    color: #6b7280;
    font-weight: 600;
}

.status-created-data {
    color: #9ca3af;
    font-style: italic;
}




/* ============================================
   BOOKING MODAL
   ============================================ */
.booking-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.booking-modal.active {
    display: flex;
}

.booking-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: bookingModalSlideIn 0.3s ease;
}

@keyframes bookingModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.booking-modal-header {
    background: #96bee099;
    color: white;
    padding: 2rem;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.booking-modal-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
}

.booking-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.booking-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.booking-modal-body {
    padding: 2rem;
}

.booking-loading {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.booking-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.booking-detail-full {
    grid-column: 1 / -1;
}

.booking-detail-label {
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.booking-detail-value {
    color: #1f2937;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #e7ebee;
}

.booking-status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: white;
}

.booking-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

.booking-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.booking-btn-primary {
    background: #5e8ab4;
    color: white;
}

.booking-btn-primary:hover {
    background: #4e7ca6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.booking-btn-secondary {
    background: #6b7280;
    color: white;
}

.booking-btn-secondary:hover {
    background: #4b5563;
}

@media (max-width: 768px) {
    .booking-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .booking-actions {
        flex-direction: column;
    }
}

/* ============================================
   DIARY MODAL
   ============================================ */
.diary-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.diary-modal.active {
    display: flex;
}

.diary-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: diaryModalSlideIn 0.3s ease;
}

@keyframes diaryModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.diary-modal-header {
    background: #96bee099;
    color: white;
    padding: 2rem;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diary-modal-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
}

.diary-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.diary-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.diary-modal-body {
    padding: 2rem;
    overflow-y: auto;
}

/* Diary Modal Overlay */
.diary-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Diary Modal Controls */
.diary-modal-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.diary-control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.diary-modal-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}

.diary-modal-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}

.diary-modal-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.diary-modal-datepicker {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
}

/* Diary Modal Content States */
.diary-modal-loading {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
    font-size: 0.9375rem;
}

.diary-modal-empty {
    text-align: center;
    padding: 3rem;
    color: #9ca3af;
    font-size: 1.125rem;
}

.diary-modal-heading {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

/* Diary Booking Cards (inside modal) - matches diary_dashboard style */
.diary-card {
    background: white;
    border: 2px solid;
    border-radius: 8px;
    padding: 0.875rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.diary-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.diary-card-row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.diary-card-date {
    font-weight: 700;
    font-size: 0.875rem;
}

.diary-card-time {
    font-size: 0.8125rem;
    font-weight: 600;
}

.diary-card-jobref {
    margin-bottom: 0.375rem;
}

.diary-card-address {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.diary-card-details {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    flex-wrap: wrap;
}

.diary-card-access {
    margin-top: 0.5rem;
    padding: 0.375rem 0.5rem;
    background: rgba(245, 158, 11, 0.15);
    border-left: 3px solid #e7ebee;
    border-radius: 4px;
    font-size: 0.8125rem;
}

.diary-loading {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.diary-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.diary-detail-full {
    grid-column: 1 / -1;
}

.diary-detail-label {
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.diary-detail-value {
    color: #1f2937;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #5e8ab4;
}

.diary-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

@media (max-width: 768px) {
    .diary-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .diary-actions {
        flex-direction: column;
    }
}

/* ============================================
   STATUS MODAL
   ============================================ */
.status-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.status-modal.active {
    display: flex;
}

.status-modal-content {
    background: #e7ebee;
    border-radius: 6px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: statusModalSlideIn 0.3s ease;
}

@keyframes statusModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-modal-header {
    background: #96bee099;
    color: white;
    padding: 2rem;
    border-radius: 26px 26px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-modal-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
}

.status-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.status-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.status-modal-body {
    padding: 2rem;
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.alert-success {
    background: #d1fae5;
    color: #4d9367;
    border-left: 4px solid #d1fae5;
}

.alert-error,
.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: #fef3c7;
    color: #f3633f;
    border-left: 4px solid #fed7aa;
}

.alert-info {
    background: #dbeafe;
    color: #5e8ab4;
    border-left: 4px solid #bacdde;
}

.message {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.message.success {
    background: #d1fae5;
    color: #4d9367;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================
   LOADING & SPINNERS
   ============================================ */
.loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #81B0D9;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: #6b7280;
}

.text-small {
    font-size: 0.875rem;
}

.text-large {
    font-size: 1.125rem;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.hidden {
    display: none;
}

.visible {
    display: block;
}

/* ============================================
   DIARY DASHBOARD CALENDAR
   ============================================ */
body {
    text-transform: uppercase;
}

.diary-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem;
    margin-top: 3rem;
}

/* Page Header */
.page-header {
    background: #5e8ab4e6;
    color: white;
    padding: 1rem;
    border-radius: 26px;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/*.page-header::before {
    content: 'ðŸ“…';
    position: absolute;
    font-size: 8rem;
    opacity: 0.1;
    right: -2rem;
    top: -2rem;
    transform: rotate(-15deg);
}*/

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
}

.page-title-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.page-subtitle {
    font-size: 0.95rem;
    opacity: 0.95;
    margin: 0;
    white-space: nowrap;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.stat-card.today {
    border-left: 4px solid #5e8ab4;
}

.stat-card.week {
    border-left: 4px solid #5e8ab4;
}

.stat-card.pending {
    border-left: 4px solid #5e8ab4;
}

.stat-card.urgent {
    border-left: 4px solid #5e8ab4;
}

.stat-icon {
    display: none;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: #425876;
    margin: 0;
}

.stat-detail {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-left: auto;
}

/* Controls Bar */
.controls-bar {
    margin-bottom: 2rem;
}

.controls-left {
    display: flex;
    gap: 1rem 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.week-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-basis: 100%;
}

.week-nav button:not(.btn-create) {
    padding: 0.5rem 1rem;
    background: #5e8ab4e6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.week-nav button:not(.btn-create):hover {
    background: #4e7ca6;
    transform: scale(1.05);
}

.current-week {
    font-weight: 600;
    color: #1f2937;
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 6px;
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:hover {
    border-color: #acbac3;
}

.filter-select:focus {
    outline: none;
    border-color: #acbac3;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-results-display {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #374151;
    font-weight: 600;
}

.btn-create {
    padding: 0.75rem 2rem;
    background: #acbac3e6;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(125, 147, 161, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(125, 147, 161, 0.4);
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.day-column {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.day-header {
    background: #acbac3;
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 700;
    position: relative;
}

.day-header.today {
    background: #81b0d9;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

.day-name {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    opacity: 0.95;
}

.day-number {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.day-bookings {
    padding: 1rem;
    flex: 1;
}

.booking-card {
    background: white;
    border: 2px solid;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.booking-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.booking-time {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.booking-status {
    display: inline-block;
    padding: 0.1rem 0.1rem;
    border-radius: 1px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.05rem;
}

.booking-occupier {
    font-size: 0.75rem;
    font-weight: 500;
    color: #5e8ab4;
    margin-bottom: 0.15rem;
    line-height: 1.3;
}

.booking-address {
    font-size: 0.7rem;
    color: #1f2937;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.booking-client {
    font-size: 0.7rem;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.booking-assessors {
    font-size: 0.7rem;
    font-weight: 700;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
}

.btn-assign {
    background: none;
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 4px;
    padding: 0.15rem 0.35rem;
    cursor: pointer;
    font-size: 0.65rem;
    line-height: 1;
    transition: all 0.2s ease;
    color: #5e8ab4;
    flex-shrink: 0;
}

.btn-assign:hover {
    background: #96bee0;
    color: white;
    border-color: #5e8ab4;
    transform: scale(1.1);
}

.empty-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #9ca3af;
    font-style: italic;
    text-align: center;
}

.empty-day-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.3;
}

.loading-spinner {
    text-align: center;
    padding: 3rem;
}

.loading-spinner img {
    width: 80px;
    height: 80px;
}

/* Responsive */
@media (max-width: 1400px) {
    .calendar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .calendar-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   DIARY BOOKING VIEW (MODAL CONTENT)
   ============================================ */
/* Override modal-body padding for booking details modal */
#bookingModalBody {
    padding: 0 !important;
}

.booking-view {
    padding: 0;
}

.status-banner {
    padding: 1.5rem;
    text-align: center;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 0;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.info-section {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #e7ebee;
}

.info-section-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #5e8ab4;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-value.large {
    font-size: 1.25rem;
    font-weight: 600;
}

.assessor-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.assessor-card {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 2px solid #e7ebee;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.assessor-avatar {
    width: 50px;
    height: 50px;
    background: #c4ced4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
}

.assessor-info {
    flex: 1;
}

.assessor-name {
    font-weight: 700;
    color: #1f2937;
}

.assessor-email {
    font-size: 0.875rem;
    color: #6b7280;
}

.notes-section {
    background: #96bee04d;
    border: 2px solid #c4c4c4;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.notes-title {
    font-weight: 700;
    color: #5e8ab4;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notes-content {
    color: #33445b;
    line-height: 1.6;
    white-space: pre-wrap;
}

.btn-view-property {
    background: #5e8ab4;
    color: white;
}

.btn-view-property:hover {
    background: #4e7ca6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 124, 166, 0.4);
}

.btn-cancel {
    background: #ef4444;
    color: white;
}

.btn-cancel:hover {
    background: #ed3131;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.btn-site-sheet {
    background: #acbac3;
    color: white;
}

.btn-site-sheet:hover {
    background: #95a7b2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 167, 178, 0.4);
}

.empty-value {
    color: #9ca3af;
    font-style: italic;
}

/* ============================================
   SEARCH & AUTOCOMPLETE
   ============================================ */
.search-container {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: #f3f4f6;
}

.autocomplete-item strong {
    color: #5e8ab4;
}

/* ============================================
   PROPERTY VIEW SPECIFIC
   ============================================ */
body {
    text-transform: uppercase;
}

/* Phase Indicator */
.phase-indicator {
    background: #96bee0e6;
    color: white;
    padding: 1rem 1rem;
    border-radius: 26px;
    margin-bottom: 1rem;
    text-align: center;
}

.phase-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.phase-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
}

.phase-complete {
    background: #15864ce6;
}

/* Buttons - Edit/Delete */
.btn-edit {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #81B0D9;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-edit:hover {
    background: #629DD0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-delete {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-edit-small {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: #81B0D9;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-edit-small:hover {
    background: #629DD0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-delete-small {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: #ef4444;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-delete-small:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Card Styling */
.card.archived {
    border: 3px solid #ef4444;
    background: rgba(255, 255, 255, 0.95);
}

.archived-banner {
    background: #ef4444e6;
    color: white;
    padding: 1rem 1.5rem;
    margin: -2rem -2rem 1.5rem -2rem;
    border-radius: 5px 5px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.archived-banner-title {
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.archived-info-box {
    background: #fff;
    border: 2px solid #e7ebee;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.archived-info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.9375rem;
}

.archived-info-label {
    font-weight: 600;
    color: #ef4444;
}

.archived-info-value {
    color: #1f2937;
}

/* Property Overview */
.property-overview {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    align-items: start;
}

.property-address {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.stat-box {
    background: #f9fafb;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    text-align: center;
}

/* Current Info - Owner/Occupier/Agent */
.current-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
}

.info-item.owner {
    border-left: 4px solid #e7ebee;
}

.info-item.occupier {
    border-left: 4px solid #e7ebee;
}

.info-item.agent {
    border-left: 4px solid #e7ebee;
}

.info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.info-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.info-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.info-detail {
    font-size: 1rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.info-fund {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 600;
    margin-top: 0.25rem;
}

.history-btn {
    background: #81B0D9;
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.history-btn:hover {
    background: #629DD0;
}

.no-info {
    font-style: italic;
    color: #9ca3af;
}

.btn-add-inline {
    background: #5e8ab4;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.75rem;
    display: inline-block;
}

.btn-add-inline:hover {
    background: #4e7ca6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(78, 124, 166, 0.4);
}

/* Section Titles */
.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.current-badge {
    background: #4d9367;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Owner/Occupier/Agent Items */
.owner-item {
    border: 3px solid #e7ebee;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.occupier-item {
    border: 3px solid #96bee0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.agent-item {
    border: 3px solid #c4ced4;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.agent-main-line {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.agent-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
}

.agent-company {
    font-weight: 600;
    color: #6b7280;
}

.agent-position {
    color: #6b7280;
    font-style: italic;
}

.agent-contact-line {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.agent-notes-line {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: #4b5563;
}

/* Contact Sections */
.contact-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.contact-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.contact-info {
    background: #f9fafb;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.contact-name {
    font-weight: 600;
    color: #1f2937;
}

.contact-detail {
    color: #6b7280;
    margin-top: 0.25rem;
}

.contact-current {
    display: inline-block;
    background: #4d9367;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Job Items */
.job-item {
    border: 3px solid #e7ebee;
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
}

.job-right {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.owner-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 1.125rem;
}

.detail-text {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.fund-text {
    color: #1f2937;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.job-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.job-details {
    font-size: 0.9375rem;
    color: #4b5563;
}

.job-details div {
    margin: 0.375rem 0;
}

.job-details strong {
    color: #1f2937;
    font-weight: 700;
    font-size: 1rem;
}

/* Certificate & Folder Links */
.cert-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #5e8ab4;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
}

.cert-link:hover {
    background: #4e7ca6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* EPC Rating Badges */
.rating-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9375rem;
    border: 2px solid transparent;
}

.rating-a {
    background: #00A651;
    color: white;
    border-color: #00e0c6;
}

.rating-b {
    background: #19b459;
    color: white;
    border-color: #1dd76b;
}

.rating-c {
    background: #8cde46;
    color: white;
    border-color: #aae774;
}

.rating-d {
    background: #fdd500;
    color: white;
    border-color: #ffe033;
}

.rating-e {
    background: #fcaa65;
    color: white;
    border-color: #fdc79b;
}

.rating-f {
    background: #EF8023;
    color: white;
    border-color: #f29b54;
}

.rating-g {
    background: #e9153b;
    color: white;
    border-color: #ee4463;
}

/* Status Display */
.status-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.status-with-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-label {
    font-weight: 700;
    color: #1f2937;
    font-size: 0.9375rem;
}

.status-history-btn {
    background: transparent;
    color: #5e8ab4;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

.status-history-btn:hover {
    color: #4e7ca6;
}

.status-item {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #fafafa;
}

.status-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.status-date {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 600;
}

.status-with {
    color: #5e8ab4;
    font-weight: 600;
    font-size: 0.875rem;
}

.status-created-line {
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

.status-created-label {
    color: #6b7280;
    font-weight: 600;
}

.status-created-data {
    color: #49545b;
    font-style: italic;
}

.status-text {
    margin-top: 0.5rem;
    color: #1f2937;
    white-space: pre-wrap;
}

.history-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

/* Relationship Management Buttons */
.btn-add-relationship {
    background: #15864ccc;
    color: white;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
}

.btn-add-relationship:hover {
    background: #116a3c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.relationship-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.job-add-new-btn {
    background: transparent;
    color: #5e8ab4;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

.job-add-new-btn:hover {
    background: #4e7ca6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-add-contact {
    background: #5e8ab4;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.btn-add-contact:hover {
    background: #4e7ca6;
    transform: translateY(-1px);
}

.btn-edit-rel {
    background: #5e8ab4;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.btn-edit-rel:hover {
    background: #4e7ca6;
    transform: translateY(-1px);
}

.btn-end-rel {
    background: #eb1e1e;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.btn-end-rel:hover {
    background: #ce1212;
    transform: translateY(-1px);
}

.btn-delete-rel {
    background: #991b1b;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
}

.btn-delete-rel:hover {
    background: #7f1d1d;
    transform: translateY(-1px);
}

/* Status Labels */
.status-current {
    background: #d1fae5;
    color: #15864c;
    border: 1px solid #d1fae5;
}

.status-historical {
    background: #e5e7eb;
    color: #6b7280;
    border: 1px solid #9ca3af;
}

/* Modal specific for property view */
.modal.show {
    display: block;
}

.modal-content {
    background-color: rgba(255, 255, 255, 0.98);
    margin: 5% auto;
    padding: 0;
    border-radius: 26px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.modal-close {
    color: #9ca3af;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #1f2937;
}

/* ============================================
   STATUS MODAL
   ============================================ */
 /* Modal Overlay */
    .status-modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: auto;
        background-color: rgba(0, 0, 0, 0.5);
    }
    
    .status-modal.show {
        display: block;
    }
    
    /* Modal Content Box */
    .status-modal-content {
        background-color: white;
        margin: 5% auto;
        padding: 0;
        border-radius: 26px;
        width: 90%;
        max-width: 800px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    /* Modal Header */
    .status-modal-header{
        padding: 1.5rem 2rem;
        border-bottom: 1px solid #e5e7eb;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .status-modal-title {
        font-size: 1.5rem;
        font-weight: 600;
        color: #1f2937;
        margin: 0;
    }
    
    .status-modal-close {
        color: #9ca3af;
        font-size: 2rem;
        font-weight: bold;
        cursor: pointer;
        border: none;
        background: none;
        padding: 0;
        line-height: 1;
        transition: color 0.2s;
    }
    
    .status-modal-close:hover {
        color: #1f2937;
    }
    
    .status-modal-add-btn {
        background: #5e8ab4;
        color: white;
        padding: 0.5rem 1rem;
        border-radius: 6px;
        font-weight: 600;
        font-size: 0.875rem;
        cursor: pointer;
        border: none;
        transition: all 0.2s;
    }
    
    .status-modal-add-btn:hover {
        background: #4e7ca6;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    }
    
    /* Modal Body */
    .status-modal-body {
        padding: 2rem;
        max-height: 75vh;
        overflow-y: auto;
    }
    
    /* Status Items */
    .status-modal-item {
        border: 1px solid #e7ebee;
        border-radius: 6px;
        padding: 1rem;
        margin-bottom: 0.75rem;
        background: #fafafa;
    }
    
    .status-modal-item:last-child {
        margin-bottom: 0;
    }
    
    .status-modal-header2 {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 0.5rem;
        flex-wrap: wrap;
    }
    
    .status-modal-header-left {
        display: flex;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .status-modal-header-actions {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }
    
    .status-modal-action-btn {
        padding: 0.25rem 0.625rem;
        border-radius: 4px;
        font-size: 0.75rem;
        font-weight: 600;
        cursor: pointer;
        border: none;
        transition: all 0.2s;
        white-space: nowrap;
    }
    
    .status-modal-edit-btn {
        background: #81B0D9;
        color: white;
    }
    
    .status-modal-edit-btn:hover {
        background: #629DD0;
        transform: translateY(-1px);
    }
    
    .status-modal-delete-btn {
        background: #ef4444;
        color: white;
    }
    
    .status-modal-delete-btn:hover {
        background: #dc2626;
        transform: translateY(-1px);
    }
    
    .status-modal-date {
        font-size: 0.875rem;
        color: #6b7280;
        font-weight: 600;
    }
    
    .status-modal-with {
        color: #5e8ab4;
        font-weight: 600;
        font-size: 0.875rem;
    }
    
    .status-modal-description {
        background: #dce2e5;
        color: #6b7280;
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
        font-size: 0.75rem;
        font-weight: 600;
    }
    
    .status-modal-text {
        margin-top: 0.5rem;
        color: #1f2937;
        white-space: pre-wrap;
        line-height: 1.5;
    }
    
    .status-modal-loading {
        text-align: center;
        padding: 2rem;
        color: #6b7280;
    }
    
    .status-modal-error {
        text-align: center;
        padding: 2rem;
        color: #ef4444;
    }
    
    .status-modal-empty {
        text-align: center;
        padding: 2rem;
        color: #9ca3af;
        font-style: italic;
    }
    
    /* Created Line Styles */
    .status-modal-created-line {
        margin-top: 0.5rem;
        font-size: 0.75rem;
    }
    
    .status-modal-created-label {
        color: #6b7280;
        font-weight: 600;
    }
    
    .status-modal-created-data {
        color: #9ca3af;
        font-style: italic;
    }

/* ============================================
   JOB STATUS CREATE/EDIT SPECIFIC
   ============================================ */
.context-banner {
    background: #dbeafe;
    border: 2px solid #f3f4f6;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.context-info {
    display: block;
   
    text-align: center;
}

.context-label {
    font-size: 0.75rem;
    color: #4e7ca6;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    
}

.context-value {
    font-size: 1rem;
    font-weight: 600;
    color: black;
    align-items: center;
}

.context-detail {
    font-size: 0.875rem;
    color: black;
    margin-top: 0.25rem;
}

.latest-status-banner {
    background: #d1fae5;
    border: 2px solid #15864ccc;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.latest-status-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #15864c;
    margin-bottom: 0.5rem;
}

.latest-status-info {
    font-size: 0.875rem;
    color: #6b7280;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.form-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.form-label .required {
    color: #ef4444;
    margin-left: 0.25rem;
}

.form-help {
    font-size: 0.875rem;
    color: white;
    margin-top: 0.25rem;
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
}

/* ============================================
   DIARY BOOKING CREATE/EDIT SPECIFIC
   ============================================ */
.edit-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Custom Date & Time Section Layout */
.date-time-flex-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.date-time-flex-row .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0;
}

/* Fixed width for Date, Specific Time, and Status inputs */
.date-time-flex-row .form-group.narrow-input {
    flex: 0 0 200px;
    max-width: 200px;
}

/* Time Type buttons take remaining space but with flex basis */
.date-time-flex-row .form-group.time-type-container {
    flex: 1 1 400px;
    min-width: 400px;
}

.form-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #5e8ab4;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label.required::after {
    content: ' *';
    color: #ef4444;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Job Search Autocomplete */
.job-search-wrapper {
    position: relative;
}

.job-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.job-search-results.show {
    display: block;
}

.job-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.job-result-item:hover {
    background: #f9fafb;
}

.job-result-item:last-child {
    border-bottom: none;
}

.job-address {
    color: #1f2937;
    font-weight: 500;
}

.job-client {
    color: #1f2937;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.selected-job {
    background: #f0fdf4;
    border: 2px solid #4d9367;
    padding: 1rem;
    border-radius: 6px;
    margin-top: 0.5rem;
}

.selected-job-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.selected-job-clear {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.selected-job-clear:hover {
    background: #dc2626;
}

/* Time Type Radio Buttons */
.time-type-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.time-type-option {
    position: relative;
}

.time-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.time-type-label {
    display: block;
    padding: 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.time-type-option input[type="radio"]:checked + .time-type-label {
    background: #5e8ab4;
    color: white;
    border-color: #5e8ab4;
}

.time-type-label:hover {
    border-color: #5e8ab4;
}

.specific-time-input {
    margin-top: 0.75rem;
    display: none;
}

.specific-time-input.show {
    display: block;
}

/* Contact Quick Select */
.contact-quick-select {
    background: #e7ebee;
    border: 2px solid #c4ced4;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.contact-quick-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #5e8ab4;
    margin-bottom: 0.75rem;
}

.contact-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.contact-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #96bee0;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #5e8ab4;
    cursor: pointer;
    transition: all 0.2s;
}

.contact-btn:hover {
    background: #e7ebee;
}

.contact-btn.active {
    background: #5e8ab4;
    color: white;
}

/* Radio Groups */
.radio-group {
    display: flex;
    gap: 2rem;
}

.radio-option {
    display: flex;
    align-items: center;
}

.radio-option input[type="radio"] {
    margin-right: 0.5rem;
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
}

.radio-option label {
    cursor: pointer;
    font-weight: 500;
    color: #374151;
}

/* Status Dropdown Colors */
.status-option {
    padding: 0.5rem;
    border-radius: 4px;
}

/* Booking Info Display */
.booking-info {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.booking-info-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 600;
}

.booking-info-value {
    font-size: 1rem;
    color: #1f2937;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* ============================================
   DIAGNOSTIC PAGE
   ============================================ */
.test {
    background: white;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    border-left: 4px solid #ccc;
}

.test.pass {
    border-left-color: #4d936780;
}

.test.fail {
    border-left-color: #ef4444;
    background: #fee;
}

.test.warn {
    border-left-color: #f3633f;
    background: #fffbeb;
}

.error {
    color: #dc2626;
    font-weight: bold;
}

.success {
    color: #4d9367;
    font-weight: bold;
}

/* ============================================
   LOGIN PAGE SPECIFIC
   ============================================ */
body.login-page {
    /* Override default body styles for login page */
    padding-top: 0;
    background: url('Login-img768.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

@media (min-width: 769px) {
    body.login-page {
        background-image: url('Login-img1280.jpg');
    }
}

@media (min-width: 1025px) {
    body.login-page {
        background-image: url('Login-img-compressed.jpg');
        background-image: -webkit-image-set(
            url('Login-img.webp') type('image/webp'),
            url('Login-img-compressed.jpg') type('image/jpeg')
        );
        background-image: image-set(
            url('Login-img.webp') type('image/webp'),
            url('Login-img-compressed.jpg') type('image/jpeg')
        );
    }
}

/* ============================================
   ORIENTATION CONTROLS
   ============================================ */

/* Login page - Portrait only (show warning in landscape on mobile) */
@media screen and (orientation: landscape) and (max-width: 1024px) {
    body.login-page .login-container {
        display: none;  /* Hide login form in landscape */
    }
    
    body.login-page::after {
        content: '📱 Please rotate your device to portrait mode to login';
        display: flex;
        justify-content: center;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(102, 126, 234, 0.95);
        color: white;
        font-size: 1.5rem;
        text-align: center;
        padding: 2rem;
        z-index: 9999;
    }
}

/* Portrait mobile is now fully supported — no landscape-only warning needed */

/* Dark overlay for better readability */
body.login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(94, 138, 180, 0.4);
    z-index: 0;
}

.login-container {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.login-container .logo {
    text-align: center;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.7);
    padding: 1.5rem;
    border-radius: 8px;
}

.login-container .logo img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    margin-bottom: 0.05rem;
}

.login-container .logo h1 {
    font-size: 1.0rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.login-container .logo .crm-text {
    font-size: 1.375rem;
    color: #157439;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.login-container .logo .year-text {
    font-size: 0.6875rem;
    color: #6b7280;
    font-weight: 600;
    margin-left: 0.25rem;
}

.login-container .form-group {
    margin-bottom: 1.5rem;
}

.login-container .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 600;
    font-size: 0.875rem;
}

.login-container .form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s;
}

.login-container .form-group input:focus {
    outline: none;
    border-color: #4d9367;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.login-container .error-message {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.login-btn {
    width: 100%;
    padding: 0.875rem;
    background: #157439e6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.login-btn:hover {
    background: #0e5832;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 88, 49, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-container .footer-text {
    text-align: center;
    margin-top: 2rem;
    color: #6b7280;
    font-size: 0.8125rem;
}

/* ============================================
   PROPERTY DISPLAY BOX
   ============================================ */
.property-display-box {
    background: #f0fdf4;
    border: 2px solid #4d93674d;
    padding: 1rem;
    border-radius: 6px;
}

/* ============================================
   JOBS SECTION - SINGLE COLUMN LAYOUT
   ============================================ */
.card-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-header-inline h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
}

.btn-add-job {
    text-decoration: none;
    background: #4d9367;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-add-job:hover {
    background: #3f7854;
}

/* Job Item Container */
.job-item-single {
    background: #f0f4f8;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.job-item-single:last-child {
    margin-bottom: 0;
}

.job-item-single:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Job Single Line */
.job-single-line {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

/* Job Ref Badge */
.job-ref-badge {
    display: inline-block;
    background: #f1f8f9;
    color: #1f2937;
    padding: 0.375rem 0.875rem;
    border-radius: 6px;
    font-family: monospace;
    font-size: 1rem;
    font-weight: 700;
}

/* Job ID */
.job-id-label {
    color: #49545b;
    font-size: 0.875rem;
    font-weight: 600;
}

.job-id-value {
    color: #49545b;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Job Actions Right */
.job-actions-right {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

/* Job Labels & Values */
.job-label {
    color: #1f2937;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

.job-label-inline {
    margin-left: 1.5rem;
}

.job-value-client {
    display: inline-block;
    background: #5e8ab4cc;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.job-value-fund {
    display: inline-block;
    background: #5e8ab4cc;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.job-value-default {
    color: #49545b;
    font-weight: 600;
    font-size: 0.9375rem;
}

.job-ber-value {
    color: #49545b;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

/* Job Status Badge */
.job-status-badge {
    display: inline-block;
    background: #e8ebed;
    color: #49545b;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-right: 0.75rem;
}

.job-with-value {
   display: inline-block;
    background: #e8ebed;
    color: #49545b;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Job Count Badge */
.job-count-badge {
    color: #5e8ab4;
    font-weight: 700;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Rating Badge (EPC/Draft) */
.rating-badge {
    display: inline-block;
    background: #4d9367;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 700;
    margin-right: 0.75rem;
}

/* Rating Badge Colors by Letter Grade */
.rating-badge-a {
    background: #00c680;  /* Pastel Green - Most efficient */
    color: #49545B;
}

.rating-badge-b {
    background: #19b459;  /* Light Mint-Green - Very efficient */
    color: #49545B;
}

.rating-badge-c {
    background: #8cde46;  /* Pastel Yellow-Green - Good */
    color: #49545B;
}

.rating-badge-d {
    background: #ffd500;  /* Soft Pastel Yellow - Average */
    color: #49545B;
}

.rating-badge-e {
    background: #fcaa65;  /* Pastel Orange - Below average */
    color: #49545B;
}

.rating-badge-f {
    background: #ef8023;  /* Pastel Red-Orange - Poor */
    color: #49545B;
}

.rating-badge-g {
    background: #e9153b;  /* Pastel Red - Least efficient */
    color: #49545B;
}

/* No Status Text */
.no-status-text {
    color: #9ca3af;
}

/* Parent Property Label */
.parent-label {
    color: #1f2937;
    font-weight: 600;
    font-size: 0.875rem;
    margin-left: 0.75rem;
    margin-right: 0.5rem;
}

/* Parent Property Button */
.parent-property-btn {
    display: inline-block;
    background: #81b0d9;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9375rem;
    font-weight: 700;
    border: 2px solid #72a7d5;
    cursor: pointer;
    transition: all 0.2s;
}

.parent-property-btn:hover {
    background: #629dd0;
}

/* Job Line Containers */
.job-line-1 {
    margin-bottom: 0.5rem;
}

.job-line-2 {
    margin-bottom: 0.5rem;
    margin-left: 1rem;
}

.job-line-3 {
    margin-left: 1rem;
}

.job-line-4 {
    margin-left: 1rem;
    margin-top: 0.25rem;
}

/* Create Job Button */
.btn-create-job {
    text-decoration: none;
    background: #81B0D9;
}


/* Job Button Row */
.job-button-row {
    display: flex;
    gap: 0.75rem;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}

.btn-status-history:hover {
    background: #bfdbfe;
}

.btn-add-status {
    text-decoration: none;
    display: inline-block;
    background: #4d9367;
    color: white;
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-add-status:hover {
    background: #3f7854;
}

/* Job Folder Row */
.job-folder-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}

/* Job No Status */
.job-no-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: #e8ebed;
    border-radius: 6px;
}

.no-status-text {
    color: #49545b;
    font-weight: 600;
    font-size: 0.875rem;
}

.btn-add-first-status {
    text-decoration: none;
    background: #4d9367;
    color: white;
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-add-first-status:hover {
    background: #3f7854;
}

/* Certificates Section */
.job-certificates {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e5e7eb;
}

.certificates-label {
    color: #1f2937;
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.cert-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    min-height: 60px;
}

.cert-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cert-epc {
    background: #5e8ab4;
}

.cert-epc:hover {
    background: #4e7ca6;
}

.cert-dec {
    background: #15864c;
}

.cert-dec:hover {
    background: #116a3c;
}

.cert-ac {
    background: #acbac3;
}

.cert-ac:hover {
    background: #95a7b2;
}

/* Certificate Item Container */
.cert-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Certificate Print Button */
.cert-print-btn {
    padding: 0.5rem 0.75rem;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.cert-print-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

/* Certificate Status Message */
.cert-status {
    min-height: 20px;
}

.cert-number {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.no-certificates {
    display: inline-block;
    padding: 0.75rem 1rem;
    background: #fadfdf;
    color: #ef4444;
    border: 1px solid #ef4444;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
}

/* ============================================
   ALERT MESSAGES
   ============================================ */
.alert-success-inline {
    background: #d1fae5;
    border: 2px solid #4d93674d;
    color: #15864c;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.alert-error-inline {
    background: #fee2e2;
    border: 2px solid #ef4444;
    color: #991b1b;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.info-box-grey {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

/* ============================================
   ICON BUTTONS (EDIT/DELETE)
   ============================================ */
.btn-icon-edit,
.btn-icon-delete {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon-edit {
    background: #dbeafe;
    color: #4e7ca6;
}

.btn-icon-edit:hover {
    background: #bfdbfe;
    transform: scale(1.1);
}

.btn-icon-delete {
    background: #fee2e2;
    color: #991b1b;
}

.btn-icon-delete:hover {
    background: #fecaca;
    transform: scale(1.1);
}

/* ============================================
   PAGINATION CONTROLS
   ============================================ */
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: #4d9367;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    min-width: 80px;
    transition: background 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: #3f7854;
}

.pagination-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.pagination-info {
    text-align: center;
    min-width: 140px;
}

.pagination-info-current {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1f2937;
}

.pagination-info-total {
    font-size: 0.8rem;
    color: #6b7280;
}

/* Compact pagination for inline use */
.user-pagination-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-pagination-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pagination-controls-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    justify-content: space-between;
}

.pagination-btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: #4d9367;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    min-width: 32px;
    transition: background 0.2s;
}

.pagination-btn-sm:hover:not(:disabled) {
    background: #3f7854;
}

.pagination-btn-sm:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.pagination-info-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
    line-height: 1.2;
}

.pagination-info-compact .pagination-info-current {
    font-size: 0.85rem;
    font-weight: 700;
}

.pagination-info-compact .pagination-info-total {
    font-size: 0.7rem;
}

/* Filter labels */
.filter-label {
    display: block;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

/* Job search box container */
.job-search-box-container {
    background: #f0f9ff;
    border: 2px solid #bae6fd;
    border-radius: 8px;
    padding: 1rem;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    header,
    .logout-btn,
    .btn,
    button,
    .dropdown {
        display: none;
    }
    
    body {
        background: white;
        padding-top: 0;
    }
    
    .container {
        max-width: 100%;
    }
}

/* ============================================
   CLIENT EDIT PAGE STYLES
   ============================================ */

/* Property/Client search wrapper */
.property-search-wrapper {
    position: relative;
}

/* Alert icon */
.alert-icon {
    font-size: 1.5rem;
}

/* Alert redirect message */
.alert-redirect {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* Uppercase input fields */
.input-uppercase {
    text-transform: uppercase;
}

/* Search dropdown container */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-dropdown.show {
    display: block;
}

/* Search result item */
.search-result-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.search-result-item:hover {
    background: #f3f4f6;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Search result ref badge */
.search-result-ref {
    background: #dbeafe;
    color: #4e7ca6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Search result name */
.search-result-name {
    flex: 1;
    color: #374151;
}

/* No results message */
.search-no-results {
    padding: 0.75rem;
    color: #9ca3af;
}

/* Fund section styles */
.fund-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.fund-input-wrapper {
    flex: 1;
    position: relative;
}

.fund-add-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Fund confirm panel */
.fund-confirm-panel {
    display: none;
    margin-top: 0.75rem;
    padding: 1rem;
    background: #fef3c7;
    border: 1px solid #87c248;
    border-radius: 6px;
}

.fund-confirm-panel.show {
    display: block;
}

.fund-confirm-text {
    margin: 0 0 0.75rem 0;
    color: #15864c;
}

.fund-confirm-buttons {
    display: flex;
    gap: 0.5rem;
}

/* No funds display */
.no-funds-display {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

/* Metadata section */
.form-section-meta {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

/* Hidden form */
.hidden-form {
    display: none;
}

/* Button nowrap */
.btn-nowrap {
    white-space: nowrap;
}

/* Manager-only field restrictions */
.manager-restricted {
    background-color: #f3f4f6;
    color: #6b7280;
    border-color: #d1d5db;
}

.manager-restricted:focus {
    background-color: #fff;
    color: #111827;
}

.manager-only-badge {
    display: inline-block;
    background: #fef4eb;
    color: #f68128;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    font-weight: 500;
}

/* ============================================
   CONTACT SEARCH PAGE
   ============================================ */
.cs-container {
    max-width: 1000px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.cs-header {
    background: #5e8ab4e6;
    color: white;
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    text-align: center;
}

.cs-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cs-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0.25rem 0 0 0;
}

.cs-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.cs-input-wrapper {
    position: relative;
}

.cs-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #9ca3af;
}

.cs-input-icon::before {
    content: '\1F50D';
}

.cs-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 2px solid #c4ced4;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background: white;
}

.cs-input:focus {
    outline: none;
    border-color: #ACBAC3;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.cs-help-text {
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* Results Header & Filters */
.cs-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cs-results-count {
    font-weight: 700;
    color: #1f2937;
    font-size: 1rem;
}

.cs-filter-tabs {
    display: flex;
    gap: 0.5rem;
}

.cs-filter-tab {
    padding: 0.375rem 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    background: white;
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cs-filter-tab:hover {
    border-color: #5e8ab4;
    color: #5e8ab4;
}

.cs-filter-tab.active {
    background: #5e8ab4;
    border-color: #5e8ab4;
    color: white;
}

/* Results Grid */
.cs-results-grid {
    display: grid;
    gap: 1rem;
}

/* Contact Cards */
.cs-contact-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cs-contact-card:hover {
    border-color: #96bee0;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.cs-contact-header {
    margin-bottom: 0.5rem;
}

.cs-contact-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cs-contact-company {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 0.125rem;
}

.cs-contact-position {
    color: #9ca3af;
    font-size: 0.85rem;
    font-style: italic;
}

/* Status Badges */
.cs-status-current {
    display: inline-block;
    background: #d1fae5;
    color: #15864ccc;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    letter-spacing: 0.03em;
}

.cs-status-inactive {
    display: inline-block;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    letter-spacing: 0.03em;
}

/* Contact Details */
.cs-contact-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.cs-contact-detail {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #4b5563;
    font-size: 0.875rem;
}

.cs-contact-detail-icon {
    color: #9ca3af;
    font-size: 0.85rem;
}

/* Properties Section */
.cs-properties-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

.cs-properties-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cs-property-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.cs-property-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s;
}

.cs-property-item:hover {
    background: #eff6ff;
}

.cs-badge-current {
    display: inline-block;
    background: #d1fae5;
    color: #15864c;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.375rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.cs-badge-historical {
    display: inline-block;
    background: #fed7aa;
    color: #db7706e6;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.375rem;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Empty State */
.cs-empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.cs-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.cs-empty-icon::before {
    content: '\1F50D';
}

.cs-empty-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.25rem;
}

.cs-empty-help {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Loading State */
.cs-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.cs-loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #e5e7eb;
    border-top-color: #96bee0;
    border-radius: 50%;
    animation: cs-spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes cs-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 640px) {
    .cs-container {
        padding: 0 0.5rem;
    }

    .cs-header {
        padding: 1rem;
    }

    .cs-title {
        font-size: 1.375rem;
    }

    .cs-card {
        padding: 1rem;
    }

    .cs-results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cs-filter-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .cs-contact-details {
        flex-direction: column;
        gap: 0.375rem;
    }

    .cs-contact-name {
        font-size: 1rem;
    }
}

/* ============================================
   RADIUS SEARCH (rs-)
   ============================================ */

/* Search Card */
.rs-search-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.rs-search-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.rs-postcode-group {
    flex: 0 0 220px;
}

.rs-postcode-input-wrap {
    position: relative;
}

.rs-postcode-input {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-right: 2.5rem !important;
}

.rs-postcode-status {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.rs-postcode-status.rs-valid {
    color: #4d9367;
}

.rs-postcode-status.rs-invalid {
    color: #ef4444;
}

/* Radius Slider */
.rs-radius-group {
    flex: 0 0 240px;
}

.rs-radius-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rs-radius-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.rs-radius-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #81B0D9;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(50, 0, 250, 0.3);
    transition: box-shadow 0.2s;
}

.rs-radius-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 2px 8px rgba(50, 0, 250, 0.5);
}

.rs-radius-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #5e8ab4;
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 4px rgba(50, 0, 250, 0.3);
}

.rs-radius-value {
    font-weight: 700;
    font-size: 0.9375rem;
    color: #81B0D9;
    white-space: nowrap;
    min-width: 65px;
    text-align: right;
}

/* Status Filter */
.rs-status-group {
    flex: 1;
    min-width: 180px;
}

/* Search Button */
.rs-search-btn-group {
    flex: 0 0 auto;
}

.rs-search-btn {
    padding: 0.625rem 2rem !important;
    font-size: 1rem !important;
    white-space: nowrap;
}

/* Results Card */
.rs-results-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.rs-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rs-results-summary {
    font-size: 0.9375rem;
    color: #374151;
}

.rs-results-count {
    font-size: 0.875rem;
    font-weight: 700;
    color: #6b7280;
    background: #CCBFFE33;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

/* Results Table */
.rs-results-table-wrap {
    overflow-x: auto;
}

.rs-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.rs-results-table thead th {
    background: #f9fafb;
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 700;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.rs-results-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.rs-results-table tbody tr:hover {
    background: #f0f0ff;
}

.rs-results-table td {
    padding: 0.625rem 0.75rem;
    vertical-align: middle;
}

.rs-th-distance { width: 70px; text-align: center; }
.rs-th-address { min-width: 250px; }
.rs-th-postcode { width: 100px; }
.rs-th-jobref { width: 140px; }
.rs-th-status { width: 150px; }

.rs-td-distance { text-align: center; }
.rs-td-postcode { font-family: monospace; font-weight: 600; color: #6b7280; }
.rs-td-jobref { font-family: monospace; font-size: 0.8125rem; }

.rs-td-address a {
    color: #1f2937;
    text-decoration: none;
}

.rs-td-address a:hover {
    color: #5e8ab4;
    text-decoration: underline;
}

.rs-td-jobref a {
    color: #5e8ab4;
    text-decoration: none;
    font-weight: 600;
}

.rs-td-jobref a:hover {
    text-decoration: underline;
}

/* Distance Badges */
.rs-distance-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8125rem;
    min-width: 45px;
    text-align: center;
}

.rs-dist-near {
    background: #1574394d;
    color: #374151;
}

.rs-dist-mid {
    background: #ffa5004d;
    color: #374151;
}

.rs-dist-far {
    background: #bf22224d;
    color: #374151;
}

/* Status Badge */
.rs-status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #f3f4f6;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rs-no-job {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.8125rem;
}

/* Loading */
.rs-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 3rem;
    color: #6b7280;
    font-size: 0.9375rem;
}

.rs-loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #e5e7eb;
    border-top-color: #5e8ab4;
    border-radius: 50%;
    animation: rs-spin 0.8s linear infinite;
}

@keyframes rs-spin {
    to { transform: rotate(360deg); }
}

/* No Results */
.rs-no-results {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
    font-size: 0.9375rem;
    font-style: italic;
}

/* Error */
.rs-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .rs-search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .rs-postcode-group,
    .rs-radius-group,
    .rs-status-group {
        flex: 1 1 100%;
    }

    .rs-search-btn-group {
        flex: 1 1 100%;
    }

    .rs-search-btn {
        width: 100%;
    }

    .rs-results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .rs-th-address { min-width: 180px; }
}

/* ============================================
   DIARY CONTACT PICKER (dcp-)
   ============================================ */

/* Search Wrapper */
.dcp-search-wrapper {
    position: relative;
}

.dcp-search-input {
    padding-right: 2.5rem !important;
}

/* Search Results Dropdown */
.dcp-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.dcp-search-results.show {
    display: block;
}

/* Result Items */
.dcp-result-item {
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.dcp-result-item:last-child {
    border-bottom: none;
}

.dcp-result-item:hover {
    background: #f0f0ff;
}

.dcp-result-item.dcp-no-results {
    color: #9ca3af;
    cursor: default;
    font-style: italic;
}

.dcp-result-item.dcp-no-results:hover {
    background: white;
}

.dcp-result-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9rem;
}

.dcp-result-detail {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 0.125rem;
}

/* Selected Contact Display */
.dcp-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.dcp-selected-info {
    flex: 1;
    min-width: 0;
}

.dcp-selected-name {
    font-weight: 700;
    color: #96bee0;
    font-size: 0.9375rem;
}

.dcp-selected-detail {
    font-size: 0.8125rem;
    color: #4d9367;
}

.dcp-clear-btn {
    background: none;
    border: 1px solid #fca5a5;
    color: #dc2626;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.dcp-clear-btn:hover {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================
   HELP PAGE (help-)
   ============================================ */

/* Content Wrapper */
.help-content-wrapper {
    background: rgba(240, 241, 243, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 1.5rem;
}

/* Search Card */
.help-search-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.help-search-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.help-search-input:focus {
    outline: none;
    border-color: #acbac3;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* Table of Contents Grid */
.help-toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.help-toc-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    cursor: pointer;
}

.help-toc-item:hover {
    border-color: #5e8ab4;
    background: #eff6ff;
    color: #5e8ab4;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.help-toc-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.help-toc-label {
    flex: 1;
    min-width: 0;
}

/* Accordion Sections */
.help-section {
    margin-bottom: 0.75rem;
}

.help-accordion-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
    font-size: inherit;
}

.help-accordion-btn:hover {
    border-color: #81B0D9;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.help-section.open .help-accordion-btn {
    border-color: #c4ced4;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background: #749abe;
    color: white;
}

.help-accordion-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
}

.help-section.open .help-accordion-title {
    color: white;
}

.help-accordion-icon {
    font-size: 1.25rem;
}

.help-accordion-arrow {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    color: #6b7280;
}

.help-section.open .help-accordion-arrow {
    transform: rotate(180deg);
    color: white;
}

/* Accordion Content Panel */
div.help-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid transparent;
    border-top: none;
    border-radius: 0 0 10px 10px;
}

.help-section.open .help-accordion-content {
    border-color: #c4ced4;
}

.help-accordion-content-inner {
    padding: 1.5rem;
}

/* Help Topic Blocks */
.help-topic {
    margin-bottom: 1.25rem;
}

.help-topic:last-child {
    margin-bottom: 0;
}

.help-topic-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-topic p,
.help-topic ul {
    color: #4b5563;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0 0 0.75rem 0;
}

.help-topic ul {
    padding-left: 1.5rem;
}

.help-topic li {
    margin-bottom: 0.375rem;
}

/* Help Tips */
.help-tip {
    background: #dbeafe;
    color: #4e7ca6;
    border-left: 4px solid #5e8ab4;
    padding: 0.875rem 1rem;
    border-radius: 0 6px 6px 0;
    margin: 0.75rem 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.help-tip strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* Help Workflow Steps */
.help-steps {
    counter-reset: help-step;
    padding: 0;
    list-style: none;
    margin: 0.75rem 0;
}

.help-steps li {
    counter-increment: help-step;
    padding: 0.5rem 0 0.5rem 2.5rem;
    position: relative;
    margin-bottom: 0.25rem;
    color: #4b5563;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.help-steps li::before {
    content: counter(help-step);
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 1.75rem;
    height: 1.75rem;
    background: #81B0D9;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Back to Top Button */
.help-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #5e8ab4;
    color: white;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    opacity: 0;
    transform: translateY(1rem);
    transition: all 0.3s ease;
    z-index: 100;
}

.help-back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.help-back-to-top:hover {
    background: #4e7ca6;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .help-toc-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .help-accordion-btn {
        padding: 0.875rem 1rem;
    }

    .help-accordion-title {
        font-size: 1rem;
    }

    .help-accordion-content-inner {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .help-toc-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   STAFF MANAGEMENT PAGE (sm-)
   ============================================ */

/* Stats bar */
.sm-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.sm-stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sm-stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1f2937;
}

.sm-stat-label {
    font-size: 0.8125rem;
    color: #000000;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Table wrapper */
.sm-table-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 580px; /* ~15 rows + header */
    position: relative;
}

/* Table */
.sm-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
}

.sm-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

.sm-table thead th {
    background: #f1f5f9;
    border-bottom: 2px solid #e2e8f0;
}

.sm-table th {
    padding: 0.625rem 0.5rem;
    text-align: left;
    font-weight: 700;
    color: #475569;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border-right: 1px solid #e2e8f0;
}

.sm-table th:last-child {
    border-right: none;
}

.sm-table td {
    padding: 0.25rem;
    border-bottom: 1px solid #f1f5f9;
    border-right: 1px solid #f1f5f9;
    vertical-align: middle;
    background: white;
    white-space: nowrap;
}

.sm-table td:last-child {
    border-right: none;
}

.sm-table tbody tr:hover td {
    background: #f8fafc;
}

/* Frozen left-hand columns (ID and Initials) */
.sm-table th.sm-frozen-left-1,
.sm-table td.sm-frozen-left-1 {
    position: sticky;
    left: 0;
    z-index: 5;
}

.sm-table th.sm-frozen-left-2,
.sm-table td.sm-frozen-left-2 {
    position: sticky;
    left: 50px; /* width of ID column */
    z-index: 5;
    border-right: 2px solid #cbd5e1;
}

.sm-table thead th.sm-frozen-left-1,
.sm-table thead th.sm-frozen-left-2 {
    z-index: 25; /* above both sticky header and sticky columns */
}

.sm-table td.sm-frozen-left-1,
.sm-table td.sm-frozen-left-2 {
    background: #fefefe;
}

.sm-table tbody tr:hover td.sm-frozen-left-1,
.sm-table tbody tr:hover td.sm-frozen-left-2 {
    background: #f0f4f8;
}

/* Inactive staff row */
.sm-row-inactive {
    opacity: 0.5;
}

.sm-row-inactive:hover {
    opacity: 0.75;
}

/* Inline inputs */
.sm-table input[type="text"],
.sm-table input[type="number"],
.sm-table input[type="date"] {
    width: auto;
    min-width: 60px;
    padding: 0.375rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    font-size: 0.8125rem;
    font-family: inherit;
    color: #1f2937;
    box-sizing: border-box;
    transition: all 0.15s;
}

.sm-table input[type="text"]:focus,
.sm-table input[type="number"]:focus,
.sm-table input[type="date"]:focus {
    outline: none;
    border-color: #5e8ab4;
    background: white;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.sm-table input[type="text"]:hover,
.sm-table input[type="number"]:hover,
.sm-table input[type="date"]:hover {
    border-color: #d1d5db;
    background: white;
}

/* Read-only ID cell */
.sm-table .sm-readonly {
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
    color: #9ca3af;
    font-weight: 600;
}

/* Select dropdown */
.sm-table select {
    width: 100%;
    padding: 0.375rem 0.375rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    font-size: 0.8125rem;
    font-family: inherit;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.15s;
}

.sm-table select:focus {
    outline: none;
    border-color: #96bee0;
    background: white;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.sm-table select:hover {
    border-color: #d1d5db;
    background: white;
}

/* Checkboxes */
.sm-table input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
    accent-color: #5e8ab4;
}

/* Cell save states */
.sm-cell-saving {
    background: #fef9c3 !important;
    transition: background 0.2s;
}

.sm-cell-success {
    background: #d1fae5 !important;
    transition: background 0.2s;
}

.sm-cell-error {
    background: #fee2e2 !important;
    transition: background 0.2s;
}

/* Password reset */
.sm-password-cell {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.375rem;
}

.sm-btn-reset {
    padding: 0.25rem 0.625rem;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.sm-btn-reset:hover {
    background: #4b5563;
}

.sm-password-input {
    width: 120px;
    padding: 0.25rem 0.5rem;
    border: 2px solid #5e8ab4;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-family: inherit;
    display: none;
}

.sm-password-input.visible {
    display: inline-block;
}

.sm-btn-confirm {
    padding: 0.25rem 0.5rem;
    background: #4d9367;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: none;
    white-space: nowrap;
}

.sm-btn-confirm.visible {
    display: inline-block;
}

.sm-btn-confirm:hover {
    background: #3f7854;
}

.sm-btn-cancel-pw {
    padding: 0.25rem 0.5rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: none;
    white-space: nowrap;
}

.sm-btn-cancel-pw.visible {
    display: inline-block;
}

.sm-btn-cancel-pw:hover {
    background: #dc2626;
}

/* Toast notification */
.sm-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateY(1rem);
    transition: all 0.3s ease;
    pointer-events: none;
}

.sm-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.sm-toast-success {
    background: #d1fae5;
    color: #15864c;
    border-left: 4px solid #4d9367;
}

.sm-toast-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

/* Search Bar */
.sm-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sm-search-input {
    flex: 1;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.sm-search-input:focus {
    border-color: #c4ced4;
    box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.15);
}

.sm-search-count {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

/* Sortable Headers */
.sm-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sm-sortable:hover {
    background: #1e3a8a;
}

.sm-sort-icon {
    font-size: 11px;
    opacity: 0.7;
}

.sm-sorted-asc .sm-sort-icon,
.sm-sorted-desc .sm-sort-icon {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .sm-stats {
        flex-direction: column;
    }

    .sm-stat-card {
        width: 100%;
    }

    .sm-search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .sm-search-input {
        max-width: 100%;
    }
}

/* ============================================
   PORTRAIT MOBILE (≤ 480px) — DASHBOARD
   Assessors use phones in portrait on-site.
   ============================================ */
@media (max-width: 480px) {

    /* Tighter container */
    .container {
        padding: 0.5rem;
        margin-top: 0.5rem;
    }

    /* Tighter card padding */
    .card {
        padding: 0.75rem;
        margin-bottom: 0.5rem;
    }

    /* Card header: smaller gap so buttons don't push content off-screen */
    .card-header {
        gap: 0.375rem;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }

    /* Smaller diary/action buttons so two fit in a portrait card header */
    .btn-view-diary {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }

    /* Stack job item: details on top, action buttons below */
    .job-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    /* Action buttons: 2-column grid, touch-friendly minimum height */
    .job-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.375rem;
        margin-left: 0;
    }

    /* Ensure buttons fill their grid cell */
    .job-actions .view-btn,
    .job-actions .status-btn,
    .job-actions .folder-btn,
    .job-actions .site-sheet-btn {
        min-height: 44px;
        font-size: 0.8rem;
        padding: 0.375rem 0.25rem;
        white-space: normal;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Remove indentation wasted on narrow screens */
    .job-line-2,
    .job-line-3,
    .job-line-4 {
        margin-left: 0;
    }

    /* Full-width job search box */
    .job-search-box {
        width: 100%;
    }

    /* Job search controls wrap onto multiple lines */
    .job-search-controls {
        flex-wrap: wrap;
    }

    /* Report filter: 2 columns on portrait (overrides inline 4-col style) */
    .report-filter-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Prevent any element causing horizontal scroll */
    body {
        overflow-x: hidden;
    }
}