.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; font-size: .84rem; line-height: 1.2; transition: background .15s ease, border-color .15s ease, transform .1s ease; }
.button:hover { text-decoration: none; }
.button:active { transform: translateY(1px); }
.button .icon { width: 17px; height: 17px; }
.button-primary { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: 0 4px 10px rgba(245, 107, 42, .18); }
.button-primary:hover { color: #fff; background: var(--accent-dark); border-color: var(--accent-dark); }
.button-secondary { color: var(--primary); background: var(--surface); border-color: var(--border-strong); }
.button-secondary:hover { background: var(--surface-alt); border-color: #aebac4; }
.button-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.button-danger:hover { color: #fff; background: var(--danger-dark); border-color: var(--danger-dark); }
.button-ghost { color: var(--primary); background: transparent; border-color: transparent; }
.button-ghost:hover { background: var(--surface-alt); }
.button-small { min-height: 36px; padding: 7px 11px; font-size: .78rem; }
.button-large { min-height: 48px; padding: 12px 22px; }
.button-block { width: 100%; }
.icon-button { display: inline-grid; width: 40px; height: 40px; place-items: center; padding: 0; color: var(--primary); background: transparent; border: 0; border-radius: 8px; }
.icon-button:hover { background: var(--surface-alt); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-heading h2 { margin-bottom: 3px; }
.panel-heading p { font-size: .84rem; }
.panel-heading > a { flex: 0 0 auto; font-size: .8rem; font-weight: 700; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-heading p { max-width: 690px; }
.page-heading .button { flex: 0 0 auto; }
.compact-heading { margin-bottom: 20px; }
.eyebrow { display: block; margin-bottom: 6px; color: var(--accent-dark); font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 15px; color: var(--muted); font-size: .77rem; }
.breadcrumbs a { color: var(--muted); }

.field { min-width: 0; }
.field label, fieldset legend { display: flex; gap: 5px; margin-bottom: 7px; color: var(--primary-deep); font-size: .79rem; font-weight: 750; }
.field label span { color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea, .select-label select { width: 100%; min-height: 42px; padding: 9px 11px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 7px; outline: 0; transition: border-color .15s ease, box-shadow .15s ease; }
.field input:hover, .field select:hover, .select-label select:hover { border-color: #9fadb8; }
.field input:focus, .field select:focus, .select-label select:focus { border-color: var(--accent); box-shadow: var(--focus); }
.field input:disabled { color: var(--muted); background: #f2f4f5; }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: .72rem; line-height: 1.4; }
.input-action { position: relative; }
.input-action input { padding-right: 45px; }
.input-action button { position: absolute; top: 1px; right: 1px; display: grid; width: 40px; height: 40px; place-items: center; color: var(--muted); background: transparent; border: 0; border-radius: 6px; }
.input-action button:hover { color: var(--primary); background: var(--surface-alt); }
.input-action .icon { width: 17px; height: 17px; }
.checkbox { display: flex; align-items: flex-start; gap: 9px; color: var(--text); font-size: .8rem; cursor: pointer; }
.checkbox input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); }
.checkbox strong, .checkbox small { display: block; }
.checkbox small { margin-top: 2px; color: var(--muted); }
.form-grid { display: grid; gap: 17px; }
.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-panel { padding: clamp(20px, 3vw, 28px); }
.form-panel > * + * { margin-top: 19px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 20px; border-top: 1px solid var(--border); }
.form-status { min-height: 0; color: var(--muted); font-size: .8rem; }
.form-status:not(:empty) { padding: 10px 12px; background: var(--surface-alt); border-radius: 7px; }
.form-status.error { color: var(--danger); background: var(--danger-soft); }
.form-status.success { color: var(--success); background: var(--success-soft); }
.field-error { color: var(--danger); border-color: var(--danger) !important; }

.alert { padding: 12px 14px; color: var(--text); background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px; font-size: .81rem; }
.alert-error { color: #772121; background: var(--danger-soft); border-color: #efc4c4; }
.alert-warning { color: #65440d; background: var(--warning-soft); border-color: #ead59f; }
.alert-success { color: #1b5837; background: var(--success-soft); border-color: #b9dec8; }
.alert ul { margin: 7px 0 0; padding-left: 20px; }
.notice { display: flex; gap: 12px; padding: 14px; background: var(--info-soft); border: 1px solid #c6ddeb; border-radius: 9px; }
.notice > span { color: var(--info); }
.notice .icon { width: 21px; }
.notice strong { display: block; margin-bottom: 2px; color: var(--primary); font-size: .82rem; }
.notice p { font-size: .76rem; }
.notice-success { background: var(--success-soft); border-color: #b9dec8; }
.notice-success > span { color: var(--success); }
.notice-warning { background: var(--warning-soft); border-color: #ead59f; }
.notice-warning > span { color: var(--warning); }

.badge { display: inline-flex; min-height: 24px; align-items: center; justify-content: center; padding: 3px 8px; border-radius: 999px; font-size: .68rem; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.badge-success { color: var(--success); background: var(--success-soft); }
.badge-warning { color: var(--warning); background: var(--warning-soft); }
.badge-danger { color: var(--danger); background: var(--danger-soft); }
.badge-neutral { color: #536473; background: #edf1f3; }
.progress { display: block; width: 100%; height: 7px; overflow: hidden; appearance: none; background: #e8ecef; border: 0; border-radius: 999px; }
.progress.large { height: 10px; }
.progress::-webkit-progress-bar { background: #e8ecef; border-radius: 999px; }
.progress::-webkit-progress-value { background: var(--success); border-radius: 999px; }
.progress::-moz-progress-bar { background: var(--success); border-radius: 999px; }
.progress[data-level="warning"]::-webkit-progress-value { background: #d69b2d; }
.progress[data-level="warning"]::-moz-progress-bar { background: #d69b2d; }
.progress[data-level="high"]::-webkit-progress-value { background: #d6782d; }
.progress[data-level="high"]::-moz-progress-bar { background: #d6782d; }
.progress[data-level="critical"]::-webkit-progress-value { background: var(--danger); }
.progress[data-level="critical"]::-moz-progress-bar { background: var(--danger); }

.search-box { position: relative; display: flex; min-width: 260px; align-items: center; }
.search-box .icon { position: absolute; left: 11px; z-index: 1; width: 17px; color: var(--muted); pointer-events: none; }
.search-box input { width: 100%; min-height: 40px; padding: 8px 11px 8px 38px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 7px; outline: 0; }
.search-box input:focus { border-color: var(--accent); box-shadow: var(--focus); }
.select-label { color: var(--muted); font-size: .72rem; }
.select-label span { display: none; }
.select-label select { min-width: 145px; }

.responsive-table { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 13px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { color: #647481; background: #fafbfb; font-size: .68rem; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; white-space: nowrap; }
td { font-size: .79rem; }
tbody tr:hover { background: #fcfdfd; }
tbody tr:last-child td { border-bottom: 0; }
td small, time small { display: block; color: var(--muted); font-size: .68rem; }
.sort-button { display: inline-flex; align-items: center; gap: 5px; padding: 0; color: inherit; background: none; border: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.sort-button span { color: #9ba8b1; }
code { padding: 2px 5px; color: #455866; background: #f0f3f4; border-radius: 4px; font: .72rem Consolas, monospace; }

.empty-state { display: grid; min-height: 230px; place-items: center; align-content: center; padding: 30px; text-align: center; }
.empty-state .icon { width: 35px; height: 35px; margin-bottom: 12px; color: #91a0aa; }
.empty-state p { max-width: 420px; font-size: .8rem; }
.empty-state.compact { min-height: 280px; }

.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; width: min(390px, calc(100vw - 30px)); gap: 10px; }
.toast { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; color: #fff; background: var(--primary); border-radius: 9px; box-shadow: var(--shadow-md); font-size: .8rem; animation: toast-in .2s ease-out; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { color: #4e350c; background: #f2ca6e; }
.toast button { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; padding: 0; color: inherit; background: transparent; border: 0; border-radius: 5px; }
.toast .icon { width: 15px; height: 15px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.modal { width: min(560px, calc(100vw - 28px)); max-height: calc(100vh - 32px); padding: 0; color: var(--text); background: var(--surface); border: 0; border-radius: 14px; box-shadow: 0 24px 80px rgba(20, 32, 42, .3); }
.modal::backdrop { background: rgba(20, 32, 42, .57); backdrop-filter: blur(2px); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 22px 23px 17px; border-bottom: 1px solid var(--border); }
.modal-header > div { display: flex; gap: 12px; }
.modal-header h2 { font-size: 1.06rem; }
.modal-header p { font-size: .79rem; }
.modal-icon { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 50%; }
.modal-icon.warning { color: var(--warning); background: var(--warning-soft); }
.modal-icon.success { color: var(--success); background: var(--success-soft); }
.modal-icon.danger { color: var(--danger); background: var(--danger-soft); }
.modal-icon .icon { width: 19px; }
.modal-body { overflow-y: auto; max-height: 60vh; padding: 20px 23px; }
.modal-body > * + * { margin-top: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 23px; background: var(--surface-alt); border-top: 1px solid var(--border); }
.confirm-target { padding: 12px 14px; background: var(--surface-alt); border-radius: 8px; }
.confirm-target span, .confirm-target strong { display: block; }
.confirm-target span { color: var(--muted); font-size: .7rem; }
.confirm-target strong { margin-top: 2px; color: var(--primary); font-size: .9rem; word-break: break-all; }
.confirm-target.danger { background: var(--danger-soft); }
.notice-text { font-size: .79rem; }

.password-meter { margin-top: 8px; }
.password-meter > span { display: block; height: 5px; overflow: hidden; background: #e8ecef; border-radius: 999px; }
.password-meter i { display: block; width: 0; height: 100%; background: var(--danger); border-radius: inherit; transition: width .2s ease, background .2s ease; }
.password-meter small { margin-top: 5px; }
.password-meter.strength-1 i { width: 20%; }
.password-meter.strength-2 i { width: 40%; background: #d67929; }
.password-meter.strength-3 i { width: 60%; background: #d09b28; }
.password-meter.strength-4 i { width: 80%; background: #4d9870; }
.password-meter.strength-5 i { width: 100%; background: var(--success); }
.password-tools { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 700px) {
    .page-heading { align-items: stretch; flex-direction: column; }
    .page-heading .button { align-self: flex-start; }
    .form-grid.two-columns { grid-template-columns: 1fr; }
    .panel-heading { gap: 10px; }
}

@media (max-width: 600px) {
    .responsive-table { overflow: visible; }
    .responsive-table table, .responsive-table thead, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; }
    .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .responsive-table tr { margin: 12px; padding: 4px 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow-sm); }
    .responsive-table tbody tr:hover { background: var(--surface); }
    .responsive-table td { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); text-align: right; }
    .responsive-table td::before { content: attr(data-label); flex: 0 0 38%; color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .03em; text-align: left; text-transform: uppercase; }
    .responsive-table td:last-child { border-bottom: 0; }
    .responsive-table td > * { min-width: 0; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .button { width: 100%; }
    .toast-region { right: 15px; bottom: 15px; }
}
