/* ============================================
   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;
    background-image: url('background-768.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    padding-top: 60px;
}

@media (min-width: 769px) {
    body {
        background-image: url('background-1280.jpg');
    }
}

@media (min-width: 1281px) {
    body {
        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, #3200FA99 0%, #3200FA99 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: #10b981; 
    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: #059669;
}

.dropdown-toggle.contacts {
    background: #f59e0b;
}

.dropdown-toggle.contacts:hover {
    background: #d97706;
}

.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: 1rem 1.25rem;
    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.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.logout-btn {
    color: white;
    text-decoration: none;
    background: #ef4444;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.2s;
    display: inline-block;
}

.logout-btn:hover {
    background: #dc2626;
}

.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(50, 0, 250, 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: #fef3c7;
        border: 3px solid #f59e0b;
        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 #f59e0b;
        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: #d97706;
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 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: #059669; }
    .validation-status.warning { color: #d97706; }
    .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 #3b82f6;
        border-radius: 4px;
        text-align: center;
        width: 100%;
    }
    
    .btn-lookup-royal-mail {
        padding: 0.625rem 1.5rem;
        background: #e53935;
        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: #c62828;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(229, 57, 53, 0.3);
    }
    
    .btn-lookup-royal-mail:active {
        transform: translateY(0);
    }
    
    .postcode-confirm-btn {
        padding: 0.75rem 1.5rem;
        background: #10b981;
        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: #059669;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    }
    
    .postcode-info-box {
        background: white;
        border: 2px solid #10b981;
        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: #059669;
        margin-bottom: 0.375rem;
        font-size: 0.9375rem;
    }
    
    .postcode-info-detail {
        font-size: 0.8125rem;
        color: #6b7280;
        margin: 0.1875rem 0;
    }


/* ============================================
   CONTAINERS
   ============================================ */
.container { 
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 2rem; 
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
}

/* ============================================
   DASHBOARD 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: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-badge {
    background: #2563eb;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.subtitle-badge {
    background: #3b82f6;
    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;
    transition: all 0.2s;
}

.user-select:hover {
    border-color: #2563eb;
}

.user-select:focus {
    outline: none;
    border-color: #2563eb;
    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: #2563eb;
    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: #2563eb;
}

.result-limit-select:focus {
    outline: none;
    border-color: #2563eb;
    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: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-form button {
    padding: 0.75rem 2rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.search-form button:hover {
    background: #1d4ed8;
    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: #2563eb;
    transform: translateX(4px);
}

.property-info {
    flex: 1;
}

.property-ref {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    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: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.view-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.status-btn {
    padding: 0.5rem 1.25rem;
    background: #f59e0b;
    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;
}

.status-btn:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.job-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Job Item */
.jobs-scroll-container {
    max-height: 470px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.5rem;
}

.job-item {
    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;
    gap: 1rem;
}

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

.job-item:hover {
    background: #f3f4f6;
    border-color: #2563eb;
    transform: translateX(4px);
}

/* Properties with no jobs - distinct styling */
.no-jobs-property {
    background: #fef2f2;
    border-color: #fca5a5;
    border-left: 4px solid #dc2626;
}

.no-jobs-property:hover {
    background: #fee2e2;
    border-color: #dc2626;
}

/* Archived properties - distinct styling */
.archived-property {
    background: #fef3c7;
    border-color: #fbbf24;
    border-left: 4px solid #f59e0b;
    opacity: 0.85;
}

.archived-property:hover {
    background: #fde68a;
    border-color: #f59e0b;
    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: #fbbf24;
    color: #78350f;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.built-badge {
    display: inline-block;
    background: #92400e;
    color: #fef3c7;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 700;
    font-family: monospace;
}

.built-badge.unknown {
    background: #6b7280;
    color: #f3f4f6;
    font-style: italic;
    font-weight: 600;
}

/* 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: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-generate {
    background: #10b981;
    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: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-view-diary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    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: #8b5cf6;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.folder-link:hover {
    background: #7c3aed;
    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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    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: black;
    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="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="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: #2563eb;
    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: #2563eb;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
    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: #f59e0b;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
}

.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: #fef3c7;
    color: #92400e;
}

.badge-confirmed {
    background: #d1fae5;
    color: #065f46;
}

.badge-completed {
    background: #dbeafe;
    color: #1e40af;
}

.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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    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: #10b981;
    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: #059669;
    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-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: #3b82f6;
    color: white;
}

.status-edit-btn:hover {
    background: #2563eb;
    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: #2563eb;
    font-weight: 600;
    font-size: 0.875rem;
}

.status-description {
    background: #fbbf24;
    color: #78350f;
    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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    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 #2563eb;
}

.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: #2563eb;
    color: white;
}

.booking-btn-primary:hover {
    background: #1d4ed8;
    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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    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;
}

.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 #2563eb;
}

.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: white;
    border-radius: 16px;
    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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 16px 16px 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: #065f46;
    border-left: 4px solid #10b981;
}

.alert-error,
.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #2563eb;
}

.message {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
}

.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 #2563eb;
    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;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
}

.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: 800;
    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 #3b82f6;
}

.stat-card.week {
    border-left: 4px solid #8b5cf6;
}

.stat-card.pending {
    border-left: 4px solid #f59e0b;
}

.stat-card.urgent {
    border-left: 4px solid #ef4444;
}

.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: 800;
    color: #1f2937;
    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: #f3f4f6;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.week-nav button:not(.btn-create):hover {
    background: #e5e7eb;
    transform: scale(1.05);
}

.current-week {
    font-weight: 700;
    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: #667eea;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    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: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 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(16, 185, 129, 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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 700;
}

.day-header.today {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

.day-name {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    opacity: 0.95;
}

.day-number {
    font-size: 1rem;
    font-weight: 800;
    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-address {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.booking-client {
    font-size: 0.7rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.booking-assessors {
    font-size: 0.7rem;
    font-weight: 700;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.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;
    gap: 1rem;
    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 #667eea;
}

.info-section-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-value.large {
    font-size: 1.25rem;
    font-weight: 700;
}

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

.assessor-card {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 2px solid #667eea;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.assessor-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    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: #fffbeb;
    border: 2px solid #fbbf24;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.notes-title {
    font-weight: 700;
    color: #92400e;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notes-content {
    color: #78350f;
    line-height: 1.6;
    white-space: pre-wrap;
}

.btn-view-property {
    background: #8b5cf6;
    color: white;
}

.btn-view-property:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.btn-cancel {
    background: #ef4444;
    color: white;
}

.btn-cancel:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 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: #2563eb;
}

/* ============================================
   PROPERTY VIEW SPECIFIC
   ============================================ */
body {
    text-transform: uppercase;
}

/* Phase Indicator */
.phase-indicator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1rem;
    border-radius: 6px;
    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: #10b981;
}

/* Buttons - Edit/Delete */
.btn-edit {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-edit:hover {
    background: #1d4ed8;
    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: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-edit-small:hover {
    background: #1d4ed8;
    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 #991b1b;
    background: rgba(254, 226, 226, 0.95);
}

.archived-banner {
    background: #991b1b;
    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: #fee2e2;
    border: 2px solid #fca5a5;
    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: #991b1b;
}

.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 #10b981;
}

.info-item.occupier {
    border-left: 4px solid #2563eb;
}

.info-item.agent {
    border-left: 4px solid #f59e0b;
}

.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: #059669;
    font-weight: 600;
    margin-top: 0.25rem;
}

.history-btn {
    background: #2563eb;
    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: #1d4ed8;
}

.no-info {
    font-style: italic;
    color: #9ca3af;
}

.btn-add-inline {
    background: #10b981;
    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: #059669;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 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: #10b981;
    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 #10b981;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.occupier-item {
    border: 3px solid #2563eb;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.agent-item {
    border: 3px solid #f59e0b;
    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: #10b981;
    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 #2563eb;
    border-radius: 6px;
    padding: 1rem;
    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: #059669;
    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: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
}

.cert-link:hover {
    background: #1d4ed8;
    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: #10b981;
    color: white;
    border-color: #059669;
}

.rating-b {
    background: #3b82f6;
    color: white;
    border-color: #2563eb;
}

.rating-c {
    background: #f59e0b;
    color: white;
    border-color: #d97706;
}

.rating-d {
    background: #ef4444;
    color: white;
    border-color: #dc2626;
}

.rating-e {
    background: #f97316;
    color: white;
    border-color: #ea580c;
}

.rating-f {
    background: #dc2626;
    color: white;
    border-color: #b91c1c;
}

.rating-g {
    background: #991b1b;
    color: white;
    border-color: #7f1d1d;
}

/* 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: #2563eb;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

.status-history-btn:hover {
    color: #1d4ed8;
}

.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: #2563eb;
    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: #9ca3af;
    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: #10b981;
    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: #059669;
    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: #2563eb;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

.job-add-new-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-add-contact {
    background: #10b981;
    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: #059669;
    transform: translateY(-1px);
}

.btn-edit-rel {
    background: #3b82f6;
    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: #2563eb;
    transform: translateY(-1px);
}

.btn-end-rel {
    background: #ef4444;
    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: #dc2626;
    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: #065f46;
    border: 1px solid #10b981;
}

.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: 8px;
    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: 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: #10b981;
        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: #059669;
        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 #e5e7eb;
        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: #3b82f6;
        color: white;
    }
    
    .status-modal-edit-btn:hover {
        background: #2563eb;
        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: #2563eb;
        font-weight: 600;
        font-size: 0.875rem;
    }
    
    .status-modal-description {
        background: #fbbf24;
        color: #78350f;
        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 #2563eb;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.context-label {
    font-size: 0.75rem;
    color: #1e40af;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.context-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.context-detail {
    font-size: 0.875rem;
    color: #4b5563;
    margin-top: 0.25rem;
}

.latest-status-banner {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.latest-status-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 0.5rem;
}

.latest-status-info {
    font-size: 0.875rem;
    color: #78350f;
}

.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: #667eea;
    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: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.selected-job {
    background: #f0fdf4;
    border: 2px solid #10b981;
    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: #667eea;
    color: white;
    border-color: #667eea;
}

.time-type-label:hover {
    border-color: #667eea;
}

.specific-time-input {
    margin-top: 0.75rem;
    display: none;
}

.specific-time-input.show {
    display: block;
}

/* Contact Quick Select */
.contact-quick-select {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.contact-quick-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #92400e;
    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 #f59e0b;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #92400e;
    cursor: pointer;
    transition: all 0.2s;
}

.contact-btn:hover {
    background: #fef3c7;
}

.contact-btn.active {
    background: #f59e0b;
    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: #10b981;
}

.test.fail {
    border-left-color: #ef4444;
    background: #fee;
}

.test.warn {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.error {
    color: #dc2626;
    font-weight: bold;
}

.success {
    color: #059669;
    font-weight: bold;
}

/* ============================================
   LOGIN PAGE SPECIFIC
   ============================================ */
body.login-page {
    /* Override default body styles for login page */
    padding-top: 0;
    background: url('login-bg-768.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-bg-1024.jpg');
    }
}

@media (min-width: 1025px) {
    body.login-page {
        background-image: url('login-bg-1536.jpg');
        background-image: -webkit-image-set(
            url('login-bg-1536.webp') type('image/webp'),
            url('login-bg-1536.jpg') type('image/jpeg')
        );
        background-image: image-set(
            url('login-bg-1536.webp') type('image/webp'),
            url('login-bg-1536.jpg') type('image/jpeg')
        );
    }
}

/* Dark overlay for better readability */
body.login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 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: #059669;
    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: #059669;
    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: #059669;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.login-btn:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 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 #10b981;
    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: #10b981;
    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: #059669;
}

/* Job Item Container */
.job-item-single {
    background: #ffffff;
    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: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

/* Job Ref Badge */
.job-ref-badge {
    display: inline-block;
    background: #f3f4f6;
    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: #6b7280;
    font-size: 0.875rem;
    font-weight: 600;
}

.job-id-value {
    color: #374151;
    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.875rem;
    white-space: nowrap;
}

.job-label-inline {
    margin-left: 1.5rem;
}

.job-value-client {
    color: #059669;
    font-weight: 700;
    font-size: 1rem;
}

.job-value-fund {
    color: #7c3aed;
    font-weight: 700;
    font-size: 1rem;
}

.job-value-default {
    color: #1f2937;
    font-weight: 600;
    font-size: 0.9375rem;
}

.job-ber-value {
    color: #6b7280;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

/* Job Status Badge */
.job-status-badge {
    display: inline-block;
    background: #e0e7ff;
    color: #3730a3;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
}

.job-with-value {
    color: #2563eb;
    font-weight: 600;
    font-size: 1rem;
    margin-left: 1rem;
}

/* Job Button Row */
.job-button-row {
    display: flex;
    gap: 0.75rem;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}

.btn-status-history {
    background: #dbeafe;
    color: #1e40af;
    border: none;
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-status-history:hover {
    background: #bfdbfe;
}

.btn-add-status {
    text-decoration: none;
    display: inline-block;
    background: #10b981;
    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: #059669;
}

/* 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: #fef3c7;
    border-radius: 6px;
}

.no-status-text {
    color: #92400e;
    font-weight: 600;
    font-size: 0.875rem;
}

.btn-add-first-status {
    text-decoration: none;
    background: #10b981;
    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: #059669;
}

/* 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: #2563eb;
}

.cert-epc:hover {
    background: #1d4ed8;
}

.cert-dec {
    background: #059669;
}

.cert-dec:hover {
    background: #047857;
}

.cert-ac {
    background: #7c3aed;
}

.cert-ac:hover {
    background: #6d28d9;
}

.cert-number {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

.no-certificates {
    display: inline-block;
    padding: 0.75rem 1rem;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
}

/* ============================================
   ALERT MESSAGES
   ============================================ */
.alert-success-inline {
    background: #d1fae5;
    border: 2px solid #10b981;
    color: #065f46;
    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: #1e40af;
}

.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);
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    header,
    .logout-btn,
    .btn,
    button,
    .dropdown {
        display: none;
    }
    
    body {
        background: white;
        padding-top: 0;
    }
    
    .container {
        max-width: 100%;
    }
}