:root{
    --primary-color: #2c3e50;
    --secondary-color: #afb2ba;
    /* --tertiary-color: #afb2ba; */
    --background-color: #f5f5f5;
}

body {
    font-family: "Sora", 'Open Sans', sans-serif;
    font-optical-sizing: auto;
    color: var(--primary-color);
    margin: 0;
}

nav {
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 1.1em;
    padding: 5px;
    background: var(--primary-color);
    color: var(--secondary-color);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
    nav div {
        padding: 25px;
    }
    nav a {
        padding-left: 10px;
        text-decoration: none;
        color: var(--secondary-color);
    }
    nav #navigation a {
        margin: 5px;
        padding: 12px 16px;
    }
    nav #navigation a.nav-link:hover {
        background-color: var(--secondary-color);
        color: var(--primary-color)
    }

/* Container for the whole dropdown */
.dropdown {
  position: relative; /* Required for the content to align to this div */
  display: inline-block;
}
    /* Hidden dropdown content */
    .dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    left: auto;
    max-width: 75vw;
    background-color: var(--primary-color);
    min-width: 160px;
    z-index: 1; /* Ensures it stays on top */
    }
        /* Links inside the dropdown */
        .dropdown-content a {
        color: var(--secondary-color);
        padding: 12px 16px;
        text-decoration: none;
        display: block;
        text-align: right;
        }
        /* Show the menu on hover */
        .dropdown:hover .dropdown-content {
        display: block;
        }
            /* Optional: Change link color on hover */
            .dropdown-content a:hover { background-color: var(--secondary-color); color: var(--primary-color); }

body .content {
    padding-top: 70px;
    margin: 0 auto;
    max-width: 90vw;
    flex-wrap: wrap;
}

.form-submit-button {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border: none;
    border-radius: 6px;
    margin: 10px;
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
    .form-submit-button:hover {
        background-color: var(--primary-color);
        color: var(--background-color);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
        transform: translateY(-2px);
    }
    .form-submit-button:disabled {
        background-color: var(--secondary-color);
        color: var(--primary-color);
        cursor: wait;
        opacity: 0.6;
    }

    #payInvoiceBtn {
        background-color: #4caf50;
        color: white;
    }
        #payInvoiceBtn:hover {
            background-color: #45a049;
            color: white;
        }
        #payInvoiceBtn:disabled {
            background-color: #cccccc;
            color: white;
            cursor: default;
        }

.tabs {
    display: flex;
    border-bottom: 2px solid var(--secondary-color);
    padding: 0 15px;
}

.tab-button {
    padding: 12px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    color: #666;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-button.active {
    border-bottom: 3px solid var(--primary-color);
    font-weight: bold;
    color: var(--primary-color);
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-content {
    display: none;
    padding: 0;
}

.tab-content.active {
    display: block;
}

/* Summary Cards at top of Details */
.wo-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
    padding: 0 15px;
}

.summary-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.summary-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.card-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #f5f5f5;
    flex-shrink: 0;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.card-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

/* Details Card Styling */
.details-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin: 20px 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card-section-title {
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 18px;
    color: var(--primary-color);
}

.details-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.details-row.full-width {
    grid-template-columns: 1fr;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-field label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.field-icon {
    font-size: 14px;
}

.detail-field input,
.detail-field textarea,
.detail-field select {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: white;
    color: var(--primary-color);
}

.detail-field input:focus,
.detail-field textarea:focus,
.detail-field select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.detail-field input:disabled,
.detail-field textarea:disabled,
.detail-field select:disabled {
    background-color: #f9f9f9;
    color: #666;
    cursor: not-allowed;
}

.detail-field span {
    padding: 10px 12px;
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
}

/* Invoice Section Cards */
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 20px;
}

.invoice-actions {
    display: flex;
    gap: 10px;
}

.invoice-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 20px 15px;
}

.invoice-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.invoice-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.invoice-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin-bottom: 8px;
    font-weight: 600;
}

.invoice-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.invoice-status-unpaid {
    color: #ff9800 !important;
}

.invoice-status-paid {
    color: #4caf50 !important;
}

.invoice-status-overdue {
    color: #f44336 !important;
}

.invoice-status-unknown {
    color: #999 !important;
}

.invoice-details-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin: 20px 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.invoice-details-card h3 {
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 16px;
    color: var(--primary-color);
}

#problem {
  width: 100%;
  max-width: 800px; /* Better for readability */
  min-height: 120px;
  padding: 15px;
  border: 2px solid var(--secondary-color);
  border-radius: 12px;
  font-size: 16px; /* Prevents iOS zoom-in on focus */
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  resize: none; /* Disables the ugly manual resize handle */
}

#problem:focus {
  outline: none;
  border-color: var(--primary-color); /* Use your brand color */
  box-shadow: 0 0 10px rgba(74, 144, 226, 0.2);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .wo-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .invoice-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .details-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body .content {
        max-width: 100vw;
        padding: 70px 10px 10px 10px;
    }

    .details-card,
    .invoice-details-card {
        margin: 15px 10px;
        padding: 16px;
    }

    .wo-summary-cards {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 15px 0;
        padding: 0 10px;
    }
    
    .summary-card {
        padding: 12px;
        gap: 10px;
    }

    .card-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .card-label {
        font-size: 11px;
    }

    .card-value {
        font-size: 14px;
    }

    .invoice-summary-cards {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 15px 0;
        padding: 0 10px;
    }

    .invoice-card {
        padding: 12px;
        text-align: left;
    }

    .invoice-label {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .invoice-value {
        font-size: 16px;
    }
    
    .detail-field label {
        font-size: 11px;
        gap: 4px;
    }

    .field-icon {
        font-size: 12px;
    }

    .detail-field input,
    .detail-field textarea,
    .detail-field select {
        padding: 8px 10px;
        font-size: 13px;
    }

    .card-section-title {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .details-row {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 15px;
    }

    .invoice-header {
        flex-direction: column;
        gap: 12px;
        padding: 10px;
        margin-bottom: 15px;
    }

    .invoice-header h2 {
        margin: 0;
        font-size: 18px;
    }

    .invoice-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }

    .invoice-actions .form-submit-button,
    .invoice-actions form {
        width: 100%;
        margin: 0;
    }

    .invoice-actions form button {
        width: 100%;
        margin: 0;
    }

    .form-submit-button {
        margin: 0;
        padding: 10px 16px;
        font-size: 13px;
        min-width: auto;
        min-height: auto;
    }

    .tabs {
        padding: 0 10px;
    }

    .tab-button {
        padding: 10px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    body .content {
        max-width: 100%;
        padding: 70px 8px 8px 8px;
    }

    .details-card,
    .invoice-details-card {
        margin: 12px 8px;
        padding: 12px;
    }

    .wo-summary-cards,
    .invoice-summary-cards {
        gap: 10px;
        margin: 12px 0;
        padding: 0 8px;
    }

    .summary-card {
        padding: 10px;
        gap: 8px;
    }

    .card-icon {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .card-label {
        font-size: 10px;
    }

    .card-value {
        font-size: 13px;
    }

    .invoice-card {
        padding: 10px;
    }

    .invoice-label {
        font-size: 10px;
    }

    .invoice-value {
        font-size: 14px;
    }

    .card-section-title {
        font-size: 14px;
    }

    .details-row {
        gap: 12px;
        margin-bottom: 12px;
    }

    .detail-field label {
        font-size: 10px;
    }

    .detail-field input,
    .detail-field textarea,
    .detail-field select {
        padding: 8px 8px;
        font-size: 12px;
    }
}
