/**
 * Aura Retail — Portal & Native POS Terminal Stylesheet
 * Strict Monochrome Design System according to backend/readme.md
 */

:root {
    --p-primary: #111111;
    --p-primary-hover: #333333;
    --p-primary-light: #F7F7F7;
    --p-primary-border: #E4E4E4;
    --p-bg: #F7F7F7;
    --p-surface: #FFFFFF;
    --p-card: #FFFFFF;
    --p-card-subtle: #F7F7F7;
    --p-border: #E4E4E4;
    --p-border-strong: #CCCCCC;
    --p-text: #111111;
    --p-text-body: #333333;
    --p-muted: #888888;

    --p-success: #111111;
    --p-success-light: #F7F7F7;
    --p-success-border: #E4E4E4;
    --p-warning: #737373;
    --p-warning-light: #F7F7F7;
    --p-danger: #111111;
    --p-danger-light: #F7F7F7;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    --transition: all 0.15s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--p-bg);
    color: var(--p-text-body);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .portal-brand-text, .pos-title {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Top Navigation Header */
.portal-header {
    background: var(--p-surface);
    border-bottom: 1px solid var(--p-border);
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--p-text);
}

.portal-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--p-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 1.1rem;
}

.portal-brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--p-text);
    letter-spacing: -0.02em;
}

/* Tab Navigation Bar */
.portal-nav-bar {
    background: var(--p-surface);
    border-bottom: 1px solid var(--p-border);
    padding: 8px 24px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.portal-nav-bar::-webkit-scrollbar {
    display: none;
}

.portal-tab-btn {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    color: var(--p-muted);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: var(--transition);
}

.portal-tab-btn:hover {
    color: var(--p-primary);
    background: var(--p-card-subtle);
}

.portal-tab-btn.active {
    background: var(--p-primary);
    color: #FFFFFF;
    border-color: var(--p-primary);
}

/* Tab Contents */
.portal-tab-content {
    display: none;
    padding: 24px 0 60px 0;
}

.portal-tab-content.active {
    display: block;
}

/* Native POS Layout */
.native-pos-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    height: calc(100vh - 150px);
    min-height: 620px;
}

@media (max-width: 1024px) {
    .native-pos-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

.pos-catalog-pane {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.pos-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    overflow-y: auto;
    padding-top: 12px;
    padding-right: 4px;
}

.pos-item-card {
    background: var(--p-card-subtle);
    border: 1px solid var(--p-border);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

.pos-item-card:hover {
    background: var(--p-surface);
    border-color: #BDBDBD;
}

.pos-item-img {
    width: 100%;
    height: 96px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: #FFFFFF;
    border: 1px solid var(--p-border);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--p-muted);
}

/* Cart Pane */
.pos-cart-pane {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.pos-cart-items-box {
    flex: 1;
    overflow-y: auto;
    margin: 14px 0;
    padding-right: 4px;
}

.pos-cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--p-card-subtle);
    border: 1px solid var(--p-border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: var(--transition);
}

.pos-cart-item-row:hover {
    border-color: #BDBDBD;
    background: #FFFFFF;
}

/* Thermal Receipt Paper Style */
.thermal-paper {
    background: #FFFFFF;
    color: #000000;
    font-family: 'Space Grotesk', 'Courier New', monospace;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--p-border);
    font-size: 12px;
    line-height: 1.4;
    box-shadow: var(--shadow-sm);
}

/* Print Styles for POS */
@media print {
    @page {
        size: 58mm auto;
        margin: 0;
    }
    body * {
        visibility: hidden;
    }
    #nativePrintFrame, #nativePrintFrame * {
        visibility: visible;
    }
    #nativeReceiptPaperPreview, #nativeReceiptPaperPreview * {
        visibility: visible;
    }
}

/* Staff / Worker Portal (`web/w`) */
.w-header {
    background: var(--p-surface);
    border-bottom: 1px solid var(--p-border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.w-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 28px 16px 60px;
}

.w-welcome-box {
    background: var(--p-primary);
    border: 1px solid #2A2A2A;
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    color: #FFFFFF;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.w-card {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.w-invitation-card {
    background: var(--p-card-subtle);
    border: 1px solid var(--p-border);
    padding: 16px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.w-btn-accept {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    background: var(--p-primary);
    color: #FFFFFF;
    border: 1px solid var(--p-primary);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
}

.w-btn-accept:hover {
    background: var(--p-primary-hover);
}

.w-btn-reject {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--p-border);
    color: var(--p-muted);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.w-btn-reject:hover {
    background: var(--p-card-subtle);
    color: var(--p-text);
    border-color: var(--p-text);
}

/* Universal Clean Form Controls (No 1px black Win95 styles) */
input[type="text"],
input[type="number"],
input[type="tel"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="date"],
select,
textarea,
.form-input {
    font-family: inherit;
    border: 1px solid var(--p-border);
    border-radius: var(--radius-md);
    background: #FFFFFF;
    color: var(--p-text);
    padding: 9px 13px;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus,
.form-input:focus {
    border-color: #111111;
    box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.08);
}

/* Tight & Modern Native POS Layout */
.native-pos-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 16px;
    align-items: start;
}

@media (max-width: 1024px) {
    .native-pos-layout {
        grid-template-columns: 1fr;
    }
}

/* Modal Overlay & Card Standards (Strict display:none default) */
.modal-overlay {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 999999 !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
}
.modal-overlay.active {
    display: flex !important;
}
.modal-card {
    background: #FFFFFF !important;
    color: #111111 !important;
    border: 1px solid #E4E4E4 !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3) !important;
    width: 100% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 24px !important;
    box-sizing: border-box !important;
    position: relative !important;
}

