/* =============================================================================
   style.css — Anwars POS · Bootstrap 5 Version
   Custom overrides for visual parity with the React/Tailwind original.
   Bootstrap handles the grid, utilities & components; this file adds only
   what Bootstrap cannot provide out of the box.
============================================================================= */

/* ── Imports ─────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── CSS Variables / Design Tokens ─────────────────────────────────────────── */
:root {
    --pos-accent: #10b981;
    /* emerald-500 */
    --pos-accent-dark: #059669;
    /* emerald-600 */
    --pos-accent-hover: #34d399;
    /* emerald-400 */
    --pos-dark: #111827;
    /* gray-900 */
    --pos-dark-2: #1f2937;
    /* gray-800 */
    --pos-dark-3: #374151;
    /* gray-700 */
    --pos-gray: #f9fafb;
    /* gray-50  */
    --pos-gray-100: #f3f4f6;
    --pos-gray-200: #e5e7eb;
    --pos-gray-400: #9ca3af;
    --pos-gray-500: #6b7280;
    --pos-gray-700: #374151;
    --pos-radius: 0.75rem;
    /* rounded-xl */
    --pos-radius-lg: 1rem;
    /* rounded-2xl */
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    background-color: var(--pos-gray);
    color: #1f2937;
    -webkit-font-smoothing: antialiased;
}

/* Full-screen layout wrapper */
.pos-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Scrollable content area */
.pos-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar-pos {
    background-color: var(--pos-dark) !important;
    height: 48px;
    flex-shrink: 0;
    z-index: 100;
}

.navbar-pos .back-btn {
    background-color: var(--pos-dark-3);
    border-color: var(--pos-dark-3);
    color: #fff;
    transition: background 0.15s;
}

.navbar-pos .back-btn:hover {
    background-color: var(--pos-dark-2);
}

/* ── Accent / Emerald ────────────────────────────────────────────────────── */
.btn-pos-accent {
    background-color: var(--pos-accent);
    border-color: var(--pos-accent);
    color: #fff;
}

.btn-pos-accent:hover {
    background-color: var(--pos-accent-dark);
    border-color: var(--pos-accent-dark);
    color: #fff;
}

.bg-pos-accent {
    background-color: var(--pos-accent) !important;
}

.text-pos-accent {
    color: var(--pos-accent) !important;
}

.border-pos-accent {
    border-color: var(--pos-accent) !important;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.pos-card {
    border: 1px solid var(--pos-gray-200);
    border-radius: var(--pos-radius);
    background: #fff;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.1s;
}

.pos-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
    border-color: var(--pos-gray-400);
}

.pos-card:active {
    transform: scale(0.97);
}

/* ── Dashboard menu cards ─────────────────────────────────────────────────── */
.dashboard-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    border: 1px solid var(--pos-gray-200);
    border-radius: var(--pos-radius);
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    min-height: 90px;
}

.dashboard-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
    border-color: var(--pos-gray-400);
}

.dashboard-card:active {
    transform: scale(0.95);
}

.dashboard-card .icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media (max-width: 575px) {
    .dashboard-card {
        min-height: 76px;
        padding: 0.75rem 0.5rem;
    }

    .dashboard-card .icon-wrap {
        width: 40px;
        height: 40px;
    }
}

/* ── Table Map ───────────────────────────────────────────────────────────── */
.table-btn {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    border: 2px solid var(--pos-gray-200);
    background: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}

.table-btn:hover {
    background: #ecfdf5;
    border-color: var(--pos-accent);
}

.table-btn.occupied {
    background: #fef9c3;
    border-color: #fbbf24;
    color: #92400e;
}

/* ── POS Order Layout ────────────────────────────────────────────────────── */
.pos-order-wrap {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.pos-panel-order {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid var(--pos-gray-200);
}

.pos-panel-category {
    width: 120px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--pos-dark);
    overflow-y: auto;
}

.pos-panel-products {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--pos-dark-2);
    overflow: hidden;
}

@media (max-width: 767px) {
    .pos-order-wrap {
        flex-direction: column;
        overflow-y: auto;
    }

    .pos-panel-order {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--pos-gray-200);
    }

    .pos-panel-category {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        height: auto;
        overflow-x: auto;
    }

    .pos-panel-products {
        min-height: 300px;
    }
}

/* ── Category buttons ────────────────────────────────────────────────────── */
.cat-btn {
    display: block;
    width: 100%;
    padding: 0.6rem 0.5rem;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #d1d5db;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    transition: all 0.15s;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.cat-btn.active {
    background: rgba(16, 185, 129, 0.15);
    border-left-color: var(--pos-accent);
    color: var(--pos-accent);
}

/* ── Product buttons ──────────────────────────────────────────────────────── */
.product-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 64px;
}

.product-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--pos-accent);
}

.product-btn .product-name {
    font-size: 0.7rem;
    text-align: center;
    line-height: 1.2;
    margin-bottom: 2px;
}

.product-btn .product-price {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--pos-accent);
}

/* ── Numpad ───────────────────────────────────────────────────────────────── */
.numpad-btn {
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
    min-height: 44px;
}

.numpad-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.numpad-btn.danger {
    background: #991b1b;
    border-color: #991b1b;
}

.numpad-btn.danger:hover {
    background: #b91c1c;
}

.numpad-btn.success {
    background: var(--pos-accent);
    border-color: var(--pos-accent);
}

.numpad-btn.success:hover {
    background: var(--pos-accent-dark);
}

/* ── PIN dots ─────────────────────────────────────────────────────────────── */
.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #6b7280;
    background: transparent;
    transition: all 0.15s;
}

.pin-dot.filled {
    background: var(--pos-accent);
    border-color: var(--pos-accent);
    transform: scale(1.1);
}

@media (max-width: 575px) {
    .pin-dot {
        width: 12px;
        height: 12px;
    }
}

/* ── Badges / Tags ────────────────────────────────────────────────────────── */
.badge-settled {
    background: #d1fae5;
    color: #065f46;
    font-weight: 600;
}

.badge-open {
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
}

.badge-takeaway {
    background: #ffedd5;
    color: #9a3412;
    font-weight: 600;
}

.badge-restaurant {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.pos-table th {
    background: var(--pos-dark);
    color: #fff;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.pos-table tbody tr {
    cursor: pointer;
}

.pos-table tbody tr:hover {
    background: var(--pos-gray-100);
}

/* ── Stat cards ────────────────────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border: 1px solid var(--pos-gray-200);
    border-radius: var(--pos-radius);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-card .stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card .stat-label {
    font-size: 0.7rem;
    color: var(--pos-gray-500);
}

.stat-card .stat-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--pos-dark);
}

/* ── Pulse animation (active work period) ─────────────────────────────────── */
@keyframes blink-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.35;
    }
}

.animate-pulse {
    animation: blink-pulse 2s infinite;
}

/* ── Payment screen ──────────────────────────────────────────────────────── */
.payment-method-btn {
    border: 2px solid var(--pos-gray-200);
    border-radius: var(--pos-radius);
    background: #fff;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 600;
}

.payment-method-btn:hover {
    border-color: var(--pos-accent);
    background: #ecfdf5;
}

.payment-method-btn.selected {
    border-color: var(--pos-accent);
    background: #d1fae5;
    color: #065f46;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ── Login split panel ─────────────────────────────────────────────────────── */
.login-brand {
    background: linear-gradient(135deg, #065f46 0%, var(--pos-dark) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #fff;
}

.login-panel {
    background: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-box {
    background: var(--pos-dark);
    border-radius: var(--pos-radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.numpad-login {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.numpad-login .numpad-btn {
    font-size: 1.25rem;
    padding: 0.7rem;
}

/* ── Work Period status card ──────────────────────────────────────────────── */
.wp-card-active {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.wp-card-inactive {
    background: var(--pos-gray-100);
    border-color: var(--pos-gray-200);
}

/* ── Responsive helpers ───────────────────────────────────────────────────── */
@media (max-width: 575px) {
    .stat-card {
        padding: 0.5rem 0.75rem;
    }

    .stat-card .stat-value {
        font-size: 0.95rem;
    }

    .login-box {
        padding: 1.25rem;
    }
}