:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #5eead4;
    --primary-bg: #f0fdfa;
    --white: #ffffff;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--gray-100);
    color: var(--gray-800);
    min-height: 100vh;
    padding-top: 64px; /* Để không bị navbar che khi fixed */
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--primary-bg);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.login-header {
    background-color: var(--primary);
    color: var(--white);
    padding: 1.5rem;
    text-align: center;
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-header h1 i {
    margin-right: 0.5rem;
}

.login-header p {
    font-size: 0.875rem;
    opacity: 0.9;
}

.login-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
}

.forgot-password:hover {
    text-decoration: underline;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--gray-200);
    color: var(--gray-800);
}

.btn-secondary:hover {
    background-color: var(--gray-300);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background-color: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background-color: #059669;
}

.btn-warning {
    background-color: var(--warning);
    color: var(--white);
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-info {
    background-color: var(--info);
    color: var(--white);
}

.btn-info:hover {
    background-color: #2563eb;
}

.login-footer {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid var(--gray-200);
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Forgot Password Styles */
.back-to-login {
    display: flex;
    align-items: center;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    margin-top: 1rem;
}

.back-to-login i {
    margin-right: 0.25rem;
}

.back-to-login:hover {
    text-decoration: underline;
}

/* Dashboard Styles */
.dashboard {
    display: none;
    min-height: 100vh;
    background-color: var(--gray-100);
}

.navbar {
    background-color: var(--primary);
    color: var(--white);
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 64px;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
}

.navbar-brand i {
    margin-right: 0.5rem;
}

.navbar-user {
    display: flex;
    align-items: center;
}

.navbar-user-info {
    margin-right: 1rem;
    text-align: right;
}

.navbar-user-name {
    font-weight: 500;
}

.navbar-user-role {
    font-size: 0.75rem;
    opacity: 0.9;
}

.navbar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.sidebar {
    width: 250px;
    background-color: var(--primary);
    height: calc(100vh - 64px);
    position: fixed;
    top: 64px;
    left: 0;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
    z-index: 100;
    overflow-y: auto;
    color: var(--white);
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-item {
    margin-bottom: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--white);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-link:hover {
    background-color: var(--primary-dark);
}

.sidebar-link.active {
    background-color: var(--primary-dark);
    border-left: 3px solid var(--white);
}

.sidebar-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.main-content {
    margin-left: 250px;
    padding: 1.5rem;
    min-height: calc(100vh - 64px);
}

.page-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--gray-800);
}

.card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    background-color: var(--gray-50);
}

/* Dashboard Modules */
.module {
    display: none;
}

.module.active {
    display: block;
}

/* Search and Filter */
.search-container {
    display: flex;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.875rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.filter-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-select {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

th {
    font-weight: 600;
    color: var(--gray-700);
    background-color: var(--gray-50);
}

tr:hover {
    background-color: var(--gray-50);
}

/* Sales Module */
.sales-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
}

.product-list {
    max-height: 400px;
    overflow-y: auto;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.product-info {
    flex: 1;
}

.product-name {
    font-weight: 500;
}

.product-details {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.product-price {
    font-weight: 600;
    color: var(--primary);
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.quantity-input {
    width: 60px;
    padding: 0.25rem 0.5rem;
    text-align: center;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
}

.order-summary {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.summary-label {
    color: var(--gray-600);
}

.summary-value {
    font-weight: 500;
}

.summary-total {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* Statistics and Charts */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.stat-title {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
}

.stat-change {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

.chart-container {
    height: 300px;
    margin-bottom: 1.5rem;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

/* Dashboard Home */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.feature-card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    background-color: var(--primary-bg);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-800);
}

.feature-description {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.welcome-message {
    background-color: var(--primary-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary);
}

.welcome-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.welcome-text {
    color: var(--gray-700);
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    display: none;
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 80%;
    max-width: 600px;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1rem 1.5rem;
    background-color: var(--primary);
    color: var(--white);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.close-modal {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: var(--gray-200);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid var(--gray-200);
}

/* Badge Styles */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.bg-success {
    background-color: var(--success);
    color: var(--white);
}

.bg-warning {
    background-color: var(--warning);
    color: var(--white);
}

.bg-danger {
    background-color: var(--danger);
    color: var(--white);
}

.bg-info {
    background-color: var(--info);
    color: var(--white);
}

/* Payment Methods */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.payment-method {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-method:hover {
    border-color: var(--primary);
}

.payment-method.active {
    border-color: var(--primary);
    background-color: var(--primary-bg);
}

.payment-method-icon {
    margin-right: 0.5rem;
    font-size: 1.25rem;
    color: var(--primary);
}

.payment-method-details {
    display: none;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background-color: var(--gray-50);
}

.payment-method-details.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        transition: width 0.3s;
    }

    .sidebar.active {
        width: 250px;
    }

    .main-content {
        margin-left: 0;
        transition: margin-left 0.3s;
    }

    .main-content.sidebar-active {
        margin-left: 250px;
    }

    .sales-container {
        grid-template-columns: 1fr;
    }

    .feature-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .payment-methods {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.ml-1 {
    margin-left: 0.25rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.mr-1 {
    margin-right: 0.25rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.p-1 {
    padding: 0.25rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 1rem;
}

.w-100 {
    width: 100%;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-end {
    justify-content: flex-end;
}

.align-items-center {
    align-items: center;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-info {
    color: var(--info);
}

.text-primary {
    color: var(--primary);
}

/* Tabs for Reports */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-300);
    margin-bottom: 1rem;
}

.tab {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab.active {
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 500;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

/* Invoice Styles */
.invoice-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.invoice-logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.invoice-info {
    text-align: right;
}

.invoice-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary);
    text-align: center;
}

.invoice-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.invoice-customer {
    flex: 1;
}

.invoice-meta {
    flex: 1;
    text-align: right;
}

.invoice-table {
    width: 100%;
    margin-bottom: 2rem;
}

.invoice-table th {
    background-color: var(--primary-bg);
    color: var(--primary-dark);
}

.invoice-summary {
    display: flex;
    justify-content: flex-end;
}

.invoice-summary-table {
    width: 300px;
}

.invoice-summary-table td {
    padding: 0.5rem 0;
}

.invoice-summary-table td:last-child {
    text-align: right;
}

.invoice-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.invoice-note {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* Print Styles */
@media print {
    body {
        background-color: var(--white);
        padding: 0;
    }

    .navbar,
    .sidebar,
    .btn-print,
    .btn-back {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    .invoice-container {
        box-shadow: none;
        padding: 0;
    }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem;
    border-radius: 4px;
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1100;
    max-width: 300px;
    display: none;
    animation: notificationFadeIn 0.3s;
}

@keyframes notificationFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-success {
    border-left: 4px solid var(--success);
}

.notification-error {
    border-left: 4px solid var(--danger);
}

.notification-warning {
    border-left: 4px solid var(--warning);
}

.notification-info {
    border-left: 4px solid var(--info);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.notification-title {
    font-weight: 600;
}

.notification-close {
    cursor: pointer;
}

.notification-message {
    font-size: 0.875rem;
}

/* Promotion Styles */
.promotion-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: var(--warning);
    color: var(--white);
    margin-left: 0.5rem;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.page-subtitle {
    color: #6b7280;
    font-size: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card .stat-value {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: #6b7280;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.chart-card canvas {
    width: 100%;
}
