/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap');

/* Color Variables & Design Tokens */
:root {
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-dark: #0f172a;
    --bg-card-dark: rgba(30, 41, 59, 0.7);
    --border-color-dark: rgba(255, 255, 255, 0.08);
    
    --bg-light: #f8fafc;
    --bg-card-light: #ffffff;
    --border-color-light: #e2e8f0;
    
    --text-primary-light: #0f172a;
    --text-secondary-light: #475569;
    --text-muted-light: #94a3b8;
    
    --text-primary-dark: #f8fafc;
    --text-secondary-dark: #cbd5e1;
    --text-muted-dark: #64748b;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme as Default, but with dark mode compatibility elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary-light);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: 60px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

/* Glassmorphism Container styling */
.app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navbar / Header */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card-light);
    border: 1px solid var(--border-color-light);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-brand svg {
    stroke: var(--primary-color);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
    background: var(--bg-light);
    border-color: var(--border-color-light);
    color: var(--text-secondary-light);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: 6px;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card-light);
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted-light);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary-light);
}

.stat-card.primary {
    background: var(--primary-gradient);
    border: none;
    color: white;
}

.stat-card.primary .stat-title {
    color: rgba(255, 255, 255, 0.8);
}

.stat-card.primary .stat-value {
    color: white;
}

/* Dashboard Filter Bar */
.filter-bar {
    background: var(--bg-card-light);
    border: 1px solid var(--border-color-light);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-form {
    display: flex;
    flex: 1;
    gap: 10px;
    min-width: 280px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color-light);
    background: white;
    font-size: 0.875rem;
    color: var(--text-primary-light);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Receipt Card / Table Container */
.panel {
    background: var(--bg-card-light);
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-size: 1.1rem;
    color: var(--text-primary-light);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.receipt-table th {
    background: #f1f5f9;
    padding: 14px 20px;
    font-weight: 600;
    color: var(--text-secondary-light);
    border-bottom: 2px solid var(--border-color-light);
}

.receipt-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color-light);
    color: var(--text-secondary-light);
    vertical-align: middle;
}

.receipt-table tr:hover {
    background: rgba(241, 245, 249, 0.5);
}

.receipt-table tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-cgst-sgst {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.badge-igst {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-none {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary-light);
}

.action-links {
    display: flex;
    gap: 8px;
}

/* Alert Notification Banner */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.2);
}

/* Login Page Styling */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent), 
                radial-gradient(circle at bottom left, rgba(79, 70, 229, 0.05), transparent),
                var(--bg-light);
    padding: 20px;
}

.login-card {
    background: var(--bg-card-light);
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    background: rgba(79, 70, 229, 0.1);
    border-radius: 50%;
    margin-bottom: 16px;
}

.login-logo svg {
    stroke: var(--primary-color);
}

.login-title {
    font-size: 1.5rem;
    color: var(--text-primary-light);
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary-light);
    margin-top: 4px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary-light);
    margin-bottom: 6px;
}

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

/* Edit / Add Forms Page layouts */
.form-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

@media (max-width: 868px) {
    .form-layout {
        grid-template-columns: 1fr;
    }
}

.calculation-card {
    background: var(--bg-card-light);
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 24px;
    position: sticky;
    top: 20px;
}

.calc-title {
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color-light);
    padding-bottom: 12px;
    margin-bottom: 16px;
    color: var(--text-primary-light);
}

.calc-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.875rem;
    color: var(--text-secondary-light);
}

.calc-row.total {
    border-top: 2px dashed var(--border-color-light);
    padding-top: 14px;
    margin-top: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary-light);
}

.calc-highlight {
    color: var(--primary-color);
    font-weight: 600;
}

.input-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary-light);
    cursor: pointer;
    user-select: none;
}

.input-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

/* Receipt Details View Modal CSS classes */
.detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.detail-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: scale(0.95);
    transition: var(--transition);
}

.detail-modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    background: var(--primary-gradient);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.25rem;
}

.modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-body .grid-2,
.modal-body .grid-3 {
    margin-bottom: 8px;
    gap: 12px;
}

.modal-body .detail-item {
    margin-bottom: 6px;
}

.modal-body .detail-label {
    font-size: 0.65rem;
}

.modal-body .detail-val {
    font-size: 0.85rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.detail-item {
    margin-bottom: 12px;
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted-light);
}

.detail-val {
    font-size: 0.95rem;
    color: var(--text-primary-light);
    font-weight: 500;
}

@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }
    .navbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 16px;
    }
    .navbar-brand {
        justify-content: center;
    }
    .navbar-user {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }
    .user-badge {
        padding: 4px 10px;
        font-size: 0.8rem;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }
    .search-form {
        width: 100%;
        min-width: 0;
    }
    .panel-header {
        padding: 12px 16px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .panel-title {
        font-size: 1rem;
    }
    .receipt-table th, 
    .receipt-table td {
        padding: 12px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .modal-content {
        width: calc(100% - 24px);
        margin: 12px;
        max-height: 95vh;
    }
    .modal-body {
        padding: 12px 16px;
    }
    .modal-body .grid-2,
    .modal-body .grid-3 {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 8px;
    }
}
