/* Client Portal Styles - Distinct Portal Look */

/* Login Screen Styles - Sondra Hathaway Orange Theme */
.login-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, #F39C3D 0%, #E67E22 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    padding-top: 100px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: #333;
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.login-header p {
    color: #666;
    margin: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
}

.login-form label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-form input {
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.login-form input:focus {
    outline: none;
    border-color: #F39C3D;
    box-shadow: 0 0 0 3px rgba(243, 156, 61, 0.2);
}

.btn-login {
    background: linear-gradient(135deg, #F39C3D 0%, #E67E22 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 61, 0.4);
    background: linear-gradient(135deg, #E67E22 0%, #D2691E 100%);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-error {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #fff5f5;
    border: 2px solid #f44336;
    border-radius: 8px;
    color: #c62828;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.btn-logout {
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: #c82333 !important;
    transform: translateY(-1px);
}

.portal-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #F39C3D 0%, #E67E22 100%);
    padding-top: 80px;
}

.portal-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.portal-header h1 {
    color: #333;
    font-size: 2rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.portal-header .portal-badge {
    background: linear-gradient(135deg, #F39C3D 0%, #E67E22 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.portal-tabs {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0 2rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
}

.portal-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.portal-tab:hover {
    color: #F39C3D;
    background: rgba(243, 156, 61, 0.05);
}

.portal-tab.active {
    color: #F39C3D;
    border-bottom-color: #F39C3D;
    background: rgba(243, 156, 61, 0.05);
}

.portal-content {
    max-width: 1680px;
    margin: 0 auto;
    padding: 2rem;
}

.portal-tab-panel {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    min-height: 500px;
}

.portal-tab-panel.active {
    display: block;
}

/* Gantt Chart Styles */
#gantt-container {
    margin: 2rem 0;
    overflow-x: auto;
}

#gantt-chart {
    min-width: 100%;
}

.milestones-section {
    margin-top: 2rem;
}

.milestones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.milestone-card {
    background: #f8f9fa;
    border-left: 4px solid #F39C3D;
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s ease;
}

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

.milestone-card.completed {
    border-left-color: #28a745;
}

.milestone-card.in-progress {
    border-left-color: #ffc107;
}

.milestone-card.delayed {
    border-left-color: #dc3545;
}

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

.milestone-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.milestone-status {
    background: #e0e0e0;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    text-transform: capitalize;
}

.milestone-description {
    color: #666;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.milestone-date {
    color: #999;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Hours Tracking Styles */
.hours-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.hours-filters input {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.hours-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: linear-gradient(135deg, #F39C3D 0%, #E67E22 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
}

.summary-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.hours-section {
    margin-top: 2rem;
}

.hours-section h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

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

.hours-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid #F39C3D;
}

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

.hours-category, .hours-task {
    font-weight: 600;
    color: #333;
}

.hours-amount {
    font-weight: 700;
    color: #F39C3D;
    font-size: 1.1rem;
}

.hours-item-details {
    display: flex;
    gap: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.hours-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.hours-table th {
    background: #F39C3D;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.hours-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.hours-table tr:hover {
    background: #f8f9fa;
}

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

/* Work Orders Styles */
.work-orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.work-order-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.work-order-card:hover {
    border-color: #F39C3D;
    box-shadow: 0 4px 12px rgba(243, 156, 61, 0.2);
    transform: translateY(-2px);
}

.work-order-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.work-order-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
    flex: 1;
}

.work-order-category {
    background: #F39C3D;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.work-order-description {
    color: #666;
    margin: 1rem 0;
    line-height: 1.6;
}

.work-order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.work-order-price {
    font-weight: 700;
    color: #F39C3D;
    font-size: 1.1rem;
}

.btn-order {
    background: linear-gradient(135deg, #F39C3D 0%, #E67E22 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 61, 0.4);
}

.client-orders-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.client-orders-table th {
    background: #F39C3D;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.client-orders-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.approved, .status-badge.sent {
    background: #d1ecf1;
    color: #0c5460;
}

.status-badge.in-progress {
    background: #d4edda;
    color: #155724;
}

.status-badge.completed, .status-badge.paid {
    background: #d4edda;
    color: #155724;
}

.status-badge.cancelled, .status-badge.overdue {
    background: #f8d7da;
    color: #721c24;
}

.btn-view, .btn-print {
    background: #F39C3D;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-right: 0.5rem;
    transition: background 0.2s ease;
}

.btn-view:hover, .btn-print:hover {
    background: #c2410c;
}

/* Invoices Styles */
.invoices-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.invoices-table th {
    background: #F39C3D;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.invoices-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

/* Modal Styles */
.portal-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 1rem;
    box-sizing: border-box;
}

.portal-modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 800px;
    width: 100%;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    position: relative;
    margin: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #F39C3D;
}

/* Document/Video upload overlay - shown during upload */
.upload-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
}
.upload-overlay-inner {
    text-align: center;
    padding: 2rem;
}
.upload-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border: 4px solid #e5e7eb;
    border-top-color: #F39C3D;
    border-radius: 50%;
    animation: upload-spin 0.9s linear infinite;
}
.upload-overlay-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
}
.upload-overlay-hint {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
    max-width: 280px;
    line-height: 1.4;
}
@keyframes upload-spin {
    to { transform: rotate(360deg); }
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.invoice-header h2 {
    margin: 0;
    color: #333;
}

.invoice-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.invoice-items {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.invoice-items th {
    background: #F39C3D;
    color: white;
    padding: 1rem;
    text-align: left;
}

.invoice-items td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.invoice-items tfoot {
    font-weight: 600;
}

.total-row {
    background: #f8f9fa;
    font-size: 1.1rem;
}

.invoice-notes {
    margin-top: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.invoice-actions {
    margin-top: 2rem;
    text-align: center;
}

.order-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #F39C3D;
}

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

.btn-submit {
    background: linear-gradient(135deg, #F39C3D 0%, #E67E22 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 61, 0.4);
}

.no-data {
    text-align: center;
    color: #999;
    padding: 3rem;
    font-style: italic;
}

/* Responsive Modal Styles */
@media (max-width: 768px) {
    .portal-modal {
        padding: 0.5rem;
    }
    
    .portal-modal-content {
        max-width: 100%;
        max-height: calc(100vh - 1rem);
        padding: 1.5rem;
        margin: 0.5rem auto;
    }
    
    .close-modal {
        top: 0.5rem;
        right: 1rem;
        font-size: 1.5rem;
    }
}

/* Print Styles for Invoices */
@media print {
    body * {
        visibility: hidden;
    }
    
    .portal-modal,
    .portal-modal * {
        visibility: visible;
    }
    
    .portal-modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: white;
        display: block !important;
    }
    
    .portal-modal-content {
        box-shadow: none;
        max-width: 100%;
        margin: 0;
        padding: 1rem;
    }
    
    .close-modal,
    .invoice-actions {
        display: none;
    }
    
    .invoice-header,
    .invoice-info,
    .invoice-items,
    .invoice-notes {
        page-break-inside: avoid;
    }
}

/* Timeline View Toggle */
.view-toggle-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.view-toggle-btn:hover {
    border-color: #F39C3D;
    color: #F39C3D;
}

.view-toggle-btn.active {
    background: linear-gradient(135deg, #F39C3D 0%, #E67E22 100%);
    color: white;
    border-color: #F39C3D;
}

.timeline-view {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Timeline Table Styles */
.timeline-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
}

.timeline-data-table thead {
    background: #f8f9fa;
}

.timeline-data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    position: relative;
}

.timeline-data-table th:hover {
    background: #f0f0f0;
}

.timeline-data-table th i {
    margin-left: 0.5rem;
    color: #999;
    font-size: 0.85rem;
}

.timeline-data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
}

.timeline-data-table tbody tr:hover {
    background: #f8f9fa;
}

.timeline-data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Timeline Table Styles */
.timeline-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.timeline-table thead {
    background: linear-gradient(135deg, #F39C3D 0%, #E67E22 100%);
    color: white;
}

.timeline-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    user-select: none;
}

.timeline-table th:hover {
    background: rgba(255, 255, 255, 0.1);
}

.timeline-table th i {
    margin-left: 0.5rem;
    font-size: 0.85rem;
}

.timeline-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s ease;
}

.timeline-table tbody tr:hover {
    background: #f8f9fa;
}

.timeline-table tbody tr.timeline-parent {
    background: #f8f9fa;
    font-weight: 600;
}

.timeline-table tbody tr.timeline-child {
    background: white;
}

.timeline-table tbody tr.timeline-child:hover {
    background: #f0f0f0;
}

.timeline-table tbody tr[data-parent-id]:not([data-parent-id=""]) {
    background: #f8f9fa;
    border-left: 3px solid #c2410c;
}

.timeline-table tbody tr[data-parent-id]:not([data-parent-id=""]):hover {
    background: #f0f0f0;
}

.btn-indent-toggle {
    transition: all 0.2s ease;
}

.btn-indent-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.timeline-add-row {
    transition: background 0.2s ease;
}

.timeline-add-row:hover {
    background: #f0f0f0 !important;
}

.timeline-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.timeline-edit {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.timeline-edit:focus {
    outline: none;
    border-color: #F39C3D;
    box-shadow: 0 0 0 3px rgba(243, 156, 61, 0.1);
}

/* Frappe Gantt Chart Styles */
#gantt-chart {
    min-height: 400px;
}

/* Customize Frappe Gantt colors */
.gantt-container .bar-wrapper .bar {
    fill: #F39C3D;
}

.gantt-container .bar-wrapper .bar-progress {
    fill: #E67E22;
}

.gantt-container .bar-wrapper:hover .bar {
    fill: #E67E22;
}

.gantt-goal .bar {
    fill: #F39C3D !important;
    font-weight: 600;
    stroke: #E67E22;
    stroke-width: 2;
}

.gantt-task .bar {
    fill: #c2410c !important;
    stroke: #9a3412;
    stroke-width: 1;
}

.gantt-parent .bar {
    fill: #F39C3D !important;
    font-weight: 600;
}

.gantt-child .bar {
    fill: #ffb366 !important;
}

/* Gantt Chart Controls */
.gantt-control-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    color: #666;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

.gantt-control-btn:hover {
    background: #F39C3D;
    border-color: #F39C3D;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gantt-control-btn:active {
    transform: translateY(0);
}

#gantt-chart-wrapper {
    position: relative;
    min-height: 300px;
}

#gantt-chart-wrapper::-webkit-scrollbar {
    height: 10px;
}

#gantt-chart-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

#gantt-chart-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

#gantt-chart-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Timeline Filter */
#timeline-filter {
    transition: border-color 0.2s ease;
}

#timeline-filter:focus {
    outline: none;
    border-color: #F39C3D;
    box-shadow: 0 0 0 3px rgba(243, 156, 61, 0.1);
}

/* Responsive Timeline */
@media (max-width: 768px) {
    .timeline-table {
        font-size: 0.85rem;
    }
    
    .timeline-table th,
    .timeline-table td {
        padding: 0.5rem;
    }
    
    .gantt-container {
        height: 30px;
    }
    
    .gantt-bar {
        height: 20px;
    }
    
    .gantt-target-icon {
        width: 20px;
        height: 20px;
    }
}

/* Admin Styles */
.admin-buttons {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.btn-admin {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-admin:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-admin.secondary {
    background: #6c757d;
}

.btn-edit-small,
.btn-delete-small {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    color: #666;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
}

.btn-edit-small:hover {
    background: #c2410c;
    border-color: #c2410c;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-delete-small:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-admin.secondary:hover {
    background: #5a6268;
}

.btn-admin.danger {
    background: #dc3545;
}

.btn-admin.danger:hover {
    background: #c82333;
}

.btn-remove-item {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-remove-item:hover {
    background: #c82333;
}

/* Responsive */
@media (max-width: 768px) {
    .portal-tabs {
        padding: 0 1rem;
    }
    
    .portal-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .portal-content {
        padding: 1rem;
    }
    
    .portal-tab-panel {
        padding: 1.5rem;
    }
    
    .milestones-grid,
    .work-orders-grid {
        grid-template-columns: 1fr;
    }
    
    .hours-summary {
        grid-template-columns: 1fr;
    }
    
    .hours-filters {
        flex-direction: column;
    }
    
    .hours-filters input {
        width: 100%;
    }

    .send-email-layout {
        grid-template-columns: 1fr !important;
    }

    #send-email-preview-frame {
        min-height: 480px !important;
        height: 65vh !important;
    }
}

/* Compose email wizard modal */
body.compose-email-modal-open {
    overflow: hidden;
}

.compose-email-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.compose-email-modal[hidden] {
    display: none !important;
}

.compose-email-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
}

.compose-email-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: min(92vh, 900px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.compose-email-modal-header {
    padding: 1rem 1.25rem 0.85rem;
    border-bottom: 1px solid #e5e7eb;
}

.compose-email-modal-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.compose-wizard-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.35rem;
    margin: 0;
    padding: 0 0 0.15rem;
    width: 100%;
}

.compose-bc-sep {
    color: #9ca3af;
    font-size: 0.8rem;
    user-select: none;
}

.compose-bc-item {
    border: none;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
}

.compose-bc-item--active {
    background: var(--primary-orange, #f39c3d);
    color: #fff;
}

.compose-bc-item--upcoming:disabled {
    opacity: 0.55;
    cursor: default;
    background: #f9fafb;
    color: #9ca3af;
}

.compose-bc-item:not(:disabled):not(.compose-bc-item--active):hover {
    background: #e5e7eb;
}

.compose-email-modal-close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 0.25rem 0.5rem;
}

.compose-email-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.compose-label {
    display: block;
    margin: 0.75rem 0 0.35rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
}

.compose-label:first-child {
    margin-top: 0;
}

.compose-required {
    color: #dc2626;
}

.compose-input,
.compose-textarea {
    width: 100%;
    padding: 0.55rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
}

.compose-textarea {
    resize: vertical;
}

.compose-step-lead {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
}

.compose-step-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    color: #374151;
}

.compose-step-hint {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.compose-wizard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.25rem;
}

.compose-wizard-actions--split {
    justify-content: space-between;
}

.compose-btn-primary {
    background: var(--primary-orange, #f39c3d) !important;
    color: #fff !important;
    border: none !important;
    padding: 0.65rem 1.25rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    cursor: pointer;
}

.compose-btn-secondary {
    background: #6b7280 !important;
    color: #fff !important;
    border: none !important;
    padding: 0.65rem 1.25rem !important;
    border-radius: 6px !important;
    cursor: pointer;
}

.compose-link-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: underline;
    padding: 0.25rem 0.5rem;
}

.compose-hex-picker {
    margin-bottom: 0.75rem;
}

.compose-hex-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.compose-hex-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    min-width: 5.5rem;
}

.compose-hex-row input[type="color"] {
    width: 2.75rem;
    height: 2.25rem;
    padding: 0.15rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
}

.compose-hex-input {
    flex: 1;
    min-width: 6.5rem;
    max-width: 8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
}

.compose-card-image-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.compose-card-image-frame {
    width: 54px;
    height: 84px;
    flex-shrink: 0;
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}

.compose-card-image-frame.is-empty {
    display: none;
}

.compose-card-image-preview {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
}

.compose-card-image-status {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    font-weight: 600;
}

.compose-preview-frame {
    width: 100%;
    height: min(420px, 50vh);
    min-height: 280px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f5f5f3;
    margin: 0.75rem 0 1rem;
}

.compose-preview-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.compose-email-status {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
}

.compose-email-status--success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.compose-email-status--error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.compose-email-status--info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}
