/* Mr. Digital styles. Ported from the old style.css: every colour kept, duplicates/dead rules removed,
   numbers enlarged (ARCHITECTURE.md 7.1). */

/* ---------- base + header bar ---------- */
body { margin: 0; font-family: Arial, sans-serif; background: #fff; color: #222; }
.flex { display: flex; }
.app-header { display: flex; justify-content: space-between; align-items: center; padding: 6px 14px; background: #007ff1; color: #fff; }
.app-name { font-weight: bold; font-size: 18px; }
.app-user { display: flex; align-items: center; gap: 10px; }
.logout-form { margin: 0; }
.logout-btn { background: #f10000ed; color: #fff; border: 0; padding: 5px 12px; border-radius: 4px; cursor: pointer; font-weight: bold; }

/* ---------- login ---------- */
.login-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: #f4f6f9; }
.login-card { background: #fff; padding: 28px; width: 320px; max-width: 90vw; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.login-card h1 { margin: 0 0 16px; text-align: center; font-size: 24px; color: #007ff1; }
.login-card label { display: block; margin: 10px 0 4px; font-weight: bold; color: #222; }
.login-card input[type=text], .login-card input[type=password] { width: 100%; box-sizing: border-box; padding: 9px; border: 2px solid #FF9800; border-radius: 4px; }
.login-card button { width: 100%; margin-top: 16px; padding: 10px; background: #007ff1; color: #fff; border: 0; border-radius: 4px; font-size: 16px; cursor: pointer; }
.login-error { color: #dc3545; margin: 0 0 8px; text-align: center; }

/* ---------- page container ---------- */
.container-out { background: #fff; color: #000; padding: 20px 10px; width: 100%; box-sizing: border-box; }
.width-25 { width: 25%; }
.width-40 { width: 40%; }
.width-45 { width: 45%; }
.width-50 { width: 50%; }
.width-55 { width: 55%; }
.width-60 { width: 60%; }
.margin-left-10 { margin-left: 10px; }
.margin-left-35 { margin-left: 35px; }
.margin-right-10 { margin-right: 10px; }
.margin-bottom-10 { margin-bottom: 10px; }
.margin-top-bottom-10 { margin-top: 10px; margin-bottom: 10px; }

/* ---------- totals row + buttons ---------- */
.totals-row { display: flex; width: 100%; }
.titles h3 { font-size: 22px; margin: 8px 0; }
.titles .total-cell { display: flex; width: 30%; }
.titles .total-cell.grand { width: 40%; }
.titles .total-label { width: 40%; }
.titles .total-cell.grand .total-label { width: 45%; }
.titles .total-value { color: #007ff1; }
.right-container { display: flex; width: 40%; justify-content: flex-end; align-items: center; }
.button { width: 100px; }
button#delbtn, button#clrbtn { background: #f10000ed; padding: 7px 5px; border-radius: 5px; border: none; color: #fff; font-weight: 800; text-transform: uppercase; cursor: pointer; }
button#delbtn { margin-left: 7px; margin-right: 5px; }
button#syncbtn { background: #37a000; padding: 7px 5px; border-radius: 5px; border: none; color: #fff; font-weight: 800; text-transform: uppercase; cursor: pointer; }

/* ---------- entry form ---------- */
.entry-row { margin-top: 20px; }
.entry-row label { color: #222; font-weight: 800; }
.entry-row .form-control { height: 25px; box-sizing: border-box; }
input#number, input#amount, input#code { border: 1px solid #FF9800; }
.radio-pad > input { margin-right: 5px; margin-left: 5px; }
#amount.highlight-input { color: #ff0000 !important; font-weight: bold !important; border-color: #ff0000 !important; background-color: #fff3cd !important; }

/* ---------- lists ---------- */
.board-main { display: flex; margin-top: 10px; }
.total-container { width: 18%; height: 100%; text-align: center; }
.lists { display: flex; }
.akda-div { width: 50%; height: 720px; border: 1px solid black; overflow: auto; background-color: white; font-size: 17px; color: black; border-radius: 10px; }
.akda-div > div { cursor: pointer; font-size: 17px; width: 100%; }
.highlight { background-color: red; }
.highlight-amount { color: #ff0000 !important; font-weight: bold !important; background-color: #fff3cd; font-size: inherit; padding: 1px 3px; }

/* ---------- grid ---------- */
.table-container { display: flex; width: 82%; flex-wrap: nowrap; overflow-x: auto; position: relative; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.ten-width-div { flex: 1; min-width: 0; padding-right: 12px; text-align: center; }
.full-width { width: 100%; height: 30px; margin-bottom: 4px; display: flex; }
.width-30 { width: 35%; margin-right: 6px; font-weight: 800; font-size: 15px; }
.red-box { width: 65%; border: 1px solid #000; background-color: #fff; min-height: 26px; display: flex; align-items: center; justify-content: center; font-size: 16px; padding: 2px 0; box-sizing: border-box; }
.akda-back { width: 35%; background-color: #007ff1; color: #fff; font-weight: bold; border-radius: 4px; line-height: 27px; font-size: 16px; }
.ten-width-div:first-child .akda-back { background-color: #0056b3; }
.table-container::-webkit-scrollbar { height: 8px; }
.table-container::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.table-container::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; }
.table-container::-webkit-scrollbar-thumb:hover { background: #555; }

/* ---------- sync indicator + toasts ---------- */
.sync-indicator { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background-color: #28a745; }
.sync-indicator.synced { background-color: #28a745; }
.sync-indicator.syncing { background-color: #ffc107; animation: pulse 1s infinite; }
.sync-indicator.error { background-color: #dc3545; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: .5; } 100% { opacity: 1; } }
.sync-notification { position: fixed; top: 20px; right: 20px; padding: 15px 20px; color: #fff; border-radius: 5px; z-index: 9999; box-shadow: 0 4px 6px rgba(0,0,0,.1); font-weight: bold; max-width: 300px; animation: slideIn .3s ease-out; }
.sync-notification-success { background-color: #28a745; }
.sync-notification-error { background-color: #dc3545; }
.sync-notification-info { background-color: #007bff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- clear-password modal ---------- */
.modal-back { display: none; position: fixed; z-index: 99999; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.55); justify-content: center; align-items: center; }
.modal-box { background: #fff; border-radius: 10px; padding: 32px 28px 24px; width: 320px; max-width: 90vw; box-shadow: 0 8px 30px rgba(0,0,0,.25); position: relative; text-align: center; box-sizing: border-box; }
.modal-box .lock { font-size: 32px; margin-bottom: 8px; }
.modal-box h5 { margin: 0 0 6px; color: #222; font-size: 17px; font-weight: 700; }
.modal-box p { margin: 0 0 18px; color: #888; font-size: 13px; }
.modal-box input[type=password] { width: 100%; padding: 10px 14px; border: 1.5px solid #ccc; border-radius: 6px; font-size: 16px; box-sizing: border-box; outline: none; text-align: center; letter-spacing: 4px; }
.modal-error { color: #dc3545; font-size: 12px; margin-top: 8px; min-height: 18px; font-weight: 600; }
.modal-buttons { display: flex; gap: 10px; margin-top: 18px; }
.modal-buttons button { flex: 1; padding: 10px; border: none; border-radius: 6px; font-size: 14px; font-weight: 700; cursor: pointer; }
.modal-ok { background: #007ff1; color: #fff; }
.modal-ok:hover { background: #005fbb; }
.modal-cancel { background: #f0f0f0; color: #555; }
.modal-cancel:hover { background: #ddd; }

/* ---------- responsive (breakpoints kept: 1366, 1024, 768) ---------- */
@media screen and (max-width: 1366px) {
  .container-out { padding-left: 10px; padding-right: 10px; }
  .full-width { height: 26px; }
  .ten-width-div { padding-right: 5px; }
  .width-30 { width: 40%; margin-right: 4px; font-size: 15px; }
  .red-box { width: 60%; font-size: 15px; }
  .akda-back { width: 40%; font-size: 16px; line-height: 24px; }
  .table-container { width: 78%; margin-left: 7px; padding-right: 5px; }
  .total-container { width: 22%; min-width: 150px; }
  .akda-div { height: 570px; font-size: 17px; }
  .titles h3 { font-size: 22px; }
  .right-container { width: 35%; }
  button#syncbtn, button#delbtn, button#clrbtn { width: 80px; font-size: 12px; padding: 5px 3px; }
  .entry-row .form-control { font-size: 12px; }
}
@media screen and (max-width: 1024px) {
  .total-container { width: 25%; }
  .totals-row { flex-wrap: wrap; }
  .titles { width: 100%; }
  .right-container { width: 100%; justify-content: flex-start; margin-top: 10px; }
}
@media screen and (max-width: 768px) {
  .total-container { display: none; }
  .table-container { width: 100%; margin-left: 0; margin-top: 10px; }
  .entry-row .flex.width-50 { flex-wrap: wrap; width: 100%; }
  .entry-row .flex.width-50 > div { width: 100%; margin-bottom: 10px; }
  .width-30 { width: 40%; }
}

/* ---------- admin page ---------- */
.admin-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.admin-bar input[type=date] { padding: 4px 6px; border: 1px solid #FF9800; border-radius: 4px; }
.admin-btn { background: #007ff1; color: #fff; border: none; border-radius: 5px; padding: 6px 12px; font-weight: 700; cursor: pointer; }
.admin-btn.danger { background: #f10000ed; }
.admin-btn.small { padding: 3px 8px; font-size: 12px; }
.live-text { color: #666; font-size: 13px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; border-bottom: 2px solid #007ff1; padding-bottom: 6px; }
.admin-tab { background: #f0f0f0; color: #222; border: none; border-radius: 5px 5px 0 0; padding: 7px 14px; font-weight: 700; cursor: pointer; }
.admin-tab.active { background: #007ff1; color: #fff; }
.subtotals { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.subtotal { background: #f4f6f9; border: 1px solid #ccc; border-radius: 4px; padding: 4px 8px; font-size: 14px; color: #222; }
.entries-box { margin-top: 18px; }
.entries-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.entries-tools input[type=text] { padding: 5px 8px; border: 1px solid #FF9800; border-radius: 4px; }
.entries-scroll { max-height: 420px; overflow: auto; border: 1px solid #ccc; }
.entries-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.entries-table th { position: sticky; top: 0; background: #007ff1; color: #fff; text-align: left; padding: 6px 8px; }
.entries-table td { padding: 4px 8px; border-bottom: 1px solid #eee; }
.entries-table td.num { font-size: 17px; font-weight: bold; }
.entries-table td.actions { white-space: nowrap; }
.form-modal { text-align: left; }
.form-modal h5 { text-align: center; margin-bottom: 12px; }
.form-modal label { display: block; margin: 8px 0; font-weight: 700; color: #222; font-size: 13px; }
.form-modal label.check { font-weight: 400; }
.form-modal input[type=text], .form-modal input[type=password], .form-modal select { display: block; width: 100%; box-sizing: border-box; margin-top: 3px; padding: 7px; border: 1.5px solid #FF9800; border-radius: 5px; font-size: 15px; }
