/* ===== CRM Frontend - Modern Design System ===== */

/* CSS Variables */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --accent: #f59e0b;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;

    /* Neutral Colors */
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --gradient-card: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(30, 41, 59, 0.4) 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.875rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.page-wrapper {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
}

.main-content {
    flex: 1;
    padding: 2rem;
    margin-left: 280px;
    transition: margin-left var(--transition-normal);
    max-width: 100%;
    overflow-x: hidden;
}

@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
        padding: 1rem;
        width: 100%;
    }
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
    background-color: #F5F5F5;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
    background-color: #F5F5F5;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: #825ef4;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo i {
    font-size: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-logo span {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.nav-link i {
    font-size: 1.25rem;
    width: 1.5rem;
    text-align: center;
}

/* Cards */
.card {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 0;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.primary {
    background: var(--gradient-primary);
}

.stat-icon.secondary {
    background: var(--gradient-secondary);
}

.stat-icon.accent {
    background: var(--gradient-accent);
}

.stat-icon.success {
    background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
}

.stat-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-content p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    margin-top: 0.5rem;
}

.stat-change.positive {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.stat-change.negative {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}

.btn-success {
    background: var(--gradient-secondary);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary-light);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.input-group {
    position: relative;
}

.input-group .form-input {
    padding-left: 3rem;
}

.input-group-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group-addon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-card);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--bg-card-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.badge-info {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
}

.badge-secondary {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-secondary);
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    margin-bottom: 0.25rem;
}

.page-header p {
    margin: 0;
    font-size: 0.9375rem;
}

/* Login Page Specific */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.login-container {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 2rem;
}

.login-card {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow-glow);
}

.login-logo i {
    font-size: 2.5rem;
    color: white;
}

.login-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    margin: 0;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.login-footer a {
    color: var(--primary-light);
    font-weight: 500;
}

/* Product Page (One Page) */
.product-page {
    min-height: 100vh;
    background: var(--bg-dark);
}

.product-hero {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: 4rem 0;
    overflow: hidden;
}

.product-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
}

.product-hero .container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 768px) {
    .product-hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.product-image {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.product-image img {
    width: 100%;
    height: auto;
    display: block;
}

.product-info h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 1.5rem;
}

.product-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.product-features {
    list-style: none;
    margin-bottom: 2rem;
}

.product-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    color: var(--text-secondary);
}

.product-features li i {
    color: var(--success);
    font-size: 1.25rem;
}

/* Payment Section */
.payment-section {
    padding: 4rem 0;
    background: var(--bg-card);
}

.payment-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
}

.payment-header {
    text-align: center;
    margin-bottom: 2rem;
}

.payment-summary {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.payment-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.payment-summary-row:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 1.25rem;
}

/* Invoice Display */
.invoice-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 3rem;
    max-width: 800px;
    margin: 2rem auto;
    color: #1e293b;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
}

.invoice-logo h2 {
    color: #6366f1;
    font-size: 2rem;
    margin: 0;
}

.invoice-details {
    text-align: right;
}

.invoice-details h3 {
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.invoice-details p {
    color: #64748b;
    margin: 0.25rem 0;
}

.invoice-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.invoice-party h4 {
    color: #6366f1;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.invoice-party p {
    color: #475569;
    margin: 0.25rem 0;
}

.invoice-table {
    width: 100%;
    margin-bottom: 2rem;
}

.invoice-table th {
    background: #f1f5f9;
    color: #475569;
    padding: 1rem;
    text-align: left;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.invoice-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
}

.invoice-totals {
    display: flex;
    justify-content: flex-end;
}

.invoice-totals-table {
    width: 300px;
}

.invoice-totals-table tr td {
    padding: 0.75rem 1rem;
}

.invoice-totals-table tr td:first-child {
    color: #64748b;
}

.invoice-totals-table tr td:last-child {
    text-align: right;
    font-weight: 500;
}

.invoice-totals-table tr.total {
    background: #6366f1;
    color: white;
}

.invoice-totals-table tr.total td {
    color: white;
    font-weight: 600;
    font-size: 1.125rem;
}

.invoice-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

body.sidebar-open {
    overflow: hidden;
}


/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-slide-in {
    animation: slideIn 0.5s ease forwards;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    background: var(--gradient-primary);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 0.875rem;
}

.avatar-lg {
    width: 60px;
    height: 60px;
    font-size: 1.25rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.875rem 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text-secondary);
}

.tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary);
}

/* Search */
.search-box {
    position: relative;
    max-width: 400px;
}

.search-box input {
    padding-left: 3rem;
    padding-right: 1rem;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-upload:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.file-upload i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.file-upload input {
    display: none;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

/* Switch Toggle */
.switch {
    position: relative;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-card-hover);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-fast);
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.switch input:checked+.switch-slider {
    background: var(--primary);
}

.switch input:checked+.switch-slider::before {
    transform: translateX(24px);
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
    z-index: 100;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* Print Styles */
@media print {

    .sidebar,
    .mobile-menu-toggle,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    .invoice-container {
        box-shadow: none;
        padding: 0;
    }
}

/* ========== RESPONSIVE / MOBILE STYLES ========== */

/* Large Tablets & Small Desktops */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-container {
        gap: 2rem;
    }
}

/* Tablets */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        padding-top: 3.5rem;
    }

    .page-header .d-flex {
        width: 100%;
        flex-wrap: wrap;
    }

    .page-header .btn {
        flex: 1;
        min-width: 140px;
    }

    h1 {
        font-size: 1.75rem;
    }

    .card {
        padding: 1.25rem;
    }

    .invoice-parties {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Mobile Phones */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.375rem;
    }

    h3 {
        font-size: 1.125rem;
    }

    .main-content {
        padding: 1rem;
    }

    .page-header {
        padding-top: 4rem;
        gap: 0.75rem;
        flex-direction: column;
        align-items: stretch;
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    .page-header p {
        font-size: 0.8125rem;
    }

    .page-header>.btn,
    .page-header .d-flex {
        width: 100%;
    }

    .page-header .d-flex {
        flex-direction: column;
    }

    .page-header .d-flex .btn {
        width: 100%;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .stat-content h3 {
        font-size: 1.375rem;
    }

    /* Cards */
    .card {
        padding: 1rem;
        border-radius: var(--radius-md);
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .card-header .btn {
        width: 100%;
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.75rem;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .form-group {
        margin-bottom: 1rem;
    }

    /* Buttons */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    /* Full width buttons only in specific contexts */
    .page-header>.btn,
    form>div:last-child .btn:not(.btn-sm):not(.btn-icon),
    .login-card .btn,
    .checkout-card .btn[type="submit"] {
        width: 100%;
    }

    .btn-lg {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }

    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
        width: auto;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
    }

    .d-flex.gap-1,
    .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    .d-flex.gap-1>.btn,
    .d-flex.gap-2>.btn {
        flex: 1;
        min-width: 80px;
    }

    /* Tables */
    .table-wrapper {
        margin: 0 -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table th,
    .table td {
        padding: 0.625rem 0.5rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .table th:first-child,
    .table td:first-child {
        padding-left: 1rem;
    }

    .table th:last-child,
    .table td:last-child {
        padding-right: 1rem;
    }

    /* İşlem butonları - mobilde daha küçük */
    .table .btn-icon {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .table .d-flex.gap-1 {
        gap: 0.25rem;
        flex-wrap: nowrap;
    }

    /* Login */
    .login-card {
        padding: 1.5rem;
        border-radius: var(--radius-lg);
    }

    .login-logo {
        width: 64px;
        height: 64px;
    }

    .login-logo i {
        font-size: 2rem;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    /* Invoice / Payment */
    .invoice-container {
        padding: 1.5rem;
        margin: 1rem;
    }

    .invoice-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .invoice-details {
        text-align: center;
    }

    .invoice-logo h2 {
        font-size: 1.5rem;
    }

    .invoice-table th,
    .invoice-table td {
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .invoice-totals {
        justify-content: center;
    }

    .invoice-totals-table {
        width: 100%;
    }

    /* Product Page */
    .product-container {
        grid-template-columns: 1fr !important;
        padding: 0 1rem;
        gap: 2rem;
    }

    .product-title {
        font-size: 1.75rem !important;
    }

    .product-price {
        font-size: 1.75rem !important;
    }

    .product-description {
        font-size: 1rem;
    }

    .product-image {
        min-height: 250px !important;
    }

    .buy-btn {
        width: 100%;
        padding: 1rem !important;
        font-size: 1rem !important;
    }

    .checkout-card {
        padding: 1.5rem;
        margin: 0 1rem;
        border-radius: var(--radius-lg);
    }

    .order-summary {
        padding: 1rem;
    }

    .order-row {
        font-size: 0.875rem;
    }

    /* Customers Grid */
    .customers-grid {
        grid-template-columns: 1fr !important;
    }

    .customer-card {
        padding: 1rem;
    }

    .customer-avatar {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.125rem !important;
    }

    .customer-info h4 {
        font-size: 1rem;
    }

    .customer-info p {
        font-size: 0.75rem;
    }

    .customer-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .customer-stat {
        flex: 1;
        min-width: 80px;
    }

    .customer-stat .value {
        font-size: 1rem;
    }

    /* Products Grid */
    .products-grid {
        grid-template-columns: 1fr !important;
    }

    .product-card-image {
        height: 150px;
    }

    .product-card-body {
        padding: 1rem;
    }

    .product-card-price {
        font-size: 1.25rem;
    }

    .product-card-footer {
        flex-direction: column;
    }

    .product-card-footer .btn {
        width: 100%;
    }

    /* Invoice Items (Create Invoice) */
    .invoice-item {
        grid-template-columns: 1fr !important;
        padding: 1rem;
        background: var(--bg-card);
        border-radius: var(--radius-md);
        border: 1px solid var(--border-color);
    }

    .invoice-item .form-group {
        margin-bottom: 0.75rem;
    }

    .invoice-item .remove-item {
        width: 100%;
        height: 36px;
        margin-top: 0.5rem;
    }

    /* Totals Section */
    .totals-section {
        padding: 1rem;
    }

    .totals-row {
        font-size: 0.9375rem;
    }

    /* Tabs */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    .tab {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        white-space: nowrap;
    }

    /* Dropdown */
    .dropdown-menu {
        min-width: 160px;
    }

    .dropdown-item {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Badges */
    .badge {
        padding: 0.25rem 0.5rem;
        font-size: 0.625rem;
    }
}

/* Small Mobile Phones */
@media (max-width: 480px) {
    .main-content {
        padding: 0.75rem;
    }

    .page-header {
        padding-top: 4.5rem;
    }

    .mobile-menu-toggle {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .card {
        padding: 0.875rem;
    }

    .stat-card {
        padding: 0.875rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stat-content h3 {
        font-size: 1.125rem;
    }

    .stat-content p {
        font-size: 0.75rem;
    }

    .btn {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }

    .login-container {
        padding: 1rem;
    }

    .login-card {
        padding: 1.25rem;
    }

    .invoice-container {
        padding: 1rem;
        margin: 0.5rem;
    }

    .checkout-card {
        padding: 1rem;
        margin: 0 0.5rem;
    }

    .product-hero {
        padding: 2rem 0;
    }

    .product-title {
        font-size: 1.5rem !important;
    }

    .product-price {
        font-size: 1.5rem !important;
    }
}

/* Touch Device Optimization */
@media (hover: none) and (pointer: coarse) {

    .btn:hover,
    .card:hover,
    .stat-card:hover,
    .nav-link:hover,
    .product-card:hover,
    .customer-card:hover {
        transform: none;
    }

    .btn:active {
        transform: scale(0.98);
    }
}

/* Landscape Mode on Mobile */
@media (max-width: 900px) and (orientation: landscape) {
    .login-wrapper {
        padding: 1rem 0;
    }

    .login-card {
        padding: 1.5rem;
    }

    .login-logo {
        width: 48px;
        height: 48px;
    }

    .login-logo i {
        font-size: 1.5rem;
    }

    .login-header {
        margin-bottom: 1rem;
    }

    .form-group {
        margin-bottom: 0.75rem;
    }
}
