/* SaaS-Style Components for TaskBill */

/* ============================================
   TIMESHEET SAAS STYLES
   ============================================ */

.saas-timesheet-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
}

.saas-timesheet-header {
    margin-bottom: 2rem;
}

.saas-title-section {
    margin-bottom: 1.5rem;
}

.saas-report-title {
    font-size: 28px;
    font-weight: 700;
    color: #1b6ec2;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Stats Row - Horizontal Layout */
.saas-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 0.5rem;
    padding: 1rem 0 0.25rem 0;
}

@media (max-width: 768px) {
    .saas-stats-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.saas-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.saas-stat-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #6b7280;
    text-transform: uppercase;
}

.saas-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.saas-stat-value.saas-highlight {
    font-size: 24px;
    color: #1b6ec2;
    font-weight: 700;
}

/* Separator Line */
.saas-separator {
    height: 2px;
    background: linear-gradient(to right, #1b6ec2, transparent);
    margin-bottom: 1.5rem;
}

/* Table Wrapper */
.saas-table-wrapper {
    overflow-x: auto;
    margin-top: 0;
}

/* SaaS Timesheet Table */
.saas-timesheet-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.saas-table-header {
    background: linear-gradient(135deg, #1b6ec2 0%, #1a5ba8 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.saas-table-header th {
    padding: 16px 12px;
    text-align: left;
    border: none;
}

.saas-col-date {
    width: 15%;
    min-width: 120px;
}

.saas-col-description {
    width: 50%;
    min-width: 250px;
}

.saas-col-hours {
    width: 35%;
    min-width: 120px;
    text-align: right;
}

/* Table Rows */
.saas-row-even {
    background-color: #ffffff;
}

.saas-row-odd {
    background-color: #f9fafb;
}

.saas-row-weekend {
    background-color: #fce7f3;
}

.saas-timesheet-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.saas-timesheet-table tbody tr:hover {
    background-color: #f3f4f6;
}

.saas-row-weekend:hover {
    background-color: #fbcfe8;
}

.saas-timesheet-table td {
    padding: 14px 12px;
    vertical-align: middle;
}

/* Date Column */
.saas-date-text {
    font-weight: 500;
    color: #1f2937;
    display: block;
    font-size: 14px;
}

.saas-row-weekend .saas-date-text {
    color: #dc2626;
}

/* Input Styling */
.saas-input {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    width: 100%;
}

.saas-input:focus {
    outline: none;
    border-color: #1b6ec2;
    box-shadow: 0 0 0 3px rgba(27, 110, 194, 0.1);
}

.saas-input-number {
    text-align: right;
    font-weight: 500;
}

/* Table Footer */
.saas-table-footer {
    background-color: #f3f4f6;
    font-weight: 700;
    border-top: 2px solid #1b6ec2;
}

.saas-table-footer td {
    padding: 16px 12px;
    border-bottom: none;
}

.saas-footer-label {
    text-align: right;
    color: #1f2937;
}

.saas-footer-value {
    text-align: right;
    color: #1b6ec2;
    font-size: 16px;
}

/* PDF Footer */
.saas-pdf-footer {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
}

/* Action Buttons */
.saas-action-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    margin-top: 2rem;
}

.saas-btn-primary,
.saas-btn-success {
    padding: 10px 24px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.saas-btn-primary {
    background-color: #1b6ec2;
    color: white;
}

.saas-btn-primary:hover:not(:disabled) {
    background-color: #1552a0;
    box-shadow: 0 4px 12px rgba(27, 110, 194, 0.3);
    transform: translateY(-2px);
}

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

.saas-btn-success:hover:not(:disabled) {
    background-color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

.saas-btn-primary:disabled,
.saas-btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   INVOICE SAAS STYLES
   ============================================ */

.saas-invoice-form {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    border: 1px solid #f0f0f0;
}

.saas-invoice-form .form-label {
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    margin-bottom: 8px;
    display: block;
}

.saas-invoice-form .form-select,
.saas-invoice-form .form-control {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    transition: all 0.2s ease;
    background-color: #fff;
}

.saas-invoice-form .form-select:focus,
.saas-invoice-form .form-control:focus {
    outline: none;
    border-color: #1b6ec2;
    box-shadow: 0 0 0 3px rgba(27, 110, 194, 0.1);
    background-color: #fff;
}

.saas-select {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.saas-select:focus {
    outline: none;
    border-color: #1b6ec2;
    box-shadow: 0 0 0 3px rgba(27, 110, 194, 0.1);
}

.fw-600 {
    font-weight: 600;
}

.saas-invoice-preview {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 2rem;
    border: 1px solid #f0f0f0;
}

.saas-invoice-container {
    padding: 3rem 3.5rem;
    max-width: 100%;
    margin: 0;
    width: 100%;
}

/* Invoice Header */
.saas-invoice-header {
    margin-bottom: 2.5rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 2rem;
    page-break-after: avoid;
}

.saas-invoice-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.saas-invoice-title {
    font-size: 36px;
    font-weight: 800;
    color: #1b6ec2;
    margin: 0;
    letter-spacing: -0.5px;
}

.saas-invoice-meta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: right;
}

.saas-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.saas-meta-label {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.saas-meta-value {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 12px;
    min-width: 150px;
}

/* Invoice Sections */
.saas-invoice-section {
    margin-bottom: 1.5rem;
    page-break-inside: avoid;
}

.saas-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .saas-two-column {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.saas-invoice-column {
    flex: 1;
}

.saas-section-title {
    font-size: 11px;
    font-weight: 800;
    color: #1b6ec2;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.saas-section-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background-color: #1b6ec2;
    border-radius: 2px;
}

.saas-info-block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.saas-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.saas-info-item label {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.saas-info-item input,
.saas-info-item textarea {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
    background-color: #fff;
}

.saas-info-item input:focus,
.saas-info-item textarea:focus {
    outline: none;
    border-color: #1b6ec2;
    box-shadow: 0 0 0 3px rgba(27, 110, 194, 0.1);
}

.saas-input {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.saas-input:focus {
    outline: none;
    border-color: #1b6ec2;
    box-shadow: 0 0 0 3px rgba(27, 110, 194, 0.1);
}

.saas-input-lg {
    font-weight: 600;
    font-size: 16px;
}

.saas-input-sm {
    max-width: 120px;
}

.saas-label-sm {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Service Period */
.saas-service-period {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #1b6ec2;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    page-break-inside: avoid;
}

.saas-service-period .alert {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.saas-service-period h6 {
    font-size: 12px;
    font-weight: 800;
    color: #1b6ec2;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.saas-service-period p {
    color: #1f2937;
    font-size: 14px;
    margin: 0;
}

.saas-service-period span.fw-semibold {
    color: #1b6ec2;
    font-weight: 700;
}

/* Invoice Table */
.saas-invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
}

.saas-invoice-table thead {
    background: linear-gradient(135deg, #1b6ec2 0%, #1a5ba8 100%);
}

.saas-table-header {
    background: linear-gradient(135deg, #1b6ec2 0%, #1a5ba8 100%);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.8px;
}

.saas-table-header th {
    padding: 16px 14px;
    text-align: left;
    border: none;
    vertical-align: middle;
}

.saas-table-header th.text-center {
    text-align: center;
}

.saas-table-header th.text-end {
    text-align: right;
}

.saas-invoice-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    background-color: #ffffff;
    transition: background-color 0.15s ease;
}

.saas-invoice-table tbody tr:nth-child(odd) {
    background-color: #f9fafb;
}

.saas-invoice-table tbody tr:hover {
    background-color: #f3f4f6;
}

.saas-invoice-table td {
    padding: 14px;
    vertical-align: middle;
    font-size: 13px;
    border: none;
}

.saas-invoice-table td.text-center {
    text-align: center;
}

.saas-invoice-table td.text-end {
    text-align: right;
}

.saas-invoice-table td input.form-control {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
}

.saas-invoice-table td input.form-control:focus {
    border-color: #1b6ec2;
    box-shadow: 0 0 0 3px rgba(27, 110, 194, 0.1);
    outline: none;
}

/* Total Row */
.saas-invoice-table tr.table-light {
    background-color: #f3f4f6 !important;
    font-weight: 700;
    border-top: 2px solid #1b6ec2;
}

.saas-invoice-table tr.table-light td {
    padding: 16px 14px;
    color: #1b6ec2;
}

/* Signature Section */
.saas-signature-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    page-break-inside: avoid;
}

@media (max-width: 768px) {
    .saas-signature-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.saas-signature-section .col-md-6 {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.saas-signature-section .signature-line {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.saas-signature-section .signature-line p {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.saas-signature-section .signature-line div {
    border-top: 2px solid #1f2937;
    height: 60px;
    margin-top: 8px;
}

.saas-signature-section .signature-image {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 8px;
}

.saas-signature-section .signature-image img {
    max-height: 80px;
    max-width: 180px;
    object-fit: contain;
}

.saas-signature-section .text-end p {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Invoice Footer */
.saas-invoice-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}

.saas-invoice-footer p {
    margin: 0;
}

/* ============================================
   PDF EXPORT OVERRIDES FOR SAAS STYLES
   ============================================ */

.pdf-export .saas-btn-primary,
.pdf-export .saas-btn-success,
.pdf-export .saas-action-buttons {
    display: none !important;
}

.pdf-export .saas-timesheet-container,
.pdf-export .saas-invoice-container {
    box-shadow: none !important;
    padding: 0 !important;
}

.pdf-export .saas-select,
.pdf-export .saas-input {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
}

.pdf-export .saas-stats-row {
    margin-bottom: 0.25rem !important;
    padding: 0.5rem 0 0 0 !important;
}

.pdf-export .saas-separator {
    margin-bottom: 0.5rem !important;
}

.pdf-export .saas-table-wrapper {
    margin-top: 0 !important;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.saas-header {
    margin-bottom: 2rem;
}

.avoid-break {
    page-break-inside: avoid !important;
}
