:root {
  --primary: #f26b21;
  --primary-hover: #e05e19;
  --navy: #1b1c28;
  --navy-active: #2b2c3a;
  --purple: #622f98;
  --bg-color: #f7f8fc;
  --text-main: #333;
  --text-muted: #888;
  --border-color: #eaedf2;
  --red: #eb5757;
  --green: #27ae60;
  --blue: #2d9cdb;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { background: var(--bg-color); color: var(--text-main); font-size: 13px; display: flex; height: 100vh; overflow: hidden; }

/* SIDEBAR */
.sidebar { width: 240px; background: var(--navy); display: flex; flex-direction: column; color: #fff; flex-shrink: 0; }
.sidebar-header { display: flex; align-items: center; gap: 12px; padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.logo-box { background: var(--primary); padding: 4px 6px; border-radius: 4px; font-weight: 800; font-size: 14px; letter-spacing: 1px; }
.sidebar-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.sidebar-subtitle { font-size: 11px; color: rgba(255,255,255,0.6); font-style: italic; }

.sidebar-section { padding: 16px 20px 8px; font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.5); text-transform: uppercase; }

.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: rgba(255,255,255,0.7); cursor: pointer; text-decoration: none; font-size: 13px; font-weight: 600; transition: all 0.2s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-item.active { background: var(--navy-active); color: var(--primary); border-left: 3px solid var(--primary); padding-left: 17px; }
.nav-item.active .nav-icon { color: var(--primary); }
.search-input-wrapper { position: relative; display: flex; align-items: center; }
.search-input { padding-right: 28px; width: 140px; }
.search-icon { position: absolute; right: 4px; color: #a0a5af; cursor: pointer; padding: 4px; border-radius: 4px; transition: all 0.2s; }
.search-icon:hover { color: var(--primary); background: #f0f0f0; }
.nav-icon { font-size: 16px; display: flex; align-items: center; justify-content: center; width: 24px; }
.nav-icon.img-icon { font-size: 10px; font-weight: bold; width: 20px; height: 20px; border-radius: 4px; color: #fff; }
.icon-ghn { background: #E53935; }
.icon-ci { background: linear-gradient(135deg,#3b82f6,#ef4444); }

.sidebar-footer { margin-top: auto; padding: 16px 20px; display: flex; align-items: center; gap: 12px; border-top: 1px solid rgba(255,255,255,0.05); }
.avatar { width: 32px; height: 32px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; }
.user-name { font-size: 12px; font-weight: 700; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.5); }

/* MAIN CONTENT */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* HEADER */
.header { height: 50px; background: #fff; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.tabs { display: flex; height: 100%; }
.tab { display: flex; align-items: center; gap: 8px; padding: 0 24px; color: var(--text-muted); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--text-main); }
.tab.active { color: var(--purple); border-bottom-color: var(--purple); }

.header-right { display: flex; align-items: center; gap: 16px; font-size: 12px; }
.time-text { color: var(--text-muted); }
.local-text { color: var(--red); font-style: italic; }
.btn-refresh { background: var(--purple); color: #fff; border: none; padding: 6px 16px; border-radius: 4px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px; }

/* CONTENT WRAPPER */
.content-wrapper { padding: 16px; overflow-y: auto; flex: 1; }
.box { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }

/* FILTERS */
.filters { display: flex; gap: 12px; margin-bottom: 16px; align-items: flex-end; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-label { font-size: 10px; font-weight: 700; color: var(--primary); text-transform: uppercase; }
.filter-input { border: 1px solid #dcdfe6; padding: 6px 12px; border-radius: 4px; font-size: 12px; color: var(--text-main); min-width: 140px; outline: none; }
.filter-input:focus { border-color: var(--primary); }

.filter-actions { display: flex; gap: 8px; margin-left: auto; }
.btn-outline { border: 1px solid var(--primary); background: #fff; color: var(--primary); padding: 4px 10px; border-radius: 6px; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; gap: 2px; min-width: 64px; }
.btn-outline.red { border-color: var(--red); color: var(--red); }
.btn-outline i { font-size: 16px; }

/* TABLE */
.table-responsive { overflow-x: auto; border: 1px solid var(--border-color); border-radius: 4px; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
thead { background: var(--primary); color: #fff; }
th { padding: 12px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; text-align: left; }
td { padding: 10px 14px; font-size: 12px; border-bottom: 1px solid #f5f6f8; }
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: #fafbfc; }
tr:hover td { background: #fff8f5; }

/* TABLE ELEMENTS */
.link { color: var(--purple); text-decoration: underline; font-weight: 600; cursor: pointer; }
.group-text { color: var(--blue); font-weight: 600; }
.text-red { color: var(--red); font-weight: 500; }
.text-green { color: var(--green); font-weight: 500; }
.text-grey { color: #a0a5b1; }

.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-hoigiao { background: #e8f5e9; color: #2e7d32; }
.badge-nhapkho, .badge-hoilay { background: #e3f2fd; color: #1565c0; }
.badge-luanchuyen { background: #fff3e0; color: #e65100; }
.badge-khieunai { background: #ffebee; color: #c62828; }

.actions { display: flex; gap: 4px; }
.btn-icon { width: 26px; height: 26px; border: 1px solid #dcdfe6; background: #fff; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #666; font-size: 14px; }
.btn-icon.orange { background: var(--primary); border-color: var(--primary); color: #fff; }

/* MODAL */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: #fff; width: 400px; border-radius: 8px; padding: 24px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 16px; font-weight: 700; color: var(--primary); text-transform: uppercase; }
.btn-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #888; display: flex; align-items: center; justify-content: center; }
.btn-close:hover { color: var(--red); }
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 11px; color: var(--text-muted); text-transform: uppercase; }
.form-control { width: 100%; border: 1px solid #dcdfe6; padding: 10px 12px; border-radius: 4px; font-size: 13px; outline: none; }
.form-control:focus { border-color: var(--primary); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.btn-primary { background: var(--primary); color: #fff; border: none; padding: 8px 16px; border-radius: 4px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #f1f3f5; color: #333; border: none; padding: 8px 16px; border-radius: 4px; font-weight: 600; cursor: pointer; }
.btn-secondary:hover { background: #e2e6ea; }
