/* public/css/main.css — 1+1 POS v2 */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #f97316;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text2: #475569;
  --text3: #94a3b8;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }

.app { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: #0f172a; color: #cbd5e1; position: fixed; top: 0; left: 0; bottom: 0; display: flex; flex-direction: column; z-index: 100; }
.sidebar-logo { padding: 18px 16px; font-weight: 800; font-size: 1.15rem; color: #fff; border-bottom: 1px solid #1e293b; }
.sidebar-logo span { color: var(--accent); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a { color: #cbd5e1; text-decoration: none; padding: 10px 12px; border-radius: 8px; font-size: .92rem; display: flex; gap: 10px; align-items: center; }
.sidebar-nav a:hover { background: #1e293b; color: #fff; }
.sidebar-nav a.active { background: var(--primary); color: #fff; }
.sidebar-footer { padding: 14px 16px; border-top: 1px solid #1e293b; font-size: .85rem; }
.sidebar-footer .user-name { color: #fff; font-weight: 600; }
.sidebar-footer .user-role { color: #94a3b8; font-size: .75rem; text-transform: capitalize; }
.sidebar-footer a { color: #f87171; text-decoration: none; font-size: .8rem; display: inline-block; margin-top: 8px; }

.main { margin-left: 230px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { height: 58px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; position: sticky; top: 0; z-index: 50; }
.topbar-title { font-weight: 700; font-size: 1.05rem; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.content { padding: 20px 22px; flex: 1; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat-label { font-size: .72rem; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.stat-value { font-size: 1.5rem; font-weight: 800; margin-top: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: none; cursor: pointer; font-size: .9rem; font-weight: 600; text-decoration: none; transition: .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-lg { padding: 13px 24px; font-size: 1.05rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: .78rem; font-weight: 700; color: var(--text2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .5px; }
.form-control { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: .92rem; background: #fff; color: var(--text); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; padding: 9px 12px; color: var(--text3); font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--border); }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
tr:hover td { background: #f8fafc; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .72rem; font-weight: 700; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.6); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 18px; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; padding: 22px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal-lg { max-width: 760px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-title { font-weight: 800; font-size: 1.1rem; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text3); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

#toast-container { position: fixed; bottom: 22px; right: 22px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 8px; font-size: .88rem; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text3); }
.empty-state-icon { font-size: 2.4rem; margin-bottom: 10px; }

.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 16px; }
.page-btn { min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--border); background: #fff; border-radius: 8px; cursor: pointer; font-size: .85rem; }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

.hidden { display: none !important; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.muted { color: var(--text3); }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .content { padding: 14px; }
}
