* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 3px solid #007bff;
    padding-bottom: 20px;
}

.header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.po-number {
    background: #007bff;
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}

.po-number h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.po-number .number {
    font-size: 2.5em;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
    font-size: 16px;
}

input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

textarea {
    height: 120px;
    resize: vertical;
}

.required {
    color: red;
}

.btn-container {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin: 0 10px;
    transition: all 0.3s;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-generate {
    background: #28a745;
    color: white;
    padding: 12px 24px;
    font-size: 16px;
    margin-top: 10px;
}

.btn-generate:hover {
    background: #218838;
}

.confirmation {
    display: none;
    background: #d4edda;
    border: 2px solid #c3e6cb;
    color: #155724;
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
}

.confirmation h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .po-number .number {
        font-size: 2em;
    }
    
    .btn {
        font-size: 16px;
        padding: 12px 20px;
        margin: 5px;
        display: block;
        width: 100%;
    }
}

/* Purchase Orders Management Styles */
.orders-controls {
    margin-bottom: 25px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 20px;
    border: 2px solid #007bff;
    background: #fff;
    color: #007bff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #007bff;
    color: #fff;
}

.filter-btn.filter-active {
    background: #007bff;
    color: #fff;
}

.search-section {
    margin-bottom: 15px;
}

.search-section input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.orders-list {
    max-height: 600px;
    overflow-y: auto;
}

.order-item {
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.order-item:hover {
    border-color: #007bff;
    box-shadow: 0 4px 8px rgba(0,123,255,0.2);
}

.order-item.verified {
    border-color: #28a745;
    background: #f8fff9;
}

.order-item.unverified {
    border-color: #ffc107;
    background: #fffef5;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.order-po {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.verification-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.verification-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.verification-label {
    font-weight: bold;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    transition: all 0.3s ease;
    background: #ffc107;
    color: #212529;
}

.verification-label.verified {
    background: #28a745;
    color: white;
}

.order-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.order-detail-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.order-detail-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: bold;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-detail-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    word-break: break-word;
}

.order-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: 2px solid #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
    border-color: #545b62;
}

/* =============================================
   TASKS SECTION
   ============================================= */

.tasks-section {
    margin-top: 50px;
    border-top: 3px solid #28a745;
    padding-top: 30px;
}

.tasks-header {
    text-align: center;
    margin-bottom: 25px;
}

.tasks-header h2 {
    color: #28a745;
    font-size: 1.9em;
    margin-bottom: 6px;
}

.tasks-header p {
    color: #666;
    font-size: 14px;
}

/* Add / Edit Task Card */
.task-form-card {
    background: #f0fff4;
    border: 2px solid #28a745;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
}

.task-form-card h3 {
    color: #28a745;
    margin-bottom: 18px;
    font-size: 1.1em;
}

.task-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.task-btn-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Stats bar */
.task-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.task-stat-card {
    flex: 1;
    min-width: 120px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 14px 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.task-stat-card .stat-number {
    font-size: 1.8em;
    font-weight: bold;
    color: #007bff;
}

.task-stat-card .stat-number.green  { color: #28a745; }
.task-stat-card .stat-number.orange { color: #fd7e14; }
.task-stat-card .stat-number.teal   { color: #17a2b8; }

.task-stat-card .stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Filter bar */
.task-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.task-filter-btn {
    padding: 7px 16px;
    border: 2px solid #28a745;
    background: white;
    color: #28a745;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.task-filter-btn:hover,
.task-filter-btn.active {
    background: #28a745;
    color: white;
}

/* Task List */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.task-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    transition: all 0.25s;
}

.task-card:hover {
    border-color: #28a745;
    box-shadow: 0 4px 12px rgba(40,167,69,0.15);
}

.task-card.completed {
    border-color: #28a745;
    background: #f8fff9;
    opacity: 0.85;
}

.task-card.completed .task-card-title {
    text-decoration: line-through;
    color: #888;
}

.task-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.task-card-title {
    font-weight: 700;
    font-size: 15px;
    color: #222;
}

.task-card-meta {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.task-complete-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    border: 2px solid #28a745;
    color: #28a745;
    background: white;
    transition: all 0.2s;
    white-space: nowrap;
}

.task-complete-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #28a745;
    cursor: pointer;
}

.task-complete-toggle.is-done {
    background: #28a745;
    color: white;
}

.task-card-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.task-detail-chip {
    background: #f8f9fa;
    border-left: 4px solid #28a745;
    border-radius: 6px;
    padding: 8px 12px;
}

.task-detail-chip .chip-label {
    font-size: 11px;
    color: #888;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-detail-chip .chip-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin-top: 2px;
    word-break: break-word;
}

.task-detail-chip.cost-chip  { border-left-color: #dc3545; }
.task-detail-chip.save-chip  { border-left-color: #17a2b8; }

.task-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.btn-task-edit {
    background: #007bff;
    color: white;
    border: none;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-task-edit:hover { background: #0056b3; }

.btn-task-delete {
    background: #dc3545;
    color: white;
    border: none;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-task-delete:hover { background: #a71d2a; }

.task-empty {
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
    font-size: 15px;
}

/* Responsive tweaks for tasks */
@media (max-width: 600px) {
    .task-form-grid {
        grid-template-columns: 1fr;
    }

    .task-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .task-filter-bar input {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .task-stats {
        flex-direction: column;
    }
}