/*
 * Application-specific styles. Colours/branding live in brand.css + theme.css;
 * keep this file for page-level tweaks so AdminLTE itself can be upgraded untouched.
 */

/* Grids */
.table > tbody > tr > td { vertical-align: middle; }
.action-column { white-space: nowrap; }
.filter-bar .form-group { margin-right: 8px; margin-bottom: 8px; }

/* Dashboard: stat cards (tone = --tone / --tone-bg) */
.stat-card {
    --tone: var(--dk-primary); --tone-bg: var(--dk-primary-50);
    display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding: 18px;
    background: var(--dk-surface); border: 1px solid var(--dk-line); border-radius: var(--dk-radius);
    box-shadow: var(--dk-shadow); color: var(--dk-ink); transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover, .stat-card:focus { color: var(--dk-ink); text-decoration: none; border-color: var(--tone); transform: translateY(-2px); box-shadow: var(--dk-shadow-lg); }
.stat-card.stat-success { --tone: var(--dk-success); --tone-bg: #dcfce7; }
.stat-card.stat-warning { --tone: var(--dk-warning-dark); --tone-bg: #fef3c7; }
.stat-card.stat-info { --tone: var(--dk-info); --tone-bg: #cffafe; }
.stat-card.stat-danger { --tone: var(--dk-danger); --tone-bg: #fee2e2; }
.stat-icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--tone-bg); color: var(--tone); font-size: 22px; }
.stat-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.stat-label { color: var(--dk-muted); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-go { color: var(--dk-line-strong); font-size: 20px; transition: color .15s ease; }
.stat-card:hover .stat-go { color: var(--tone); }

/* Dashboard: shortcut tiles */
.shortcut-row { margin-left: -6px; margin-right: -6px; }
.shortcut-row > [class*="col-"] { padding-left: 6px; padding-right: 6px; }
.shortcut-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start; height: 100%; min-height: 128px;
    margin-bottom: 12px; padding: 16px 8px; text-align: center;
    background: var(--dk-bg-soft); border: 1px solid var(--dk-line); border-radius: var(--dk-radius);
    color: var(--dk-ink); transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.shortcut-tile:hover, .shortcut-tile:focus { background: var(--dk-primary-50); border-color: var(--dk-primary-200); color: var(--dk-ink); text-decoration: none; transform: translateY(-2px); }
.shortcut-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: #fff; border: 1px solid var(--dk-line); color: var(--dk-primary); font-size: 22px; }
.shortcut-tile:hover .shortcut-icon { background: var(--dk-primary); border-color: var(--dk-primary); color: #fff; }
.shortcut-name { margin-top: 10px; font-weight: 700; font-size: 14px; }
.shortcut-desc { color: var(--dk-muted); font-size: 12px; line-height: 1.35; margin-top: 2px; }
.recent-table { margin-bottom: 0; }
.recent-table > thead > tr > th { color: var(--dk-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; border-bottom-width: 1px; }

@media (max-width: 767px) {
    .stat-row { margin-left: -5px; margin-right: -5px; }
    .stat-row > [class*="col-"] { padding-left: 5px; padding-right: 5px; }
    .stat-card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; margin-bottom: 10px; }
    .stat-icon { width: 38px; height: 38px; font-size: 17px; border-radius: 10px; }
    .stat-value { font-size: 22px; }
    .stat-go { display: none; }
    .shortcut-tile { min-height: 112px; padding: 12px 6px; }
    .recent-table td, .recent-table th { white-space: nowrap; }
}

/* Empty states */
.empty-state { padding: 48px 20px; text-align: center; color: var(--dk-muted); }
.empty-state .empty-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: var(--dk-primary-50); color: var(--dk-primary); font-size: 28px; margin-bottom: 14px; }
.empty-state h4 { color: var(--dk-ink); font-weight: 700; margin: 0 0 6px; }

/* Impersonation banner */
.impersonate-bar { background: var(--dk-warning-dark); color: #fff; padding: 8px 15px; font-weight: 600; }
.impersonate-bar form { display: inline; }
.impersonate-bar .btn { margin-left: 10px; }

/* Demo mode (demo.enabled = true) */
.demo-bar { background: var(--dk-primary, #2563eb); color: #fff; padding: 8px 15px; font-size: 13px; }
.demo-bar .fa { margin-right: 4px; }
.demo-accounts .demo-account { margin: 0 4px 4px 0; }

/* 2FA */
.qr-holder { display: inline-block; padding: 10px; background: #fff; border: 1px solid var(--dk-line); border-radius: var(--dk-radius-sm); }
.recovery-codes { columns: 2; font-family: var(--dk-mono); font-size: 15px; }
.secret-key { font-family: var(--dk-mono); letter-spacing: 2px; word-break: break-all; }

/* JSON diff in the audit log */
pre.json { max-height: 320px; overflow: auto; font-size: 12px; }
