/* OptimaPOS v0.2 - dark operational UI */

:root{
    --op-bg:#0b0c0e;
    --op-panel:#121418;
    --op-panel-2:#171a1f;
    --op-line:#2a2e35;
    --op-text:#f3f4f6;
    --op-muted:#8d949e;

    --op-free:#59606a;
    --op-occupied:#f2f4f7;
    --op-menu:#7aa2f7;
    --op-ready:#e4b45f;
    --op-bill:#d49045;
    --op-paid:#66c58a;
    --op-alert:#e06c75;
}

*{box-sizing:border-box}

html,body{
    margin:0;
    min-height:100%;
    background:var(--op-bg);
    color:var(--op-text);
    font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","Segoe UI",sans-serif;
}

body.pos-body{
    background:
        radial-gradient(circle at 50% -20%, rgba(255,255,255,.045), transparent 35%),
        var(--op-bg);
}

button,a{font:inherit}

.pos-topbar{
    min-height:68px;
    padding:10px 18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    border-bottom:1px solid var(--op-line);
    background:rgba(11,12,14,.92);
    backdrop-filter:blur(18px);
    position:sticky;
    top:0;
    z-index:30;
}

.pos-brand-block,
.pos-top-actions{
    display:flex;
    align-items:center;
}

.pos-brand-block{gap:11px}
.pos-top-actions{gap:10px}

.pos-logo{
    width:38px;
    height:38px;
    border-radius:11px;
    display:grid;
    place-items:center;
    background:#f3f4f6;
    color:#0b0c0e;
    font-weight:900;
    letter-spacing:-.5px;
}

.pos-brand{
    font-weight:800;
    letter-spacing:-.25px;
    line-height:1.1;
}

.pos-location{
    color:var(--op-muted);
    font-size:11px;
    margin-top:3px;
}

.pos-icon-btn{
    width:40px;
    height:40px;
    border:1px solid var(--op-line);
    background:var(--op-panel);
    color:var(--op-text);
    border-radius:12px;
    display:grid;
    place-items:center;
    text-decoration:none;
    cursor:pointer;
}

.pos-icon-btn i{font-size:19px}

.pos-user{
    text-align:right;
    line-height:1.1;
    padding:0 4px;
}

.pos-user span{
    display:block;
    font-size:13px;
    font-weight:700;
}

.pos-user small{
    display:block;
    color:var(--op-muted);
    margin-top:4px;
    text-transform:capitalize;
}

.pos-floor-shell{
    padding:18px;
}

.pos-floor-head{
    display:flex;
    align-items:end;
    justify-content:space-between;
    gap:16px;
    margin:2px 2px 16px;
}

.pos-kicker{
    color:var(--op-muted);
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:.11em;
    font-weight:700;
}

.pos-floor-head h1{
    margin:2px 0 0;
    font-size:30px;
    line-height:1;
    letter-spacing:-1px;
}

.pos-legend{
    display:flex;
    align-items:center;
    gap:7px;
    padding:5px;
    background:var(--op-panel);
    border:1px solid var(--op-line);
    border-radius:14px;
}

.pos-legend span{
    width:33px;
    height:33px;
    display:grid;
    place-items:center;
    border-radius:9px;
    color:var(--op-muted);
}

.pos-legend span:nth-child(1){color:var(--op-free)}
.pos-legend span:nth-child(2){color:var(--op-occupied)}
.pos-legend span:nth-child(3){color:var(--op-menu)}
.pos-legend span:nth-child(4){color:var(--op-ready)}
.pos-legend span:nth-child(5){color:var(--op-bill)}
.pos-legend span:nth-child(6){color:var(--op-paid)}

.operational-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(118px,1fr));
    gap:10px;
}

.op-table{
    position:relative;
    min-height:116px;
    border:1px solid var(--op-line);
    background:var(--op-panel);
    color:var(--op-text);
    border-radius:18px;
    padding:10px;
    cursor:pointer;
    text-align:left;
    overflow:hidden;
    transition:transform .08s ease,border-color .08s ease,background .08s ease;
}

.op-table:active{
    transform:scale(.985);
}

.op-table.round{border-radius:38px}
.op-table.rectangle{min-width:140px}

.op-table.free{
    color:var(--op-free);
    background:#101216;
}

.op-table.occupied{
    color:var(--op-occupied);
    border-color:#4a4f58;
}

.op-table.menu{
    color:var(--op-menu);
    border-color:rgba(122,162,247,.55);
}

.op-table.ready{
    color:var(--op-ready);
    border-color:rgba(228,180,95,.6);
}

.op-table.bill{
    color:var(--op-bill);
    border-color:rgba(212,144,69,.65);
}

.op-table.paid{
    color:var(--op-paid);
    border-color:rgba(102,197,138,.62);
}

.op-table-number{
    position:absolute;
    left:11px;
    top:8px;
    font-size:18px;
    line-height:1;
    font-weight:900;
    color:var(--op-text);
    letter-spacing:-.5px;
}

.op-table-center{
    height:76px;
    display:grid;
    place-items:center;
}

.op-state-icon{
    font-size:34px;
    line-height:1;
    color:currentColor;
}

.op-table.free .op-state-icon{
    opacity:.65;
    font-size:30px;
}

.op-table-corner{
    position:absolute;
    right:9px;
    top:8px;
    display:flex;
    align-items:center;
    gap:3px;
    font-size:11px;
    color:var(--op-muted);
}

.op-table-time{
    position:absolute;
    right:9px;
    bottom:8px;
    font-size:11px;
    font-weight:700;
    color:currentColor;
}

.op-table-user{
    position:absolute;
    left:10px;
    bottom:8px;
    max-width:70px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    color:var(--op-muted);
    font-size:10px;
}

/* Optional visual map */
.visual-floor{
    position:relative;
    min-width:1150px;
    min-height:680px;
    border:1px solid var(--op-line);
    border-radius:20px;
    background:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
        #0f1114;
    background-size:24px 24px;
    overflow:auto;
}

.visual-floor .op-table{
    position:absolute;
    min-height:0;
}

/* Login keeps the same dark product language */
.login-page{
    display:grid;
    place-items:center;
    min-height:100vh;
    background:var(--op-bg);
}

.login-shell{
    width:min(390px,92vw);
    text-align:center;
}

.login-mark{
    width:62px;
    height:62px;
    border-radius:18px;
    background:#f3f4f6;
    color:#0b0c0e;
    display:grid;
    place-items:center;
    margin:0 auto 18px;
    font-weight:900;
}

.login-title{
    font-size:32px;
    font-weight:800;
    letter-spacing:-1px;
}

.login-subtitle{
    color:var(--op-muted);
    margin-top:5px;
}

.pin-input{
    width:100%;
    margin:25px 0 18px;
    border:1px solid var(--op-line);
    background:var(--op-panel);
    color:var(--op-text);
    border-radius:16px;
    text-align:center;
    font-size:34px;
    letter-spacing:.3em;
    outline:0;
    padding:15px;
}

.keypad{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:9px;
}

.keypad button{
    min-height:66px;
    border:1px solid var(--op-line);
    border-radius:17px;
    background:var(--op-panel);
    color:var(--op-text);
    font-size:21px;
    cursor:pointer;
}

.keypad button:active{background:var(--op-panel-2)}
.keypad .enter-key{background:#f3f4f6;color:#0b0c0e}

.login-error{
    min-height:24px;
    color:var(--op-alert);
    margin-top:14px;
}

@media(max-width:700px){
    .pos-floor-shell{padding:11px}
    .pos-floor-head{align-items:start}
    .pos-floor-head h1{font-size:26px}
    .operational-grid{
        grid-template-columns:repeat(3,minmax(0,1fr));
        gap:7px;
    }
    .op-table{
        min-height:102px;
        padding:8px;
        border-radius:15px;
    }
    .op-state-icon{font-size:30px}
    .pos-user{display:none}
}

@media(max-width:470px){
    .operational-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}


/* ============================================================
   v0.3 — Hanging tags
   State/icons are attached to the table instead of occupying it.
   ============================================================ */

.operational-grid{
    grid-template-columns:repeat(auto-fill,minmax(104px,1fr));
    gap:14px 16px;
    padding-top:6px;
}

.op-table{
    min-height:104px;
    overflow:visible;
    padding:9px;
}

.op-table-core{
    height:84px;
    display:grid;
    place-items:center;
}

.op-table-plate{
    width:54px;
    height:38px;
    border:2px solid currentColor;
    border-radius:11px;
    opacity:.78;
}

.op-table.round .op-table-plate{
    width:46px;
    height:46px;
    border-radius:50%;
}

.op-table.rectangle .op-table-plate{
    width:70px;
}

.op-table.free .op-table-plate{
    opacity:.45;
}

.op-table-number{
    z-index:3;
}

.op-tag{
    position:absolute;
    min-height:26px;
    padding:4px 7px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:4px;
    border:1px solid var(--op-line);
    border-radius:9px;
    background:#171a1f;
    color:var(--op-text);
    font-size:10px;
    font-weight:700;
    line-height:1;
    box-shadow:0 4px 12px rgba(0,0,0,.24);
    z-index:5;
}

.op-tag i{
    font-size:15px;
}

.op-tag-state{
    right:-8px;
    top:22px;
    min-width:29px;
    color:currentColor;
}

.op-table.free .op-tag-state{
    color:var(--op-free);
}

.op-table.occupied .op-tag-state{
    color:var(--op-occupied);
}

.op-table.menu .op-tag-state{
    color:var(--op-menu);
}

.op-table.ready .op-tag-state{
    color:var(--op-ready);
}

.op-table.bill .op-tag-state{
    color:var(--op-bill);
}

.op-table.paid .op-tag-state{
    color:var(--op-paid);
}

.op-tag-guests{
    left:-8px;
    top:49px;
    color:#b8bec7;
}

.op-tag-time{
    right:-8px;
    bottom:10px;
    color:currentColor;
}

.op-tag-user{
    left:-8px;
    bottom:9px;
    color:#b8bec7;
    max-width:82px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.visual-floor .op-tag-state{
    right:-10px;
    top:23px;
}

.visual-floor .op-tag-guests{
    left:-10px;
    top:48px;
}

.visual-floor .op-tag-time{
    right:-10px;
    bottom:9px;
}

/* Remove old center-state remnants if present */
.op-table-center,
.op-table-corner,
.op-table-time,
.op-table-user{
    display:none !important;
}

@media(max-width:700px){
    .operational-grid{
        grid-template-columns:repeat(3,minmax(0,1fr));
        gap:13px;
    }

    .op-table{
        min-height:98px;
    }

    .op-tag{
        min-height:24px;
        padding:4px 6px;
    }
}


/* ============================================================
   v0.4 — Larger tables + larger hanging tags + true XY layout
   ============================================================ */


.operational-grid{
    grid-template-columns:repeat(auto-fill,minmax(165px,1fr));
    gap:20px 22px;
    padding:10px 4px 4px;
}

.op-table{
    min-height:150px;
    border-radius:24px;
    padding:14px;
}

.op-table.round{
    border-radius:46px;
}

.op-table.rectangle{
    min-width:190px;
}

.op-table-number{
    left:15px;
    top:12px;
    font-size:25px;
}

.op-table-core{
    height:112px;
}

.op-table-plate{
    width:82px;
    height:56px;
    border-width:3px;
    border-radius:15px;
}

.op-table.round .op-table-plate{
    width:72px;
    height:72px;
}

.op-table.rectangle .op-table-plate{
    width:104px;
}

.op-tag{
    min-height:38px;
    padding:7px 10px;
    border-radius:12px;
    font-size:13px;
    box-shadow:0 6px 16px rgba(0,0,0,.32);
}

.op-tag i{
    font-size:23px;
}

.op-tag-state{
    right:-14px;
    top:30px;
    min-width:42px;
}

.op-tag-guests{
    left:-14px;
    top:74px;
}

.op-tag-time{
    right:-14px;
    bottom:17px;
}

.op-tag-user{
    left:-14px;
    bottom:16px;
    max-width:112px;
}

.visual-floor{
    min-width:1500px;
    min-height:900px;
    background:
        linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px),
        #0f1114;
    background-size:28px 28px;
}

.visual-floor .op-table{
    min-height:100px;
    overflow:visible;
}

.visual-floor .op-table-number{
    font-size:24px;
}

.visual-floor .op-tag-state{
    right:-15px;
    top:26px;
}

.visual-floor .op-tag-guests{
    left:-15px;
    top:68px;
}

.visual-floor .op-tag-time{
    right:-15px;
    bottom:14px;
}

@media(max-width:900px){
    .operational-grid{
        grid-template-columns:repeat(3,minmax(140px,1fr));
        gap:18px;
    }
}

@media(max-width:600px){
    .operational-grid{
        grid-template-columns:repeat(2,minmax(135px,1fr));
    }
    .op-table{
        min-height:138px;
    }
}


/* ============================================================
   v0.5 patch — stronger contrast + true Admin XY floor
   ============================================================ */

:root{
    --op-bg:#050607;
    --op-panel:#101317;
    --op-panel-2:#171b21;
    --op-line:#3a414b;
    --op-text:#ffffff;
    --op-muted:#aab2bd;

    --op-free:#8f98a5;
    --op-occupied:#ffffff;
    --op-menu:#68a6ff;
    --op-ready:#ffd166;
    --op-bill:#ff9f43;
    --op-paid:#5ee29a;
    --op-alert:#ff626c;
}

.pos-body,
.login-page{
    background:#050607 !important;
}

.pos-topbar{
    background:rgba(5,6,7,.97);
    border-bottom-color:#2d333b;
}

.op-table{
    background:#0e1115;
    border-color:#39414b;
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,.015),
        0 8px 26px rgba(0,0,0,.32);
}

.op-table.free{
    background:#0b0d10;
    border-color:#424a55;
}

.op-table.occupied{
    border-color:#8c96a3;
}

.op-table.menu{
    border-color:#68a6ff;
    box-shadow:0 0 0 1px rgba(104,166,255,.18),0 8px 26px rgba(0,0,0,.34);
}

.op-table.ready{
    border-color:#ffd166;
    box-shadow:0 0 0 1px rgba(255,209,102,.18),0 8px 26px rgba(0,0,0,.34);
}

.op-table.bill{
    border-color:#ff9f43;
    box-shadow:0 0 0 1px rgba(255,159,67,.18),0 8px 26px rgba(0,0,0,.34);
}

.op-table.paid{
    border-color:#5ee29a;
    box-shadow:0 0 0 1px rgba(94,226,154,.18),0 8px 26px rgba(0,0,0,.34);
}

.op-table-number{
    color:#fff !important;
    text-shadow:0 1px 2px rgba(0,0,0,.5);
}

.op-tag{
    background:#171b21;
    border-color:#4a535f;
    color:#fff;
    box-shadow:0 8px 18px rgba(0,0,0,.42);
}

.op-tag-state{
    background:#11151a;
    border-width:2px;
}

.op-tag-state i{
    font-size:28px;
}

.op-tag-guests i,
.op-tag-time i,
.op-tag-user i{
    font-size:20px;
}

.op-tag-guests,
.op-tag-time,
.op-tag-user{
    min-height:40px;
}

.pos-legend{
    background:#111419;
    border-color:#3a414b;
}

.pos-legend span{
    width:40px;
    height:40px;
    background:#0c0f13;
    border:1px solid #303640;
}

.pos-legend span i{
    font-size:22px;
}

.visual-floor-wrap{
    display:grid;
    gap:18px;
}

.visual-area{
    background:#090b0e;
    border:1px solid #343b45;
    border-radius:22px;
    padding:14px;
}

.visual-area-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:0 2px 12px;
}

.visual-area-head span{
    font-size:16px;
    font-weight:800;
    color:#fff;
}

.visual-area-head small{
    color:#9da6b2;
}

.visual-floor{
    position:relative;
    min-width:1600px;
    min-height:1000px;
    border:1px solid #2f3640;
    border-radius:18px;
    background:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
        #0a0d10;
    background-size:32px 32px;
    overflow:auto;
}

.visual-floor .op-table{
    position:absolute;
    overflow:visible;
}

.visual-floor .op-table::after{
    content:"";
    position:absolute;
    inset:7px;
    border-radius:inherit;
    border:1px solid rgba(255,255,255,.05);
    pointer-events:none;
}


/* ============================================================
   v0.6 — definitive custom floor behaviour
   ============================================================ */

/*
 * In CUSTOM / visual mode the TABLE GEOMETRY is sacred:
 * left/top/width/height come directly from Admin and are rendered 1:1.
 * Only operational tags/icons are visually enlarged.
 */

.visual-floor{
    position:relative;
    width:1200px;
    height:700px;
    min-width:1200px;
    min-height:700px;
    overflow:hidden;
}

.visual-floor .op-table{
    position:absolute;
    min-height:0 !important;
    padding:8px;
    overflow:visible;
}

/* Do not let generic POS sizing alter custom floor geometry. */
.visual-floor .op-table.square,
.visual-floor .op-table.round,
.visual-floor .op-table.rectangle{
    min-width:0 !important;
}

/* The table number remains readable even on small custom tables. */
.visual-floor .op-table-number{
    left:8px;
    top:7px;
    font-size:18px;
}

/* Larger hanging state tag without changing the table itself. */
.visual-floor .op-tag{
    min-height:36px;
    padding:6px 9px;
    border-radius:11px;
    font-size:12px;
}

.visual-floor .op-tag i{
    font-size:24px;
}

.visual-floor .op-tag-state{
    right:-15px;
    top:18px;
    min-width:40px;
}

.visual-floor .op-tag-state i{
    font-size:29px;
}

.visual-floor .op-tag-guests{
    left:-14px;
    top:52px;
}

.visual-floor .op-tag-time{
    right:-14px;
    bottom:10px;
}

.visual-floor .op-tag-user{
    left:-14px;
    bottom:10px;
    max-width:105px;
}

/* High-contrast custom floor area */
.visual-area{
    background:#07090b;
    border-color:#424a55;
}

.visual-area-head span{
    color:#fff;
}

.visual-floor{
    border-color:#3e4651;
    background:
        linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px),
        #090b0e;
    background-size:24px 24px;
}
