/* ==========================================================================
   WATERSORS COHESIVE SYSTEM DESIGN TOKENS
   ========================================================================== */
:root {
    --primary: #0284c7;        
    --primary-hover: #0369a1;  
    --success: #16a34a;        
    --danger: #dc2626;         
    --warning: #ea580c;        
    --dark: #1e293b;           
    --light: #f8fafc;          
    --gray: #64748b;           
    --border: #e2e8f0;         
    --radius: 8px;             
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: #f1f5f9;
    color: var(--dark);
    min-height: 100vh;
}

/* ADMIN STRUCTURAL VIEWPORT MATRIX LAYOUT */
.app-header {
    background: #ffffff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-brand h1 { font-size: 18px; font-weight: 700; }
.header-brand p { font-size: 12px; color: var(--gray); }

.app-layout {
    display: flex;
    min-height: calc(100vh - 68px);
}

.sidebar {
    width: 260px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-btn {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.15s ease;
}

.nav-btn:hover { background: var(--light); color: var(--primary); }
.nav-btn.active { background: #e0f2fe; color: var(--primary); font-weight: 600; }
.nav-badge { background: var(--danger); color: white; font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: bold; }

.main-content { flex: 1; padding: 30px; overflow-y: auto; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* CASHIER LANE GRID SYSTEM */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 25px;
    align-items: start;
}

/* THE COLLAPSIBLE AUTOMATIC AUTOCOMPLETE COMPONENT */
.search-container {
    position: relative;
    width: 100%;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 5px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow);
    display: none; 
}

.dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid var(--light);
}
.dropdown-item:hover { background: var(--light); }

/* POS SYSTEM TILES WINDOW SELECTION GRID */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.product-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.product-card:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow); }
.product-card h3 { font-size: 15px; margin-bottom: 10px; font-weight: 600; }
.product-card .price { font-size: 20px; font-weight: 700; color: var(--primary); }

.cart-panel { background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.cart-items { min-height: 150px; max-height: 300px; overflow-y: auto; margin-bottom: 20px; }
.cart-item-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.cart-totals { background: var(--light); padding: 15px; border-radius: var(--radius); }
.total-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.total-row.main-price { font-size: 18px; font-weight: bold; border-top: 1px solid var(--border); padding-top: 8px; color: var(--dark); }
.total-row.main-price span:last-child { color: var(--success); }

/* PUBLIC REMOTES INTERFACES SCENARIO */
.public-body {
    background: linear-gradient(135deg, #e0f2fe 0%, #f1f5f9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.public-wrapper { width: 100%; max-width: 580px; display: flex; flex-direction: column; gap: 20px; }
.portal-center-logo { text-align: center; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: var(--light); padding: 6px; border-radius: var(--radius); margin-bottom: 20px; }
.auth-tab-btn { padding: 10px; background: transparent; border: none; font-weight: 600; cursor: pointer; }
.auth-tab-btn.active { background: #ffffff; color: var(--primary); border-radius: calc(var(--radius) - 2px); }

.counter-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--border); }
.counter-ctrl { display: flex; align-items: center; gap: 15px; }
.btn-circle { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: white; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.quota-warning { background: #fff7ed; border: 1px solid #ffedd5; color: var(--warning); padding: 15px; border-radius: var(--radius); font-size: 13px; margin-bottom: 20px; }
.quota-good { background: #f0fdf4; border: 1px solid #dcfce7; color: var(--success); padding: 15px; border-radius: var(--radius); font-size: 13px; margin-bottom: 20px; }

/* GENERAL UI BASES ELEMENTS */
.card { background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.card h2 { font-size: 16px; margin-bottom: 18px; font-weight: 700; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--gray); margin-bottom: 6px; text-transform: uppercase; }
.form-control { width: 100%; padding: 10px 14px; font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius); outline: none; background: white; }
.form-control:focus { border-color: var(--primary); }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; font-size: 14px; font-weight: 600; border-radius: var(--radius); border: none; cursor: pointer; transition: background 0.15s ease; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { filter: brightness(90%); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(90%); }
.btn-gray { background: #e2e8f0; color: var(--dark); }
.btn-gray:hover { background: #cbd5e1; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.table th { background: var(--light); padding: 14px 16px; color: var(--gray); border-bottom: 1px solid var(--border); font-weight: 600; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }

.badge { display: inline-block; padding: 3px 8px; font-size: 11px; font-weight: 700; border-radius: 4px; text-transform: uppercase; }
.badge-consumer { background: #e0f2fe; color: var(--primary); }
.badge-reseller { background: #dcfce7; color: var(--success); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }