/* assets/css/style.css - Modern Admin Panel 2025 */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* CSS Variables for modern theme */
:root {
    --primary-gradient: linear-gradient(135deg, #4158D0 0%, #C850C0 100%);
    --secondary-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --accent-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --blue-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    --bg-light: #f5f7fa;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: rgba(0, 0, 0, 0.05);
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.08);
    --shadow-hover: 0 30px 50px rgba(65, 88, 208, 0.15);
    
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--border-color);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    overflow-y: auto;
}

.sidebar.collapsed {
    transform: translateX(-280px);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

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

.brand i {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2rem;
}

.sidebar-nav {
    padding: 1.5rem 1rem;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-weight: 500;
    gap: 12px;
    text-decoration: none;
}

.nav-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.nav-link:hover {
    background: linear-gradient(135deg, rgba(65, 88, 208, 0.05), rgba(200, 80, 192, 0.05));
    color: #4158D0;
    transform: translateX(5px);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 10px 20px rgba(65, 88, 208, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    transition: var(--transition);
    min-height: 100vh;
    background: var(--bg-light);
}

.main-content.expanded {
    margin-left: 0;
}

/* Top Navigation */
.top-navbar {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    display: none;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    font-size: 0.625rem;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.user-profile:hover {
    background: rgba(0,0,0,0.02);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    text-align: left;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.stat-details {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    background: rgba(0,0,0,0.02);
}

.stat-trend.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.stat-trend.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.card-header h5 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* Table Styles */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom-width: 1px;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
}

.table td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.table-hover tbody tr:hover {
    background: linear-gradient(135deg, rgba(65, 88, 208, 0.02), rgba(200, 80, 192, 0.02));
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 30px;
    font-size: 0.75rem;
}

.badge-success {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    border-radius: 40px;
    transition: var(--transition);
    font-size: 0.875rem;
}

.btn-gradient {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 10px 20px rgba(65, 88, 208, 0.3);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(65, 88, 208, 0.4);
    color: white;
}

.btn-outline-primary {
    border: 1px solid rgba(65, 88, 208, 0.3);
    color: #4158D0;
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(65, 88, 208, 0.1);
    color: #4158D0;
    transform: scale(1.1);
}

/* Pagination */
.pagination {
    gap: 5px;
}

.page-link {
    border: none;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.page-item.active .page-link {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 5px 15px rgba(65, 88, 208, 0.3);
}

.page-link:hover {
    background: linear-gradient(135deg, rgba(65, 88, 208, 0.1), rgba(200, 80, 192, 0.1));
    color: #4158D0;
    transform: translateY(-2px);
}

/* Progress Bars */
.progress {
    background-color: rgba(0,0,0,0.03);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Footer */
.footer {
    margin-top: 2rem;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}

.auth-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #e9efff 100%);
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.container-fluid.py-4 {
    padding-bottom: 0 !important;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-280px);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .user-info {
        display: none;
    }
    
    .stat-card {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .top-navbar {
        padding: 1rem;
    }
    
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-header {
        padding: 1.25rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .table-responsive {
        margin: 0 -1rem;
        width: calc(100% + 2rem);
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-details {
        width: 100%;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.02);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4158D0, #C850C0);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #C850C0, #4158D0);
}

/* Glassmorphism Effects */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Invoice page */

.classic-invoice-wrap {
    border: none;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border-radius: var(--radius-md);
}

.classic-invoice-wrap .card-header {
    background: var(--primary-gradient);
    border-bottom: none;
    padding: 1rem 1.5rem;
}

.classic-invoice-wrap .card-header h5,
.classic-invoice-wrap .card-header .btn-outline-primary {
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}

.classic-invoice-wrap .card-header .btn-outline-primary:hover {
    background: rgba(255,255,255,0.15);
}

.classic-invoice-wrap .card-body {
    background: #fff;
    padding: 2rem;
}

.classic-bill-form {
    font-family: 'Inter', sans-serif;
    color: #1e293b;
}

.classic-sheet {
    max-width: 860px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.75rem 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.classic-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #334155;
}

.bill-input,
.bill-input-date {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    outline: none;
    min-width: 130px;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    line-height: 1.4;
    transition: var(--transition);
}

.bill-input-date {
    min-width: 150px;
}

.bill-input:hover,
.bill-input-date:hover {
    border-color: #94a3b8;
}

.bill-input:focus,
.bill-input-date:focus {
    border-color: #4158D0;
    box-shadow: 0 0 0 3px rgba(65, 88, 208, 0.1);
    background: #fff;
    outline: none;
}

.bill-input::placeholder,
.bill-cell-input::placeholder {
    color: #94a3b8;
}

.classic-bill-table {
    border-color: #e2e8f0 !important;
    font-size: 0.88rem;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
}

.classic-bill-table thead tr th {
    background: #f1f5f9 !important;
    color: #475569;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-color: #e2e8f0 !important;
    padding: 0.55rem 0.6rem;
}

.classic-bill-table td {
    border-color: #e2e8f0 !important;
    background: #fff !important;
    padding: 0.4rem 0.6rem;
    vertical-align: middle;
    color: #1e293b;
}

.classic-bill-table tbody tr:hover td {
    background: #f8fafc !important;
}

.bill-cell-input {
    width: 100%;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    outline: none;
    padding: 5px 8px;
    min-height: 32px;
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    border-radius: 7px;
    transition: var(--transition);
}

.bill-cell-input:hover {
    border-color: #94a3b8;
}

.bill-cell-input:focus {
    border-color: #4158D0;
    box-shadow: 0 0 0 3px rgba(65, 88, 208, 0.1);
    background: #fff;
    outline: none;
}

.bill-cell-input[type='number'] {
    text-align: right;
    -moz-appearance: textfield;
}

.bill-cell-input[type='number']::-webkit-outer-spin-button,
.bill-cell-input[type='number']::-webkit-inner-spin-button,
.bill-input-date::-webkit-outer-spin-button,
.bill-input-date::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.order-slip-title {
    text-align: center;
    font-size: 1.5rem;
    margin: 1.25rem 0 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #1e293b;
    position: relative;
}

.order-slip-title::before,
.order-slip-title::after {
    content: '';
    display: inline-block;
    width: 50px;
    height: 1px;
    background: #94a3b8;
    vertical-align: middle;
    margin: 0 10px;
}

.remove-item-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #ef4444;
    line-height: 1;
    font-size: 1rem;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    transition: var(--transition);
}

.remove-item-btn:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.gst-input {
    width: 56px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    text-align: center;
    outline: none;
    border-radius: 7px;
    padding: 4px 6px;
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
}

.gst-input:focus {
    border-color: #4158D0;
    box-shadow: 0 0 0 3px rgba(65, 88, 208, 0.1);
    background: #fff;
    outline: none;
}

.sig-line {
    display: inline-block;
    width: 140px;
    border-bottom: 2px solid #1e293b;
    margin-left: 6px;
    vertical-align: middle;
}

@media print {
    .sidebar,
    .top-navbar,
    .footer,
    .scroll-top-btn,
    .classic-invoice-wrap .card-header,
    .remove-item-btn {
        display: none !important;
    }

    .main-content,
    .main-content.expanded {
        margin-left: 0 !important;
    }

    .classic-invoice-wrap,
    .classic-sheet {
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        background: #fff !important;
    }

    .container-fluid,
    .invoice-page {
        padding: 0 !important;
        margin: 0 !important;
    }

    body {
        background: white !important;
    }

    .bill-input,
    .bill-input-date,
    .bill-cell-input,
    .gst-input {
        border: 0 !important;
        border-bottom: 1px solid #000 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 2px !important;
        min-height: 18px !important;
    }
}