* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 25px 30px;
}

header h1 {
    font-size: 28px;
    margin-bottom: 15px;
}

nav {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

nav a:hover {
    background: rgba(255,255,255,0.1);
}

nav a.active {
    background: rgba(255,255,255,0.2);
    font-weight: 600;
}

/* Main Content */
main {
    padding: 30px;
}

main h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 24px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

main h3 {
    color: #34495e;
    margin: 20px 0 15px 0;
    font-size: 20px;
}

main h4 {
    color: #34495e;
    margin: 15px 0 10px 0;
    font-size: 18px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 25px;
    border-radius: 10px;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    font-size: 16px;
    margin-bottom: 15px;
    opacity: 0.9;
    color: white;
}

.stat-card .stat-number {
    font-size: 36px;
    font-weight: bold;
    margin: 0;
}

.stat-card.blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card.orange {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card.green {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card.red {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-card.purple {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

/* Quick Actions */
.quick-actions {
    margin: 30px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
}

.quick-actions h2 {
    border: none;
    margin-bottom: 20px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    display: inline-block;
    text-decoration: none;
    border-radius: 4px;
    margin: 0 3px;
}

.action-bar {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Tables */
.table-section, .recent-section {
    margin: 30px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

thead th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

tbody tr {
    border-bottom: 1px solid #ecf0f1;
    transition: background 0.2s;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody td {
    padding: 12px 15px;
    font-size: 14px;
    color: #2c3e50;
}

tbody tr:last-child {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.paid {
    background: #d4edda;
    color: #155724;
}

.badge.partial {
    background: #fff3cd;
    color: #856404;
}

.badge.unpaid {
    background: #f8d7da;
    color: #721c24;
}

.badge.green {
    background: #d4edda;
    color: #155724;
}

.badge.red {
    background: #f8d7da;
    color: #721c24;
}

.badge.orange {
    background: #fff3cd;
    color: #856404;
}

/* Forms */
.form-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin: 20px 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

/* Sale Lines */
.sale-line {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.sale-line select {
    flex: 2;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.sale-line input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

#sale-lines {
    margin: 15px 0;
}

/* Customer Details */
.customer-details {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    border: 2px solid #ecf0f1;
}

.customer-details p {
    margin: 8px 0;
    color: #2c3e50;
}

/* Messages */
.success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

/* Filter Section */
.filter-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.filter-section form {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.filter-group label {
    margin-bottom: 5px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 14px;
}

.filter-group input,
.filter-group select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* Report Specific Styles */
.report-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.report-summary h4 {
    margin-top: 0;
    color: #2c3e50;
}

.report-summary p {
    margin: 8px 0;
    color: #34495e;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        border-radius: 0;
    }
    
    main {
        padding: 20px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    nav {
        flex-direction: column;
    }
    
    nav a {
        width: 100%;
        text-align: center;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
        text-align: center;
    }
    
    table {
        font-size: 12px;
    }
    
    thead th,
    tbody td {
        padding: 8px;
    }
    
    .sale-line {
        flex-direction: column;
    }
    
    .sale-line select,
    .sale-line input {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
    }
    
    header nav,
    .action-bar,
    .quick-actions,
    .btn,
    .filter-section {
        display: none !important;
    }
    
    table {
        box-shadow: none;
    }
}