:root{
  --navy: #16305c;
  --navy-active: #1e3f7a;
  --blue: #2f6fed;
  --blue-dark: #1b56d6;
  --green: #28a745;
  --orange: #fd7e14;
  --red: #dc3545;
  --purple: #6f42c1;
  --gold: #f0ad4e;
  --bg: #eef1f6;
  --card-radius: 6px;
}
*{box-sizing:border-box;}
body{
  margin:0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color:#333;
}
a{text-decoration:none;color:inherit;}

/* ---------- Layout ---------- */
.app{display:flex; min-height:100vh;}
.sidebar{
  width:230px;
  background: var(--navy);
  color:#cfd8ec;
  flex-shrink:0;
  min-height:100vh;
}
.sidebar .brand{
  display:flex;align-items:center;gap:10px;
  padding:18px 16px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.sidebar .brand .logo{
  width:34px;height:34px;border-radius:8px;
  background:linear-gradient(135deg,var(--blue),#7aa6ff);
  display:flex;align-items:center;justify-content:center;
  color:#fff;font-weight:700;
}
.sidebar .brand .title{font-weight:700;color:#fff;font-size:15px;line-height:1.1;}
.sidebar .brand .sub{font-size:10px;color:#9fb0d0;}
.sidebar .search{padding:10px 14px;}
.sidebar .search input{
  width:100%;padding:7px 10px;border-radius:4px;border:none;
  background:rgba(255,255,255,.08);color:#fff;font-size:13px;
}
.sidebar .search input::placeholder{color:#9fb0d0;}
.sidebar nav a{
  display:block;padding:11px 18px;font-size:14px;color:#cfd8ec;
  border-left:3px solid transparent;
}
.sidebar nav a:hover{background:rgba(255,255,255,.06);}
.sidebar nav a.active{background:var(--navy-active);border-left-color:var(--blue);color:#fff;font-weight:600;}
.sidebar nav .submenu a{padding-left:34px;font-size:13px;}
.sidebar .foot{padding:14px 18px;font-size:11px;color:#7f8fb3;}

.main{flex:1;min-width:0;}
.topbar{
  background: linear-gradient(90deg, var(--blue-dark), var(--blue));
  color:#fff;
  padding:12px 24px;
  display:flex;justify-content:space-between;align-items:center;
}
.topbar h1{font-size:19px;margin:0;font-weight:700;}
.topbar .crumb{font-size:12px;color:#dbe6ff;}
.topbar .crumb b{color:#fff;}
.topbar .right{display:flex;align-items:center;gap:12px;text-align:right;}
.topbar .hotel-name{font-weight:700;font-size:15px;}
.topbar .hotel-sub{font-size:11px;color:#dbe6ff;}
.avatar{
  width:34px;height:34px;border-radius:50%;background:#fff;color:var(--blue);
  display:flex;align-items:center;justify-content:center;font-weight:700;
}

.content{padding:20px;}

/* ---------- Cards ---------- */
.grid{display:grid;gap:16px;}
.grid-3{grid-template-columns:repeat(3,1fr);}
.grid-4{grid-template-columns:repeat(4,1fr);}
@media(max-width:1100px){.grid-3,.grid-4{grid-template-columns:repeat(2,1fr);}}
@media(max-width:650px){.grid-3,.grid-4{grid-template-columns:1fr;}}

.card{
  background:#fff;border-radius:var(--card-radius);
  box-shadow:0 1px 3px rgba(0,0,0,.08);
  padding:16px;
}
.card h3{margin:0 0 12px;font-size:14px;color:#444;display:flex;align-items:center;gap:6px;}

.stat{border-top:4px solid var(--blue);}
.stat.green{border-top-color:var(--green);}
.stat.red{border-top-color:var(--red);}
.stat.purple{border-top-color:var(--purple);}
.stat.gold{border-top-color:var(--gold);}
.stat .label{font-size:12px;font-weight:700;letter-spacing:.4px;color:#777;display:flex;justify-content:space-between;}
.stat .value{font-size:30px;font-weight:700;margin:10px 0 2px;color:#1a1a1a;}
.stat .delta{font-size:12px;color:#888;}
.stat .delta.down{color:#dc3545;}
.stat .delta.up{color:#28a745;}

/* ---------- Buttons ---------- */
.btn{
  display:inline-block;padding:8px 16px;border-radius:4px;border:1px solid #ccc;
  background:#f4f4f4;color:#333;font-size:13px;cursor:pointer;font-weight:600;
}
.btn-primary{background:var(--blue);border-color:var(--blue);color:#fff;}
.btn-green{background:var(--green);border-color:var(--green);color:#fff;}
.btn-gold{background:var(--gold);border-color:var(--gold);color:#fff;}
.btn-red{background:var(--red);border-color:var(--red);color:#fff;}
.btn-outline{background:#fff;}
.toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:14px;}
.toolbar input[type=text], .toolbar input[type=date], .toolbar select{
  padding:7px 10px;border:1px solid #ccc;border-radius:4px;font-size:13px;
}

/* ---------- Table ---------- */
table.data{width:100%;border-collapse:collapse;background:#fff;font-size:13.5px;}
table.data th{
  text-align:left;background:#f8f9fc;color:#555;padding:10px 12px;
  border-bottom:2px solid #e5e8f0;font-size:12.5px;text-transform:uppercase;letter-spacing:.3px;
}
table.data td{padding:9px 12px;border-bottom:1px solid #eef0f5;}
table.data tr:hover td{background:#f7f9ff;}
.badge{padding:3px 9px;border-radius:20px;font-size:11px;font-weight:700;}
.badge-open{background:#e6f4ea;color:#1e7e34;}
.badge-closed{background:#f5e6e6;color:#a12222;}
.badge-pending{background:#fdf1e0;color:#a3660b;}
.badge-advance{background:#eee6fa;color:#5b3a8e;}

/* ---------- Selectable rows (click to highlight, like Karibu's list screens) ---------- */
table.data tbody tr.row-selected td{background:#fff6d8;}

/* ---------- Print ---------- */
@media print{
  .sidebar, .topbar, .toolbar, .no-print{display:none !important;}
  .app{display:block;}
  .content{padding:0;}
  body{background:#fff;}
}

/* ---------- Room chart ---------- */
.legend{display:flex;gap:18px;font-size:13px;margin-bottom:14px;flex-wrap:wrap;}
.legend span{display:inline-flex;align-items:center;gap:6px;}
.dot{width:11px;height:11px;border-radius:50%;display:inline-block;}
.dot.vacant{background:#3cb46e;}
.dot.departure{background:#f0ad4e;}
.dot.inhouse{background:#e8892c;}
.dot.arriving{background:#3d84f5;}
.dot.blocked{background:#333;}

.roomgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:8px;}
.room-tile{
  border-radius:4px;padding:10px 8px;color:#fff;font-size:12px;min-height:56px;
  display:flex;flex-direction:column;justify-content:space-between;
}
.room-tile b{font-size:13px;}
.room-tile .type{font-size:10.5px;opacity:.9;}
.room-tile.vacant{background:#3cb46e;}
.room-tile.departure{background:#f0ad4e;color:#4a3200;}
.room-tile.occupied{background:#e8892c;}
.room-tile.blocked{background:#444;}

/* ---------- Login (POS numpad) ---------- */
.login-wrap{
  min-height:100vh;display:flex;align-items:center;justify-content:center;
  background: linear-gradient(135deg, #2f6fed, #16305c);
}
.login-card{
  background:#fff;border-radius:8px;padding:34px 36px;width:340px;
  box-shadow:0 10px 30px rgba(0,0,0,.25);text-align:center;
}
.login-card .logo{
  width:64px;height:64px;border-radius:12px;margin:0 auto 16px;
  background:linear-gradient(135deg,var(--blue),#16305c);
  display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;font-size:20px;
}
.login-card h2{margin:0 0 4px;font-size:20px;}
.login-card p{color:#888;font-size:13px;margin:0 0 20px;}
.login-card input{
  width:100%;padding:10px 12px;border:1px solid #ccc;border-radius:4px;margin-bottom:14px;font-size:14px;
}
.login-card .btn-primary{width:100%;padding:11px;font-size:14px;}
.login-error{background:#fdeaea;color:#a12222;padding:8px 10px;border-radius:4px;font-size:13px;margin-bottom:14px;}

/* Selling interface numpad look */
.numpad{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:14px 0;}
.numpad button{padding:16px;font-size:17px;border-radius:6px;border:1px solid #ddd;background:#f4f4f4;cursor:pointer;}
.numpad button.clear{background:#dc3545;color:#fff;border-color:#dc3545;}

/* ---------- Modals (New Table / New Item / New Personnel etc.) ---------- */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);display:flex;align-items:center;justify-content:center;z-index:1000;}
.modal-box{background:#fff;border-radius:8px;width:520px;max-width:92vw;max-height:88vh;overflow:auto;box-shadow:0 10px 40px rgba(0,0,0,.3);}
.modal-box.wide{width:680px;}
.modal-box .modal-head{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;border-bottom:1px solid #eee;}
.modal-box .modal-head h3{margin:0;font-size:16px;}
.modal-box .modal-head button.x{cursor:pointer;color:#999;font-size:18px;border:none;background:none;line-height:1;}
.modal-box .modal-body{padding:18px;}
.modal-box label{display:block;font-size:12.5px;color:#555;margin-bottom:4px;font-weight:600;}
.modal-box .field{margin-bottom:14px;}
.modal-box input[type=text], .modal-box input[type=number], .modal-box input[type=password], .modal-box select, .modal-box textarea{
  width:100%;padding:8px 10px;border:1px solid #ccc;border-radius:4px;font-size:13.5px;
}
.checklist{border:1px solid #ccc;border-radius:4px;max-height:170px;overflow:auto;padding:8px 10px;background:#fff;}
.checklist label{display:flex;align-items:center;gap:8px;font-weight:400;font-size:13px;color:#333;padding:4px 0;}
.info-tip{background:#fff;border:1px solid #ddd;border-radius:4px;padding:12px 14px;font-size:12.5px;color:#555;margin-top:8px;}

/* ---------- P.O.S Tabs (table grid) ---------- */
.table-tile{border-radius:6px;padding:14px 10px;text-align:center;cursor:pointer;border:2px solid;font-weight:700;position:relative;font-size:13px;}
.table-tile.available{background:#eafbf1;border-color:#3cb46e;color:#1e7e34;}
.table-tile.occupied{background:#fdeceb;border-color:#e0554b;color:#a12222;}
.table-tile .who{font-size:10.5px;font-weight:600;margin-top:3px;}
.tablegrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:12px;}

/* ---------- P.O.S PIN login ---------- */
.numpad-wrap{min-height:100vh;display:flex;gap:20px;flex-wrap:wrap;align-items:flex-start;justify-content:center;padding:40px 20px;background:linear-gradient(135deg,#2f6fed,#16305c);}
.numpad-card{background:#fff;border-radius:10px;overflow:hidden;width:340px;box-shadow:0 10px 30px rgba(0,0,0,.25);}
.numpad-card .nhead{background:linear-gradient(135deg,#2f6fed,#1b56d6);padding:26px;text-align:center;}
.numpad-card .nhead .logo-box{width:60px;height:60px;border-radius:10px;background:#16305c;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800;margin:0 auto;font-size:15px;}
.numpad-card .nbody{padding:20px 24px;}
.numgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:14px 0;}
.numgrid button{padding:14px;font-size:16px;border-radius:6px;border:1px solid #ddd;background:#f4f4f4;cursor:pointer;font-weight:600;}
.numgrid button.clear{background:#f16c6c;color:#fff;border-color:#f16c6c;}
.ready-orders{background:#fff;border-radius:10px;overflow:hidden;width:300px;box-shadow:0 10px 30px rgba(0,0,0,.25);max-height:500px;display:flex;flex-direction:column;}
.ready-orders .rhead{background:#28a745;color:#fff;padding:16px 18px;display:flex;justify-content:space-between;align-items:center;font-weight:700;}
.ready-orders .rhead .count{background:rgba(255,255,255,.25);border-radius:50%;width:22px;height:22px;display:flex;align-items:center;justify-content:center;font-size:12px;}
.ready-orders .rbody{padding:18px;font-size:13px;color:#888;overflow:auto;}
.ready-orders .rbody .order-row{text-align:left;color:#333;border-bottom:1px solid #eee;padding:8px 0;}

/* Products grid for selling interface */
.pos-layout{display:grid;grid-template-columns:2.2fr 1fr;gap:16px;}
.product-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px;}
.product-card{
  background:#fff;border-radius:6px;padding:14px 10px;text-align:center;cursor:pointer;
  box-shadow:0 1px 3px rgba(0,0,0,.08);font-size:13px;font-weight:600;
}
.product-card:hover{outline:2px solid var(--blue);}
.product-card .price{color:var(--blue);font-weight:700;margin-top:6px;font-size:13px;}
.cart-line{display:flex;justify-content:space-between;padding:8px 0;border-bottom:1px solid #eee;font-size:13.5px;}
.cart-total{display:flex;justify-content:space-between;font-weight:700;font-size:16px;padding-top:10px;}
