/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    color: #2c3e50;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #34495e;
}

h3 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
}

/* ===== HEADER & FOOTER ===== */
.header {
    background-color: #fff;
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.header-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: #2c3e50;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.footer {
    background-color: #fff;
    padding: 2rem 0;
    margin-top: 3rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.footer p {
    color: #6b7280;
    font-size: 0.9rem;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== HOME PAGE ===== */
.welcome-section {
    text-align: center;
    padding: 3rem 1rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 15px;
    margin-bottom: 2rem;
}

.welcome-section h1 {
    color: #92400e;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.welcome-section p {
    font-size: 1.2rem;
    color: #78350f;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    font-size: 3rem;
    color: #0c4a6e;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.stat-card p {
    font-size: 1.1rem;
    color: #075985;
    font-weight: 500;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-primary {
    background-color: #ffdf00;
    color: #1f2937;
    box-shadow: 0 4px 10px rgba(255, 223, 0, 0.3);
}

.btn-primary:hover {
    background-color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 223, 0, 0.4);
}

.btn-secondary {
    background-color: #e0f2fe;
    color: #0c4a6e;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2);
}

.btn-secondary:hover {
    background-color: #bae6fd;
    transform: translateY(-2px);
}

.btn-tertiary {
    background-color: #fce7f3;
    color: #9f1239;
    box-shadow: 0 4px 10px rgba(244, 63, 94, 0.2);
}

.btn-tertiary:hover {
    background-color: #fbcfe8;
    transform: translateY(-2px);
}

.btn-success {
    background-color: #d1fae5;
    color: #065f46;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background-color: #a7f3d0;
    transform: translateY(-2px);
}

.btn-info {
    background-color: #ddd6fe;
    color: #5b21b6;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.2);
}

.btn-info:hover {
    background-color: #c4b5fd;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #fee2e2;
    color: #991b1b;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: #fecaca;
    transform: translateY(-2px);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.2rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-back {
    background-color: #f3f4f6;
    color: #374151;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.btn-back:hover {
    background-color: #e5e7eb;
    transform: translateX(-3px);
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.page-header h1 {
    flex: 1;
}

/* ===== FORMS ===== */
.invoice-form {
    background-color: #fff;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
}

.form-section h2 {
    color: #92400e;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #ffdf00;
    box-shadow: 0 0 0 3px rgba(255, 223, 0, 0.1);
}

.form-group input[readonly] {
    background-color: #f9fafb;
    cursor: not-allowed;
}

/* ===== MENU ITEMS ===== */
.menu-category {
    margin-bottom: 2rem;
}

.menu-category h3 {
    color: #1f2937;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #ffdf00;
}

.menu-items {
    display: grid;
    gap: 1rem;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.menu-item:hover {
    transform: translateX(5px);
}

.menu-item-info h4 {
    color: #1f2937;
    margin-bottom: 0.3rem;
    font-size: 1.1rem;
}

.menu-price {
    color: #059669;
    font-weight: 700;
    font-size: 1.1rem;
}

.menu-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-qty {
    width: 35px;
    height: 35px;
    border: 2px solid #ffdf00;
    background-color: #fff;
    color: #1f2937;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-qty:hover {
    background-color: #ffdf00;
    transform: scale(1.1);
}

.qty-input {
    width: 60px;
    text-align: center;
    padding: 8px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
}

.selected-items-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#selectedCount {
    font-weight: 600;
    color: #374151;
    font-size: 1.1rem;
}

/* ===== INVOICE ITEMS ===== */
.invoice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #fff;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.invoice-item-info h4 {
    color: #1f2937;
    margin-bottom: 0.3rem;
}

.item-category {
    color: #6b7280;
    font-size: 0.9rem;
}

.invoice-item-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.item-total {
    font-weight: 700;
    color: #059669;
    font-size: 1.1rem;
}

.btn-remove {
    width: 30px;
    height: 30px;
    border: none;
    background-color: #fee2e2;
    color: #991b1b;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background-color: #fecaca;
    transform: scale(1.1);
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== PAYMENT METHODS ===== */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.payment-method {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-method:hover {
    border-color: #ffdf00;
    background-color: #fffbeb;
}

.payment-method input[type="radio"] {
    margin-right: 0.8rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.payment-method input[type="radio"]:checked + span {
    font-weight: 700;
    color: #92400e;
}

.payment-method span {
    font-size: 1rem;
    color: #374151;
}

/* ===== TOTAL SECTION ===== */
.total-section {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    font-size: 1.1rem;
    color: #0c4a6e;
}

.total-final {
    border-top: 3px solid #0284c7;
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #075985;
}

/* ===== FORM ACTIONS ===== */
.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* ===== SEARCH SECTION ===== */
.search-section {
    background-color: #fff;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.search-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ===== INVOICE LIST ===== */
.invoice-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.invoice-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.invoice-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.invoice-card.deleted {
    opacity: 0.7;
    cursor: default;
}

.invoice-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.invoice-card-header h3 {
    color: #1f2937;
    font-size: 1.2rem;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.invoice-card-body p {
    margin-bottom: 0.5rem;
    color: #4b5563;
}

.invoice-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 15px;
}

.empty-state p {
    font-size: 1.2rem;
    color: #78350f;
}

/* ===== INVOICE DETAIL ===== */
.invoice-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.invoice-detail-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.invoice-preview {
    max-width: 900px;
    margin: 0 auto;
}

.invoice-header-section {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid #ffdf00;
}

.invoice-logo {
    max-width: 150px;
    margin-bottom: 1rem;
}

.invoice-status-badge {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1.8rem;
    font-weight: 700;
    border: 4px solid;
    border-radius: 10px;
    margin-top: 1rem;
}

.invoice-status-badge.paid {
    color: #065f46;
    border-color: #10b981;
    background-color: #d1fae5;
}

.invoice-status-badge.pending {
    color: #92400e;
    border-color: #f59e0b;
    background-color: #fef3c7;
}

.invoice-info-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
}

.invoice-info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.info-label {
    font-size: 0.9rem;
    color: #78350f;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.info-value {
    font-size: 1.1rem;
    color: #1f2937;
    font-weight: 600;
}

.invoice-items-section {
    margin-bottom: 2rem;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.invoice-table thead {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
}

.invoice-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #0c4a6e;
    border-bottom: 2px solid #0284c7;
}

.invoice-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

.invoice-table tbody tr:hover {
    background-color: #f9fafb;
}

.invoice-summary-section {
    padding: 1.5rem;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    font-size: 1.1rem;
    color: #0c4a6e;
}

.summary-total {
    border-top: 3px solid #0284c7;
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #075985;
}

.invoice-payment-section {
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.invoice-notes {
    padding: 1rem;
    background-color: #fef3c7;
    border-left: 4px solid #ffdf00;
    border-radius: 8px;
}

.notes-text {
    font-size: 0.9rem;
    color: #78350f;
    font-style: italic;
}

/* ===== RECYCLE BIN ===== */
.recycle-actions {
    margin-bottom: 2rem;
}

/* ===== VIEW ONLY ===== */
.view-only-banner {
    background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
    padding: 1rem;
    text-align: center;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.view-only-banner p {
    color: #5b21b6;
    font-weight: 600;
    font-size: 1.1rem;
}

/* ===== MODAL ===== */
.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);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.close {
    color: #6b7280;
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #1f2937;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .container {
        padding: 15px;
    }

    .header-content {
        padding: 0 15px;
    }

    .header-logo {
        width: 50px;
        height: 50px;
    }

    .header-title {
        font-size: 1.5rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .stats-section {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .invoice-form {
        padding: 1.5rem;
    }

    .form-section {
        padding: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .menu-item {
        flex-direction: column;
        gap: 1rem;
    }

    .invoice-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .invoice-item-details {
        width: 100%;
        flex-wrap: wrap;
    }

    .payment-methods {
        grid-template-columns: 1fr;
    }

    .search-filters {
        grid-template-columns: 1fr;
    }

    .search-actions {
        flex-direction: column;
    }

    .invoice-list {
        grid-template-columns: 1fr;
    }

    .invoice-actions {
        flex-direction: column;
    }

    .invoice-table {
        font-size: 0.9rem;
    }

    .invoice-table th,
    .invoice-table td {
        padding: 8px;
    }

    .invoice-info-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    .header-title {
        font-size: 1.2rem;
    }

    .welcome-section {
        padding: 2rem 1rem;
    }

    .stat-card h3 {
        font-size: 2.5rem;
    }

    .invoice-status-badge {
        font-size: 1.4rem;
        padding: 10px 20px;
    }

    .total-final {
        font-size: 1.2rem;
    }
}