body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f9;
    margin: 0;
    padding: 0;
}

/* Login */
#login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

#login-form input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

#login-form button {
    width: 100%;
    padding: 10px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#login-form button:hover {
    background-color: #218838;
}

/* App Container */
#app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Navigation */
#top-nav {
    background-color: #343a40; /* Dark background */
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#app-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

#nav-actions {
    display: flex;
    gap: 15px;
}

.nav-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}

/* Main Content */
#main-content {
    flex-grow: 1;
    padding: 20px;
    background-color: #fff;
    overflow-y: auto;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Dashboard Tiles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-tile {
    background-color: #007bff; /* Blue */
    color: white;
    padding: 30px 20px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 150px;
}

.dashboard-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Different colors for tiles */
.tile-inventory { background-color: #17a2b8; } /* Cyan */
.tile-customers { background-color: #28a745; } /* Green */
.tile-invoices { background-color: #ffc107; color: #333; } /* Yellow */

.tile-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.dashboard-tile h3 {
    margin: 0 0 5px 0;
    font-size: 22px;
}

.dashboard-tile p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.data-table tr:hover {
    background-color: #f1f1f1;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary { background-color: #007bff; color: white; }
.btn-primary:hover { background-color: #0069d9; }

.btn-success { background-color: #28a745; color: white; }
.btn-success:hover { background-color: #218838; }

.btn-danger { background-color: #dc3545; color: white; }
.btn-danger:hover { background-color: #c82333; }

.btn-warning { background-color: #ffc107; color: #212529; }
.btn-warning:hover { background-color: #e0a800; }

/* Button Groups / Gaps */
button + button, .btn + .btn {
    margin-left: 10px;
}

/* Modals */
.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);
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border: none;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #333;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.form-control, input[type="text"], input[type="number"], input[type="email"], input[type="password"], select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 14px;
}

.form-control:focus, input:focus, select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    #top-nav {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* New Invoice Form Design */
.invoice-modal-content {
    background-color: #fff;
    margin: 3% auto;
    padding: 0;
    border: none;
    width: 90%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    overflow: hidden;
}

.invoice-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invoice-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.invoice-modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background-color: #007bff; /* Blue accent */
    margin-right: 10px;
    border-radius: 2px;
}

.customer-section {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
}

.customer-select-wrapper {
    flex-grow: 1;
}

.quick-add-btn {
    white-space: nowrap;
    background-color: #eef2f7;
    color: #333;
    border: 1px solid #ddd;
}
.quick-add-btn:hover {
    background-color: #e2e6ea;
}

.items-section {
    margin-bottom: 30px;
}

.product-search-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    align-items: center;
}

.product-search-input {
    flex-grow: 1;
}

.qty-input {
    width: 80px;
}

.add-item-btn {
    background-color: #0056b3; /* Darker blue */
    padding: 10px 25px;
}

.invoice-items-table th {
    font-size: 12px;
    text-transform: uppercase;
    color: #8898aa;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
}

.invoice-items-table td {
    padding: 15px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.empty-state {
    text-align: center;
    color: #8898aa;
    padding: 40px;
    font-style: italic;
}

.invoice-footer-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.payment-type-wrapper {
    width: 300px;
}

.grand-total-wrapper {
    text-align: right;
}

.grand-total-label {
    font-size: 14px;
    color: #666;
}

.grand-total-amount {
    font-size: 32px;
    font-weight: 700;
    color: #333;
}

.invoice-actions {
    padding: 20px 30px;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.cancel-btn {
    background-color: white;
    border: 1px solid #ddd;
    color: #333;
}

.save-invoice-btn {
    background-color: #0056b3;
    padding: 10px 30px;
    font-size: 16px;
}

/* Generalized Styled Modal (originally invoice-modal) */
.styled-modal-content {
    background-color: #fff;
    margin: 3% auto;
    padding: 0;
    border: none;
    width: 90%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    overflow: hidden;
    position: relative;
    animation: slideIn 0.3s;
}

.styled-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.styled-modal-header h2, .styled-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.styled-modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.styled-modal-footer {
    padding: 20px 30px;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Form Styles for Modals */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-full-width {
    grid-column: span 2;
}
