:root {
  --blue: #0078d7; --blue-dark: #106ebe;
  --red: #d70022; --green: #28a745; --gray: #6c757d;
  --bg: #f4f4f4; --border: #ddd;
}
* { box-sizing: border-box; }
body { font-family: Arial, sans-serif; background: var(--bg); margin: 0; padding: 0; }

/* Topbar */
.topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 10px 24px;
  display: flex; align-items: center; justify-content: space-between; box-shadow: 0 1px 4px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 50; }
.topbar-title { font-size: 18px; font-weight: bold; color: var(--blue); }
.topbar-user { display: flex; align-items: center; gap: 14px; }
.user-name { color: #333; font-weight: 600; }
.logout-btn { background: var(--gray); color: #fff; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; }
.logout-btn:hover { background: #5a6268; }

/* Tabs */
.tabs { background: #fff; display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab-btn { background: transparent; border: none; border-bottom: 3px solid transparent; padding: 12px 16px; cursor: pointer; font-size: 14px; color: #555; }
.tab-btn:hover { color: var(--blue); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: bold; }

/* Container / panels */
.container { max-width: 96%; margin: 20px auto; background: #fff; padding: 20px 24px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Filters */
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.search-box { width: 100%; max-width: 300px; padding: 10px 15px; border: 2px solid var(--border); border-radius: 25px; font-size: 14px; outline: none; transition: border-color .3s; }
.search-box:focus { border-color: var(--blue); box-shadow: 0 0 5px rgba(0,120,215,.3); }
.date-input-group { display: flex; align-items: center; gap: 5px; }
.date-input-group label { font-weight: bold; color: #333; font-size: 14px; }
.date-input, .select-input { padding: 8px 12px; border: 2px solid var(--border); border-radius: 4px; font-size: 14px; background: #fff; outline: none; }
.date-input:focus, .select-input:focus { border-color: var(--blue); box-shadow: 0 0 5px rgba(0,120,215,.3); }
.date-filter-btn { background: var(--blue); color: #fff; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.date-filter-btn:hover { background: var(--blue-dark); }
.clear-date-btn { background: var(--gray); color: #fff; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 14px; }
.clear-date-btn:hover { background: #5a6268; }

/* Buttons */
button { padding: 6px 12px; margin: 0 2px; border: none; border-radius: 4px; cursor: pointer; }
.new-btn { background: var(--green); color: #fff; } .new-btn:hover { background: #218838; }
.edit-btn { background: var(--blue); color: #fff; }
.delete-btn { background: var(--red); color: #fff; }
.approve-btn { background: var(--green); color: #fff; }
.reject-btn { background: var(--red); color: #fff; }
.test-btn { background: #17a2b8; color: #fff; }

.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 10px; }
.hint, .webhook-hint { color: #666; font-size: 13px; }
.webhook-hint code { background: #f0f0f0; padding: 2px 6px; border-radius: 3px; }

/* Badges */
.badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: bold; color: #fff; }
.badge.pending { background: #ffc107; color: #333; }
.badge.approved { background: var(--green); }
.badge.rejected { background: var(--red); }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: #fff; padding: 36px 40px; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,.15); width: 360px; }
.login-card h2 { text-align: center; color: var(--blue); margin-top: 0; }
.login-sub { text-align: center; color: #777; margin-bottom: 20px; font-size: 14px; }
.login-error { background: #fde8e8; color: var(--red); padding: 10px; border-radius: 4px; margin-bottom: 15px; font-size: 14px; }
.login-form label { display: block; margin-bottom: 14px; }
.login-form label span { display: block; font-weight: bold; color: #333; font-size: 13px; margin-bottom: 5px; }
.login-form input { width: 100%; padding: 10px; border: 2px solid var(--border); border-radius: 4px; font-size: 14px; outline: none; }
.login-form input:focus { border-color: var(--blue); }
.login-btn { width: 100%; background: var(--blue); color: #fff; border: none; padding: 12px; border-radius: 4px; cursor: pointer; font-size: 15px; font-weight: bold; }
.login-btn:hover { background: var(--blue-dark); }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal-card { background: #fff; border-radius: 8px; width: 560px; max-width: 92vw; max-height: 88vh; overflow: auto; box-shadow: 0 4px 24px rgba(0,0,0,.2); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; color: var(--blue); }
.modal-close { background: none; border: none; font-size: 26px; line-height: 1; color: #999; cursor: pointer; }
.modal-body { padding: 20px; }
.form-row { margin-bottom: 14px; }
.form-row > label { display: block; font-weight: bold; color: #333; font-size: 13px; margin-bottom: 5px; }
.form-row input, .form-row select, .form-row textarea { width: 100%; padding: 8px 10px; border: 2px solid var(--border); border-radius: 4px; font-size: 14px; font-family: inherit; }
.form-row textarea { min-height: 90px; }
.form-row .checks { display: flex; flex-wrap: wrap; gap: 10px; }
.form-row .checks label { font-weight: normal; display: flex; align-items: center; gap: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.toast { background: #333; color: #fff; padding: 12px 20px; border-radius: 4px; margin-bottom: 10px; opacity: 0; transform: translateX(100%); transition: all .3s ease; position: relative; min-width: 300px; }
.toast.show { opacity: 1; transform: translateX(0); }
.toast.success { background: var(--green); }
.toast.error { background: #dc3545; }
.toast.warning { background: #ffc107; color: #333; }
.toast.info { background: #17a2b8; }
.toast-close { position: absolute; top: 5px; right: 10px; background: none; border: none; color: inherit; font-size: 18px; cursor: pointer; padding: 0; line-height: 1; }

/* Tabulator */
.tabulator { font-size: 13px; }
.tabulator-header { background: #f0f0f0; }