:root {
    /* Primary - Orange vibrant */
    --primary: hsl(14, 100%, 60%);
    /* #FF6B35 */
    --primary-hover: hsl(14, 100%, 55%);

    /* Secondary - Red appetizing */
    --secondary: hsl(353, 67%, 49%);
    /* #C73E3A */

    /* Accent - Yellow warm */
    --accent: hsl(46, 100%, 50%);
    /* #FFB800 */

    /* Success */
    --success: hsl(142, 71%, 45%);

    /* Warning */
    --warning: hsl(45, 93%, 47%);

    /* Destructive */
    --destructive: hsl(0, 84%, 60%);

    /* Backgrounds */
    --background: hsl(0, 0%, 100%);
    --surface: hsl(0, 0%, 98%);
    --card: hsl(0, 0%, 100%);
    --muted: hsl(0, 0%, 96%);
    --border: hsl(0, 0%, 90%);

    /* Text */
    --foreground: hsl(0, 0%, 13%);
    --muted-foreground: hsl(0, 0%, 45%);
    --sidebar-width: 80px;
    --header-height: 70px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--muted);
    color: var(--foreground);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Helpers */
.flex {
    display: flex;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Responsive Grid Utilities (Tailwind-like) */
@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .lg\:grid-cols-5 {
        grid-template-columns: repeat(5, 1fr);
    }
}

.col-span-2 {
    grid-column: span 2;
}

.col-span-3 {
    grid-column: span 3;
}

.col-span-full {
    grid-column: 1 / -1;
}

/* Orders Grid Specific (KDS Style) */
#orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.order-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    border: none !important;
    height: fit-content;
}

.order-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.order-card-header {
    padding: 1rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
}

/* Header status colors */
.status-normal {
    background: var(--success);
}

.status-warning {
    background: var(--warning);
}

.status-critical {
    background: var(--destructive);
}

.order-card-body {
    padding: 1rem;
    flex: 1;
}

.order-card-footer {
    padding: 1rem;
    background: #fdfdfd;
    border-top: 1px dashed var(--border);
}

.order-number-lg {
    font-size: 1.5rem;
}

.order-item-list {
    margin-top: 0.75rem;
}

.order-item-kds {
    display: flex;
    flex-wrap: wrap;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.order-item-kds:last-child {
    border-bottom: none;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.p-1 {
    padding: 0.25rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-4 {
    padding: 1rem;
}

.pb-2 {
    padding-bottom: 0.5rem;
}

.rounded {
    border-radius: 0.5rem;
}

.rounded-full {
    border-radius: 9999px;
}

.border {
    border: 1px solid var(--border);
}

.border-b {
    border-bottom: 1px solid var(--border);
}

.bg-gray-50 {
    background-color: var(--muted);
}

.bg-gray-100 {
    background-color: hsl(0, 0%, 96%);
}

.bg-gray-200 {
    background-color: hsl(0, 0%, 90%);
}

.bg-green-100 {
    background-color: hsl(142, 71%, 95%);
}

.bg-red-100 {
    background-color: hsl(0, 84%, 95%);
}

.bg-blue-100 {
    background-color: hsl(210, 100%, 95%);
}

.text-green-800 {
    color: hsl(142, 71%, 25%);
}

.text-red-800 {
    color: hsl(0, 84%, 25%);
}

.text-red-500 {
    color: var(--destructive);
}

.text-red-600 {
    color: hsl(0, 84%, 50%);
}

.text-red-700 {
    color: hsl(0, 84%, 40%);
}

.text-blue-600 {
    color: hsl(210, 100%, 50%);
}

.text-blue-800 {
    color: hsl(210, 100%, 30%);
}

.text-gray-400 {
    color: hsl(0, 0%, 60%);
}

.text-gray-600 {
    color: var(--muted-foreground);
}

.text-gray-800 {
    color: hsl(0, 0%, 20%);
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.font-mono {
    font-family: 'Courier New', monospace;
}

.text-primary {
    color: var(--primary);
}

.text-muted-foreground {
    color: var(--muted-foreground);
}

.cursor-pointer {
    cursor: pointer;
}

.inline {
    display: inline;
}

.block {
    display: block;
}

.hidden {
    display: none;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
}

.h-32 {
    height: 8rem;
}

.max-w-md {
    max-width: 28rem;
}

.max-w-4xl {
    max-width: 56rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-10 {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

.hover\:bg-gray-50:hover {
    background-color: var(--muted);
}

.hover\:bg-gray-200:hover {
    background-color: hsl(0, 0%, 85%);
}

.hover\:text-blue-800:hover {
    color: hsl(210, 100%, 30%);
}

.hover\:text-red-700:hover {
    color: hsl(0, 84%, 40%);
}

.hover\:shadow-lg:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.transition {
    transition: all 0.2s;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-secondary {
    background-color: var(--muted);
    color: var(--foreground);
}

.btn-destructive {
    background-color: var(--destructive);
    color: white;
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.card {
    background-color: var(--card);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.input,
.select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.input:focus,
.select:focus {
    outline: none;
    border-color: var(--primary);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 1rem;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.login-header {
    text-align: center;
    padding: 2rem 2rem 1rem;
}

.logo-animate {
    font-size: 3rem;
    display: inline-block;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(-5%);
    }

    50% {
        transform: translateY(5%);
    }
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--muted);
}

.tab {
    flex: 1;
    text-align: center;
    padding: 1rem;
    cursor: pointer;
    color: var(--muted-foreground);
    font-weight: 500;
    transition: 0.3s;
}

.tab.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
}

.tab-content {
    padding: 2rem;
    display: none;
}

.tab-content.active {
    display: block;
}

/* Dashboard Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.main-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-tabs {
    display: flex;
    gap: 1rem;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: var(--muted-foreground);
    font-weight: 500;
    font-size: 0.9rem;
    transition: 0.2s;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--muted);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px rgba(255, 107, 53, 0.3);
}

.nav-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* User info - custom visibility handling */
.user-info-container {
    display: none;
    /* Mobile default */
}

@media (min-width: 769px) {
    .user-info-container {
        display: flex !important;
        flex-direction: column;
        align-items: flex-end;
        margin-right: 0.5rem;
    }
}

/* Sales Module */
.sales-layout {
    display: grid;
    grid-template-columns: 6fr 4fr;
    gap: 1.5rem;
    height: calc(100vh - var(--header-height) - 3rem);
}

.products-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

.category-filter {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.cat-btn {
    white-space: nowrap;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: white;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: 0.2s;
}

.cat-btn:hover,
.cat-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    padding: 0.5rem;
}

.product-card {
    background: white;
    border-radius: 20px;
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 185px;
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(255, 107, 53, 0.15);
}

.product-image-container {
    width: 100%;
    height: 85px;
    border-radius: 12px;
    margin-bottom: 0.4rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--muted);
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-img {
    transform: scale(1.1);
}

.product-icon {
    font-size: 2rem;
    opacity: 0.7;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    gap: 1px;
}

.product-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--foreground);
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    color: var(--primary);
    font-weight: 800;
    font-size: 0.95rem;
}

.product-stock {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--muted-foreground);
    background: var(--muted);
    padding: 1px 6px;
    border-radius: 20px;
    width: fit-content;
    margin: 0 auto;
}

.order-section {
    background: white;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    padding: 0;
}

.order-header {
    padding: 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-items {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-item {
    background: var(--muted);
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: 0.2s;
}

.order-footer {
    padding: 1rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.total-display {
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.pay-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.pay-btn {
    padding: 1rem;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pay-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.btn-cash {
    background-color: var(--success);
}

.btn-qr {
    background-color: #0088CC;
}

.btn-card {
    background-color: #6B46C1;
}

.btn-mixed {
    background: linear-gradient(90deg, #F6AD55, #ED8936);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 16px;
    padding: 2rem;
    animation: modalSlide 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalSlide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .sales-layout {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .products-section {
        max-height: none;
        overflow: visible;
    }

    .order-section {
        min-height: auto;
        position: sticky;
        bottom: 0;
        z-index: 100;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        border-radius: 20px 20px 0 0;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .main-header {
        padding: 0 1rem;
        height: var(--header-height);
    }

    .brand {
        font-size: 1.1rem;
    }

    .nav-tabs {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: white;
        border-top: 1px solid var(--border);
        padding: 0.5rem;
        z-index: 1000;
        justify-content: space-around;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    }

    .nav-item {
        flex: 1;
        padding: 0.25rem;
        font-size: 0.65rem;
        min-width: 0;
    }

    .nav-item i {
        font-size: 1.1rem;
    }

    .main-content {
        padding: 0.75rem;
        padding-bottom: 80px;
        /* Space for fixed nav */
    }

    .sales-layout {
        gap: 0.75rem;
        padding-bottom: 20px;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .product-card {
        height: 140px;
        border-radius: 12px;
        padding: 0.4rem;
    }

    .product-image-container {
        height: 60px;
    }

    .product-name {
        font-size: 0.75rem;
    }

    .product-price {
        font-size: 0.8rem;
    }

    .product-stock {
        font-size: 0.6rem;
        padding: 0 4px;
    }

    /* Tables */
    .card table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        padding: 1.25rem;
    }

    .category-filter {
        flex-wrap: wrap;
        overflow-x: visible;
        padding: 0;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pay-buttons {
        grid-template-columns: 1fr 1fr;
        /* Keep 2 columns as user liked */
        gap: 0.5rem;
    }

    .pay-btn {
        padding: 0.6rem;
        font-size: 0.8rem;
    }

    .total-display {
        font-size: 1.1rem;
    }

    h1 {
        font-size: 1.25rem !important;
    }
}

/* Tailwind Compatibility Utilities needed for Admin Panel */
.w-10 {
    width: 2.5rem;
}

.h-10 {
    height: 2.5rem;
}

.w-20 {
    width: 5rem;
}

.h-20 {
    height: 5rem;
}

.object-cover {
    object-fit: cover;
}

.mr-2 {
    margin-right: 0.5rem;
}

/* Base Utility Classes */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.z-10 {
    z-index: 10;
}

.z-50 {
    z-index: 50;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.flex {
    display: flex;
}

.hidden {
    display: none;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.grid {
    display: grid;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.border {
    border: 1px solid var(--border);
}

.border-gray-200 {
    border-color: #e5e7eb;
}

.bg-white {
    background-color: #ffffff;
}

.p-3 {
    padding: 0.75rem;
}

.left-1 {
    left: 0.25rem;
}

.left-4 {
    left: 1rem;
}

.top-1\/2 {
    top: 50%;
}

.-translate-y-1\/2 {
    transform: translateY(-50%);
}

.text-gray-400 {
    color: #9ca3af;
}