/* ATOOK SPACE - Classic Orange POS Theme */
:root {
  --a-orange: #D9611B;
  --a-orange-dark: #B34E12;
  --a-orange-light: #F2954A;
  --a-cream: #FFF8F0;
  --a-brown: #3A2A1D;
  --a-ink: #2B2118;
  --a-line: #E8D9C8;
  --a-green: #3E8B4F;
  --a-red: #C0392B;
  --a-blue: #2E6FA7;
  --a-yellow: #E0A422;
  --a-card: #FFFFFF;
  --a-radius: 10px;
  --a-shadow: 0 2px 8px rgba(59,34,10,0.12);
  --a-font: 'Segoe UI', Roboto, -apple-system, Arial, sans-serif;
  --a-font-display: Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
#atook-space-root {
  font-family: var(--a-font);
  background: var(--a-cream);
  color: var(--a-ink);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

.atk-app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- LOGIN ---------- */
.atk-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--a-orange) 0%, var(--a-orange-dark) 55%, var(--a-brown) 100%);
  padding: 20px;
}
.atk-login-card {
  background: var(--a-card); border-radius: 16px; padding: 32px 28px; width: 100%; max-width: 380px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.28);
}
.atk-brand {
  text-align: center; margin-bottom: 22px;
}
.atk-brand .atk-logo {
  width: 56px; height: 56px; margin: 0 auto 8px; border-radius: 50%;
  background: var(--a-orange); color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--a-font-display); font-size: 26px; font-weight: bold; letter-spacing: 1px;
}
.atk-brand h1 {
  font-family: var(--a-font-display); font-size: 22px; letter-spacing: 2px; color: var(--a-brown); margin: 0;
}
.atk-brand p { color: #8a7a68; font-size: 12px; margin: 4px 0 0; letter-spacing: 1px; text-transform: uppercase; }

.atk-field { margin-bottom: 14px; }
.atk-field label { display: block; font-size: 13px; color: var(--a-brown); margin-bottom: 5px; font-weight: 600; }
.atk-field input, .atk-field select, .atk-field textarea {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--a-line); border-radius: 8px;
  font-size: 15px; font-family: var(--a-font); background: #fffdfb;
}
.atk-field input:focus, .atk-field select:focus, .atk-field textarea:focus { outline: none; border-color: var(--a-orange); }

.atk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--a-orange); color: #fff; border: none; border-radius: 8px;
  padding: 12px 18px; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}
.atk-btn:hover { background: var(--a-orange-dark); }
.atk-btn:active { transform: scale(0.98); }
.atk-btn.block { width: 100%; }
.atk-btn.green { background: var(--a-green); }
.atk-btn.green:hover { background: #2f6d3d; }
.atk-btn.red { background: var(--a-red); }
.atk-btn.red:hover { background: #9c3123; }
.atk-btn.blue { background: var(--a-blue); }
.atk-btn.gray { background: #8a7a68; }
.atk-btn.outline { background: transparent; color: var(--a-orange); border: 1.5px solid var(--a-orange); }
.atk-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.atk-btn.sm { padding: 7px 12px; font-size: 13px; }
.atk-btn.lg { padding: 15px 20px; font-size: 17px; }

.atk-error { background: #FDEDEA; color: var(--a-red); padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.atk-success { background: #EAF6EC; color: var(--a-green); padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }

/* ---------- LAYOUT / HEADER ---------- */
.atk-header {
  background: var(--a-brown); color: #fff; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  position: sticky; top: 0; z-index: 50; flex-wrap: wrap;
}
.atk-header .atk-h-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.atk-header .atk-h-left .atk-logo-sm {
  width: 34px; height: 34px; border-radius: 50%; background: var(--a-orange); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: var(--a-font-display); font-weight: bold; flex-shrink: 0;
}
.atk-header h2 { font-size: 15px; margin: 0; font-family: var(--a-font-display); letter-spacing: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atk-header .atk-h-role { font-size: 11px; color: var(--a-orange-light); text-transform: uppercase; letter-spacing: 1px; }
.atk-header .atk-h-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.atk-header .atk-user-name { font-size: 13px; opacity: 0.9; }

.atk-tabs {
  display: flex; gap: 4px; background: #fff; padding: 6px 10px; overflow-x: auto;
  border-bottom: 1px solid var(--a-line); position: sticky; top: 53px; z-index: 40;
  -webkit-overflow-scrolling: touch;
}
.atk-tabs::-webkit-scrollbar { height: 4px; }
.atk-tab {
  padding: 9px 14px; border-radius: 20px; background: transparent; border: 2px solid transparent; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--a-brown); white-space: nowrap; flex-shrink: 0;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.atk-tab.active { background: var(--a-orange); color: #fff; border-color: var(--a-orange-dark); box-shadow: 0 2px 6px rgba(217,97,27,0.35); }

.atk-main { flex: 1; padding: 16px; max-width: 1200px; margin: 0 auto; width: 100%; }

@media (max-width: 640px) {
  .atk-main { padding: 10px; }
  .atk-header { padding: 8px 10px; }
  .atk-header h2 { font-size: 13px; max-width: 130px; }
}

/* ---------- CARDS / GRID ---------- */
.atk-card {
  background: var(--a-card); border-radius: var(--a-radius); box-shadow: var(--a-shadow);
  padding: 16px; margin-bottom: 14px; border: 1px solid var(--a-line);
}
.atk-card h3 { margin: 0 0 12px; font-size: 16px; color: var(--a-brown); font-family: var(--a-font-display); }
.atk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.atk-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.atk-row .atk-field { flex: 1; min-width: 130px; margin-bottom: 0; }

table.atk-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.atk-table th, table.atk-table td {
  padding: 9px 8px; border-bottom: 1px solid var(--a-line); text-align: left; vertical-align: top;
}
table.atk-table th { background: #FBEFE2; color: var(--a-brown); font-weight: 700; white-space: nowrap; }
.atk-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.atk-badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.atk-badge.orange { background: #FBE3CC; color: var(--a-orange-dark); }
.atk-badge.green { background: #DEF3E1; color: var(--a-green); }
.atk-badge.red { background: #FADBD5; color: var(--a-red); }
.atk-badge.yellow { background: #FBEFC8; color: #8a6d10; }
.atk-badge.gray { background: #ECE6DE; color: #6b5c4a; }

/* ---------- MENU PICKER (Waiter/Kasir) ---------- */
.atk-menu-cat { margin-bottom: 6px; }
.atk-menu-cat h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--a-orange-dark); margin: 14px 0 8px; }
.atk-menu-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--a-line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
}
.atk-menu-item .name { font-weight: 600; font-size: 14px; word-break: break-word; }
.atk-menu-item .price { font-size: 12.5px; color: #8a7a68; }
.atk-qty-ctrl { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.atk-qty-ctrl button {
  width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--a-orange); background: #fff;
  color: var(--a-orange); font-size: 16px; font-weight: bold; cursor: pointer; line-height: 1;
}
.atk-qty-ctrl span { min-width: 20px; text-align: center; font-weight: 700; }

.atk-cart-panel {
  background: #fff; border-radius: var(--a-radius); box-shadow: var(--a-shadow); border: 1px solid var(--a-line);
  padding: 14px; position: sticky; top: 110px; max-height: calc(100vh - 130px); overflow-y: auto;
}
.atk-cart-item { border-bottom: 1px dashed var(--a-line); padding: 8px 0; font-size: 13.5px; }
.atk-cart-item .note-input { width: 100%; margin-top: 5px; padding: 6px 8px; font-size: 12.5px; border: 1px solid var(--a-line); border-radius: 6px; }
.atk-cart-total { font-size: 17px; font-weight: 800; color: var(--a-orange-dark); text-align: right; margin: 10px 0; }

.atk-order-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 900px) {
  .atk-order-layout { grid-template-columns: 1fr; }
  .atk-cart-panel { position: static; max-height: none; }
}

/* ---------- ORDER CARDS (Bar/Kitchen/Kasir) ---------- */
.atk-order-card {
  background: #fff; border-radius: var(--a-radius); box-shadow: var(--a-shadow); border: 1px solid var(--a-line);
  padding: 14px; margin-bottom: 14px; border-left: 5px solid var(--a-orange);
}
.atk-order-card.new { border-left-color: var(--a-red); animation: atk-pulse 1.4s ease-in-out 3; }
.atk-order-card.done { border-left-color: var(--a-green); opacity: 0.85; }
@keyframes atk-pulse { 0%,100% { box-shadow: var(--a-shadow); } 50% { box-shadow: 0 0 0 4px rgba(217,97,27,0.25); } }

.atk-order-card .oc-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.atk-order-card .oc-head .oc-table { font-size: 16px; font-weight: 800; color: var(--a-brown); }
.atk-order-card .oc-head .oc-waiter { font-size: 12px; color: #8a7a68; }
.atk-order-card .oc-item { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid #F3E9DC; font-size: 14px; word-break: break-word; }
.atk-order-card .oc-item:last-child { border-bottom: none; }
.atk-order-card .oc-item .qty { font-weight: 800; color: var(--a-orange); margin-right: 6px; }
.atk-order-card .oc-item .item-note { display: block; font-size: 12px; color: var(--a-red); font-style: italic; }
.atk-order-card .oc-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.atk-order-card .oc-addition-tag { background: var(--a-yellow); color: #5a4200; font-size: 10.5px; padding: 1px 7px; border-radius: 20px; font-weight: 700; margin-left: 6px; }

/* ---------- MODAL ---------- */
.atk-modal-bg {
  position: fixed; inset: 0; background: rgba(43,33,24,0.55); display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 16px;
}
.atk-modal {
  background: #fff; border-radius: 14px; padding: 22px; width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto;
}
.atk-modal h3 { margin-top: 0; font-family: var(--a-font-display); color: var(--a-brown); }

/* ---------- RECEIPT PRINT PREVIEW ---------- */
.atk-receipt { font-family: 'Courier New', monospace; font-size: 12.5px; width: 280px; margin: 0 auto; color: #000; }
.atk-receipt hr { border: none; border-top: 1px dashed #000; }
.atk-receipt .r-center { text-align: center; }
.atk-receipt .r-row { display: flex; justify-content: space-between; }

/* ---------- MISC ---------- */
.atk-empty { text-align: center; color: #9a8b78; padding: 30px 10px; font-size: 14px; }
.atk-toast-wrap { position: fixed; top: 14px; right: 14px; z-index: 500; display: flex; flex-direction: column; gap: 8px; max-width: 90vw; }
.atk-toast {
  background: var(--a-brown); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  font-size: 13.5px; max-width: 320px; animation: atk-toast-in .2s ease;
}
.atk-toast.success { background: var(--a-green); }
.atk-toast.error { background: var(--a-red); }
@keyframes atk-toast-in { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.atk-loading { text-align: center; padding: 60px 20px; color: #8a7a68; }
.atk-section-title { font-family: var(--a-font-display); color: var(--a-brown); font-size: 19px; margin: 4px 0 14px; }

.atk-pill-group { display: flex; gap: 6px; flex-wrap: wrap; }
.atk-pill { padding: 8px 14px; border-radius: 20px; border: 1.5px solid var(--a-line); background: #fff; cursor: pointer; font-size: 13px; font-weight: 600; }
.atk-pill.active { background: var(--a-orange); border-color: var(--a-orange); color: #fff; }

.atk-icon-btn { background: none; border: none; cursor: pointer; color: var(--a-red); font-size: 16px; }
.atk-flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
