* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
    position: relative;
}

.nav-logo-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
}

.nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-brand-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.nav-brand-logo-link:hover {
    transform: scale(1.08);
}

.nav-brand-logo {
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.nav-brand-img {
    height: 75px;
    width: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.15));
    transition: filter 0.3s ease;
}

.nav-brand-logo-link:hover .nav-brand-img {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.btn-login-nav {
    padding: 0.625rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 0.625rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    white-space: nowrap;
}

.btn-login-nav:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1e3a8a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
}

.nav-menu-center {
    justify-content: center;
    grid-column: 2;
    margin: 0 auto;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(30, 64, 175, 0.1) 100%);
    border-radius: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-1px);
}

.nav-link:hover::before {
    opacity: 1;
}

.nav-link-logout {
    color: var(--error-color);
}

.nav-link-logout:hover {
    color: #dc2626;
}

.nav-link-logout::before {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
}

/* Navbar Animations */
.nav-link-animated {
    opacity: 0;
    transform: translateY(-10px);
    animation: fadeInDown 0.6s ease-out forwards;
}

.nav-link-animated:nth-child(1) {
    animation-delay: 0.1s;
}

.nav-link-animated:nth-child(2) {
    animation-delay: 0.2s;
}

.nav-link-animated:nth-child(3) {
    animation-delay: 0.3s;
}

.btn-login-animated {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    animation: fadeInDownScale 0.6s ease-out forwards;
    animation-delay: 0.2s;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDownScale {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.nav-brand-logo-link {
    animation: fadeInLeft 0.8s ease-out;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nav-right-logos {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    padding-left: 1.5rem;
    border-left: 2px solid var(--border-color);
    justify-content: flex-end;
    margin-left: auto;
    grid-column: 3;
    justify-self: end;
}

.nav-logo-img {
    height: 42px;
    width: auto;
    object-fit: contain;
    display: block;
    max-width: 140px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
    opacity: 0.85;
}

.nav-logo-img:hover {
    opacity: 1;
    transform: scale(1.08) translateY(-2px);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.nav-logo-img[src=""],
.nav-logo-img:not([src]) {
    display: none;
}

.nav-logos {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
}

.nav-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
    max-width: 120px;
    transition: opacity 0.2s;
}

.nav-logo:hover {
    opacity: 0.8;
}

.nav-logo[src=""],
.nav-logo:not([src]) {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--error-color);
}

.close-btn {
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-btn:hover {
    opacity: 1;
}

/* Page Header */
.page-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1.5rem;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
    text-align: center;
    width: 100%;
}

/* Search Form */
.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.search-input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    text-align: center;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #475569;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.35);
}

.btn-search {
    background-color: var(--primary-color);
    color: white;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.3s ease;
    height: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
}

.btn-search:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

.btn-edit:hover {
    background-color: #d97706;
}

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

.btn-delete:hover {
    background-color: #dc2626;
}

.btn-block {
    width: 100%;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-header {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1rem;
}

.product-code {
    font-size: 0.875rem;
    font-weight: 500;
}

.product-body {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.product-prices {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.price-item:last-child {
    border-bottom: none;
}

.price-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.price-value {
    font-weight: 600;
    font-size: 1rem;
}

.buy-price {
    color: var(--text-secondary);
}

.sell-price {
    color: var(--primary-color);
}

.top-price {
    color: var(--primary-color);
    font-weight: 600;
}

.kesim-price {
    color: var(--warning-color);
    font-weight: 600;
}

.profit {
    color: var(--success-color);
    font-size: 1.125rem;
}

/* Products List (Unified for Admin and Normal Users) */
.products-list-container {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 2rem;
    overflow-x: auto;
}

.products-list-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.products-list-table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.products-list-table th {
    padding: 1.25rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.products-list-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.products-list-table tbody tr:hover {
    background-color: #f1f5f9;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.products-list-table tbody tr:last-child {
    border-bottom: none;
}

.products-list-table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.products-list-table tbody tr:nth-child(even):hover {
    background-color: #f1f5f9;
}

.products-list-table td {
    padding: 1.25rem 1rem;
    font-size: 0.95rem;
    vertical-align: middle;
}

.product-code-cell {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
}

.product-name-cell {
    color: var(--text-primary);
    font-weight: 500;
    max-width: 300px;
}

.product-group-cell {
    white-space: nowrap;
}

.product-group-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: var(--primary-dark);
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(37, 99, 235, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.product-group-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
}

.text-muted {
    color: var(--text-secondary);
    font-style: italic;
}

.product-price-cell {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.product-price-cell.buy-price {
    color: var(--text-secondary);
    font-weight: 500;
}

.product-price-cell.top-price {
    color: var(--primary-color);
    font-size: 1.05rem;
}

.product-price-cell.kesim-price {
    color: var(--warning-color);
    font-size: 1.05rem;
}

/* Profit Cells */
.profit-cell {
    white-space: nowrap;
    font-weight: 600;
}

.profit-cell.top-profit {
    color: var(--success-color);
}

.profit-cell.kesim-profit {
    color: #059669;
}

.profit-amount {
    display: inline-block;
    font-size: 1rem;
    font-weight: 700;
    margin-right: 0.5rem;
}

.profit-percent {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.8;
    background-color: rgba(16, 185, 129, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

/* Products Table (Legacy - keeping for compatibility) */
.products-table-container {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 2rem;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
}

.products-table thead {
    background-color: var(--primary-color);
    color: white;
}

.products-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
}

.products-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.products-table tbody tr:hover {
    background-color: var(--bg-color);
}

.products-table tbody tr:last-child {
    border-bottom: none;
}

.products-table td {
    padding: 1rem 1.5rem;
    color: var(--text-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-primary);
}

.login-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.login-info {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

.login-info p {
    margin-bottom: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Admin */
.admin-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.admin-section {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
}

.admin-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    margin-bottom: 0;
}

.admin-search-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.admin-search-input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    min-width: 200px;
    max-width: 400px;
    transition: border-color 0.2s;
}

.admin-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.product-form {
    max-width: 800px;
}

/* Admin Table */
.admin-table-container {
    overflow-x: auto;
    margin-top: 1.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-bg);
}

.admin-table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.admin-table th {
    padding: 1.25rem 1rem;
    text-align: left;
    font-weight: 600;
    color: white;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

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

.admin-table tbody tr {
    transition: all 0.2s ease;
}

.admin-table tbody tr:hover {
    background-color: #f1f5f9;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.admin-table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.admin-table tbody tr:nth-child(even):hover {
    background-color: #f1f5f9;
}

.admin-table .profit-cell {
    white-space: nowrap;
}

.admin-table .profit-cell.top-profit {
    color: var(--success-color);
}

.admin-table .profit-cell.kesim-profit {
    color: #059669;
}

.admin-table .profit-amount {
    display: inline-block;
    font-size: 1rem;
    font-weight: 700;
    margin-right: 0.5rem;
}

.admin-table .profit-percent {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.8;
    background-color: rgba(16, 185, 129, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.profit-rate {
    color: var(--success-color);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    background-color: #d1fae5;
    border-radius: 0.25rem;
    display: inline-block;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.form-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
}

/* Footer */
.footer {
    background-color: var(--card-bg);
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1024px) {
    .navbar-container {
        padding: 1rem 1.5rem;
        gap: 1.5rem;
    }

    .nav-menu {
        gap: 0.5rem;
    }

    .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .nav-right-logos {
        gap: 0.75rem;
        padding-left: 1rem;
    }

    .nav-logo-img {
        height: 38px;
        max-width: 120px;
    }

    .nav-brand-img {
        height: 65px;
    }

    .container {
        padding: 0 1.5rem;
    }

    .products-list-table {
        font-size: 0.9rem;
    }

    .products-list-table th,
    .products-list-table td {
        padding: 1rem 0.75rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0;
    }

    .navbar-container {
        grid-template-columns: 1fr;
        padding: 0.75rem 1rem;
        gap: 0;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-logo-left {
        order: 1;
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-center {
        position: static;
        transform: none;
        order: 1;
        margin: 0 auto;
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-brand-img {
        height: 50px;
    }

    .nav-menu {
        order: 2;
        width: 100%;
        display: flex;
        justify-content: space-around;
        align-items: center;
        gap: 0.25rem;
        padding: 0.75rem 0.5rem;
        border-bottom: 1px solid var(--border-color);
        margin: 0;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .nav-menu-center {
        justify-content: space-around;
        grid-column: auto;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: fit-content;
        text-align: center;
        border-radius: 0.5rem;
        transition: all 0.2s ease;
    }

    .nav-link:active {
        background-color: rgba(37, 99, 235, 0.1);
        transform: scale(0.95);
    }

    .btn-login-nav {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: fit-content;
    }

    .btn-login-nav:active {
        transform: scale(0.95);
    }

    .nav-right-logos {
        order: 3;
        margin: 0;
        padding: 0.75rem 0;
        border: none;
        justify-content: center;
        gap: 1.25rem;
        width: 100%;
    }

    .nav-logo-img {
        height: 32px;
        max-width: 90px;
        opacity: 0.9;
    }

    .nav-logo-img:active {
        opacity: 1;
        transform: scale(0.95);
    }
}

    .container {
        padding: 0 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.5rem;
        text-align: center;
    }

    .search-form {
        max-width: 100%;
        width: 100%;
        justify-content: center;
    }

    .search-input {
        font-size: 0.9rem;
        padding: 0.625rem 0.875rem;
    }

    .btn-search {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    .btn-secondary {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    .products-list-container {
        margin-top: 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .products-list-table {
        min-width: 700px;
        font-size: 0.85rem;
    }

    .products-list-table th,
    .products-list-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .product-group-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.625rem;
    }

    .profit-amount,
    .profit-percent {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .navbar-container {
        padding: 0.5rem 0.75rem;
    }

    .nav-logo-left {
        padding: 0.4rem 0;
    }

    .nav-center {
        padding: 0.4rem 0;
    }

    .nav-brand-img {
        height: 45px;
    }

    .nav-menu {
        padding: 0.625rem 0.25rem;
        gap: 0.25rem;
        justify-content: flex-start;
    }

    .nav-link {
        padding: 0.5rem 0.625rem;
        font-size: 0.8rem;
        min-width: auto;
    }

    .btn-login-nav {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .nav-right-logos {
        padding: 0.625rem 0;
        gap: 1rem;
    }

    .nav-logo-img {
        height: 28px;
        max-width: 80px;
    }
}

    .container {
        padding: 0 0.75rem;
    }

    .main-content {
        padding: 1.5rem 0;
    }

    .page-header {
        align-items: center;
    }

    .page-header h1 {
        font-size: 1.25rem;
        text-align: center;
    }

    .search-form {
        flex-direction: row;
        gap: 0.5rem;
        max-width: 100%;
    }

    .search-input {
        flex: 1;
    }

    .btn-search {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        flex-shrink: 0;
    }

    .btn-secondary {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        flex-shrink: 0;
    }

    .products-list-table {
        min-width: 600px;
        font-size: 0.8rem;
    }

    .products-list-table th,
    .products-list-table td {
        padding: 0.625rem 0.4rem;
        font-size: 0.8rem;
    }

    .product-code-cell {
        font-size: 0.85rem;
    }

    .product-group-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    .profit-amount {
        font-size: 0.75rem;
    }

    .profit-percent {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }

    .admin-section {
        padding: 1.5rem 1rem;
    }

    .form-container {
        padding: 1.5rem 1rem;
    }

    .form-group input,
    .form-group select {
        font-size: 0.9rem;
        padding: 0.625rem 0.875rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
}

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-form {
        max-width: 100%;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .products-table-container {
        overflow-x: auto;
    }

    .products-table {
        min-width: 600px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .admin-table-container {
        overflow-x: scroll;
    }

    .action-buttons {
        flex-direction: column;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-search-form {
        width: 100%;
    }

    .admin-search-input {
        min-width: 100%;
        flex: 1;
    }
}

