@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('variables.css');
@import url('layout.css');
@import url('components.css');
@import url('tables.css');
@import url('forms.css');

.user-accounts-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.user-accounts-search { display: flex; gap: 8px; margin: 0 20px 12px; max-width: 560px; }
.user-accounts-search .form-control { min-width: 0; flex: 1; }
.user-accounts-table th, .user-accounts-table td { padding: 8px 12px; }
.user-accounts-table td { white-space: nowrap; }
.account-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.account-actions form { display: inline-flex; margin: 0; }
.account-actions .btn { white-space: nowrap; }

/* Shared entity and detail patterns. */
.entity-link { color: var(--text-primary); font-weight: 600; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.entity-link:hover, .detail-list a:hover, .relationship-list a:hover { color: var(--link-color); text-decoration-color: currentColor; }
.detail-back { display: inline-block; margin-bottom: 8px; color: var(--text-secondary); font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.detail-section { margin-bottom: 18px; }
.detail-section .panel-head { margin-bottom: 4px; }
.detail-section > .panel-copy { margin-bottom: 16px; }
.detail-list { padding: 0; }
.detail-list > div { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--text-secondary); }
.detail-list dd { margin: 0; text-align: right; font-weight: 500; }
.relationship-list { list-style: none; margin: 0; padding: 0; }
.relationship-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); }
.relationship-list li:last-child { border-bottom: 0; }
.relationship-list span { color: var(--text-secondary); font-size: 13px; }
.detail-section .empty-state { padding: 24px; }
.detail-section .table td { padding-top: 12px; padding-bottom: 12px; }
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; gap: 0; } .detail-list > div { align-items: flex-start; } }

/* Quiet, consistent surface treatment across existing pages. */
.topbar { background: var(--bg-base); backdrop-filter: none; }
.panel, .stat-card, .dashboard-hero, .kpi-card, .reward-hub-panel, .reward-card-v2 { box-shadow: none; }
.stat-card::after, .dashboard-hero::before, .auth-card::before, .notice-modal-content::before { display: none; }
.dashboard-hero, .dashboard-ticker, .reward-card-v2.card-claimable, .notice-pill-trigger { background: var(--bg-panel); box-shadow: none; }
.dashboard-ticker::before, .dashboard-ticker::after { display: none; }
.hero-btn.btn-primary { background: var(--accent-primary); box-shadow: none; }
.reward-trophy-icon, .reward-progress-bar, .reward-progress-bar.bar-completed, .btn-claim-v2 { background: var(--accent-primary); box-shadow: none; animation: none; }
.reward-card-v2:hover, .kpi-card:hover { transform: none; box-shadow: none; }
.reward-credit-chip, .kpi-chip { color: var(--text-secondary); background: var(--bg-panel-hover); border-color: var(--border-subtle); }
.notice-modal-content { border-color: var(--border-strong); box-shadow: var(--shadow-soft); }
.table tbody tr:hover { background: var(--bg-panel-hover); }
.table th { text-transform: none; letter-spacing: 0; font-size: 12px; }
.kpi-icon-wrap, .reward-trophy-icon { background: var(--bg-panel-hover); color: var(--text-secondary); border-color: var(--border-subtle); }
.live-dot { box-shadow: none; }
.dashboard-ticker { padding: 12px 16px; border-color: var(--border-strong); }
.dashboard-ticker.is-scrolling .dashboard-ticker-track { animation: none; transform: none; justify-content: flex-start; width: 100%; }
.dashboard-ticker.is-scrolling .dashboard-ticker-copy { white-space: normal; padding: 0; }
.dashboard-ticker.is-scrolling .dashboard-ticker-copy-duplicate { display: none; }
.panel-head .topbar-actions, .page-intro .topbar-actions { flex-wrap: wrap; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }

/* TATA color and readable data surfaces. */
a { color: var(--link-color); }
a:hover { color: #d0e1ff; }
.nav-item.active { color: var(--text-primary); background: #1b2b40; }
.user-avatar, .brand-letter, .auth-logo { color: #fff; background: var(--accent-primary); }
.brand-letter { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: var(--radius-md); font-size: 19px; font-weight: 800; }
.auth-logo { display: grid; width: 48px; height: 48px; place-items: center; margin: 0 auto 16px; border-radius: var(--radius-md); font-size: 26px; font-weight: 800; }
.btn-primary, .hero-btn.btn-primary, .btn-claim-v2 { color: #fff; background: var(--accent-primary); }
.btn-primary:hover, .hero-btn.btn-primary:hover, .btn-claim-v2:hover { color: #fff; background: var(--accent-primary-hover); }
.btn-danger { color: #fff; background: #a63542; border-color: #a63542; }
.btn-danger:hover { color: #fff; background: #852936; border-color: #852936; }
.code-cell { color: var(--link-color); background: var(--bg-panel-hover); }
.notice-pill-trigger, .dashboard-ticker, .reward-card-v2.card-claimable { border-color: var(--border-strong); }
.reward-credit-chip { color: var(--text-primary); }
.panel, .table-container, .main-content, .content-area { min-width: 0; }
.directory-panel { overflow: visible; }
.directory-panel > .filter-bar, .directory-panel > .pagination { margin: 18px 20px; }
.directory-panel > .table-container { min-height: 0; }
.table-container { width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden; }
.table { min-width: 0; }
.responsive-records { min-width: 980px; }
.table td { overflow-wrap: normal; }
.table-actions.action-cluster form { display: inline-block; vertical-align: middle; }
.license-list { padding: 0; border: 0; background: transparent; }
.license-list .panel-head, .license-list .filter-bar, .license-list .bulk-toolbar { margin-left: 0; margin-right: 0; }
.license-table-region { width: 100%; overflow: visible; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--bg-panel); }
.license-table-region .table th, .license-table-region .table td { padding-left: 14px; padding-right: 14px; }
.grid-two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.pagination { gap: 14px; flex-wrap: wrap; }
.pagination-controls { align-items: center; flex-wrap: wrap; }
.page-size-form { display: inline-flex; align-items: center; gap: 8px; margin: 0 8px 0 0; white-space: nowrap; color: var(--text-secondary); font-size: 13px; }
.page-size-form .form-control { width: 72px; min-width: 72px; padding: 5px 8px; }
.bulk-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: var(--text-secondary); }
.bulk-toolbar .btn:disabled { opacity: .55; cursor: not-allowed; }
.select-column { width: 42px; text-align: center !important; }
.select-column input { width: 17px; height: 17px; accent-color: var(--accent-primary); }
.detail-heading-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-heading-actions form { margin: 0; }
@media (max-width: 900px) {
    .content-area { padding: 16px 12px !important; }
    .panel { padding: 16px; }
    .filter-bar { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; }
    .filter-bar > * { grid-column: 1 / -1 !important; min-width: 0 !important; width: 100% !important; }
    .filter-bar .filter-actions { flex-wrap: wrap; }
    .pagination-controls, .page-size-form { width: 100%; }
    .pagination-controls .btn { flex: 1; }
    .directory-panel > .filter-bar, .directory-panel > .pagination { margin: 16px; }
    .table { min-width: 0; }
}
@media (max-width: 1360px) {
    .responsive-table-container { overflow: visible; }
    .responsive-records, .responsive-records tbody { display: block; width: 100%; min-width: 0; }
    .responsive-records thead { display: none; }
    .responsive-records tbody { display: grid; gap: 12px; }
    .responsive-records tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-panel); }
    .responsive-records tbody td { display: block; min-width: 0; padding: 10px 12px; border: 0; text-align: left !important; }
    .responsive-records tbody td::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--text-muted); font-size: 11px; font-weight: 600; }
    .responsive-records tbody td.record-primary, .responsive-records tbody td.record-actions, .responsive-records tbody td.select-column { grid-column: 1 / -1; }
    .responsive-records tbody td.record-primary { border-bottom: 1px solid var(--border-subtle); }
    .responsive-records tbody td.record-actions { display: flex; justify-content: flex-start; flex-wrap: wrap; border-top: 1px solid var(--border-subtle); }
    .responsive-records tbody td.record-actions::before { flex-basis: 100%; }
    .responsive-records tbody td.select-column { width: 100%; padding-bottom: 0; }
    .responsive-records tbody tr.empty-row { display: block; }
    .responsive-records tbody tr.empty-row td { display: block; }
    .license-table-region { border: 0; background: transparent; }
}

/* When main-content is the auth wrapper, centre the login card */
.main-content.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 0;
    align-self: stretch;
}

.main-content.auth-main .content-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    padding: 24px;
    margin: 0 auto;
}

.main-content.auth-main .alert {
    width: 100%;
    max-width: 440px;
    margin-bottom: 16px;
}

.auth-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-strong);
    width: 100%;
    max-width: 440px;
    margin: auto;
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), #8b5cf6);
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-header img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.auth-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}
