/* ============================================================
   TnH Trainee Portal — styles
   Brand tokens mirror /assets/css/tokens.css
   ============================================================ */
:root {
    --brand-primary:   #d1320d;
    --brand-primary-d: #a82209;
    --brand-secondary: #005786;
    --brand-accent:    #f59e0b;

    --tnh-bg:          #f6f7f9;
    --tnh-surface:     #ffffff;
    --tnh-surface-2:   #fafbfd;
    --tnh-border:      #e6e8ec;
    --tnh-text:        #0f172a;
    --tnh-text-soft:   #475569;
    --tnh-muted:       #94a3b8;

    --tnh-success:     #117A3B;
    --tnh-warning:     #b45309;
    --tnh-danger:      #b91c1c;
    --tnh-info:        #005786;

    --tnh-radius-sm:   8px;
    --tnh-radius:      12px;
    --tnh-radius-lg:   16px;
    --tnh-shadow-sm:   0 1px 3px rgba(15,23,42,.05);
    --tnh-shadow:      0 4px 12px rgba(15,23,42,.06);
    --tnh-shadow-lg:   0 12px 32px rgba(15,23,42,.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    /* background: var(--tnh-bg); */
    background-color: var(--tnh-bg);

     background-image:
             radial-gradient(rgba(209,50,13,0.68) 0.7px, transparent 0.7px),
        radial-gradient(rgba(0,87,134,0.58) 0.7px, transparent 0.7px),
        radial-gradient(rgba(209,50,13,0.12) 0.5px, transparent 0.5px);

        /* radial-gradient(var(--brand-primary) 0.8px, transparent 0.8px),
        radial-gradient(var(--brand-secondary) 0.8px, transparent 0.8px); */

    background-position: 0 0, 8px 8px;
    background-size: 16px 16px;
    color: var(--tnh-text);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-secondary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --------- Top bar --------- */
.tnh-topbar {
    position: sticky; top: 0; z-index: 40;
    background: #fff;
    border-bottom: 1px solid var(--tnh-border);
    box-shadow: var(--tnh-shadow-sm);
}
.tnh-topbar-inner {
    max-width: 1280px; margin: 0 auto;
    padding: 10px 20px;
    display: flex; align-items: center; gap: 16px;
}
.tnh-brand {
    display: flex; align-items: center; gap: 10px;
    font-size: 15px; color: var(--tnh-text); text-decoration: none;
    font-weight: 500;
}
.tnh-brand:hover { text-decoration: none; }
.tnh-brand strong { color: var(--brand-primary); font-weight: 700; }
.tnh-brand-mark {
    width: 30px; height: 30px; border-radius: 8px;
    background: var(--brand-primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px; letter-spacing: .5px;
}

.tnh-nav {
    list-style: none; padding: 0; margin: 0 auto;
    display: flex; gap: 4px; flex: 1; justify-content: center;
}
.tnh-nav a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 8px;
    color: var(--tnh-text-soft); font-size: 14px; font-weight: 500;
}
.tnh-nav a:hover { background: var(--tnh-surface-2); color: var(--tnh-text); text-decoration: none; }
.tnh-nav a.active { background: rgba(209,50,13,.08); color: var(--brand-primary); }

.tnh-user { display: flex; align-items: center; gap: 8px; }
.tnh-user-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 100px;
    background: var(--tnh-surface-2); font-size: 13px; color: var(--tnh-text-soft);
}
.tnh-logout {
    width: 36px; height: 36px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--tnh-text-soft); background: var(--tnh-surface-2);
}
.tnh-logout:hover { background: #fde2dc; color: var(--brand-primary); text-decoration: none; }

.tnh-bell-wrap { position: relative; }
.tnh-bell {
    position: relative;
    width: 36px; height: 36px; border-radius: 8px; border: 0;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--tnh-text-soft); background: var(--tnh-surface-2);
    font-size: 17px; cursor: pointer;
}
.tnh-bell:hover { background: #fde2dc; color: var(--brand-primary); }
.tnh-bell-badge {
    position: absolute; top: -4px; right: -4px;
    background: var(--brand-primary); color: #fff;
    font-size: 10px; font-weight: 600; line-height: 1;
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
}
.tnh-bell-menu { padding: 0; }
.tnh-bell-item { color: inherit; }
.tnh-bell-item:hover { background: var(--tnh-surface-2); }
.tnh-bell-item.unread { background: #fff6f3; }
.tnh-bell-item.unread strong { color: var(--brand-primary); }

.tnh-nav-toggle {
    border: 0; background: transparent; font-size: 22px;
    padding: 4px 10px; color: var(--tnh-text); display: none;
}
@media (max-width: 992px) {
    .tnh-nav-toggle { display: inline-flex; }
    .tnh-nav {
        position: absolute; top: 56px; left: 0; right: 0;
        background: #fff; border-bottom: 1px solid var(--tnh-border);
        flex-direction: column; padding: 10px; gap: 2px;
        display: none;
    }
    body.tnh-nav-open .tnh-nav { display: flex; }
}

/* --------- Shell --------- */
.tnh-shell {
    max-width: 1280px; margin: 0 auto;
    padding: 28px 20px 60px;
    min-height: calc(100vh - 120px);
}

.tnh-page-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    margin-bottom: 22px;
}
.tnh-page-head h1 {
    margin: 0; font-size: 22px; font-weight: 700; color: var(--tnh-text);
}
.tnh-page-head .lede { color: var(--tnh-text-soft); font-size: 14px; margin: 4px 0 0; }

/* --------- Cards --------- */
.tnh-card {
    background: var(--tnh-surface);
    border: 1px solid var(--tnh-border);
    border-radius: var(--tnh-radius);
    padding: 22px;
    box-shadow: var(--tnh-shadow-sm);
}
.tnh-card-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
    margin: -6px 0 18px;
}
.tnh-card-header h3 { margin: 0; font-size: 16px; font-weight: 700; }

.tnh-stat {
    background: var(--tnh-surface); border: 1px solid var(--tnh-border);
    border-radius: var(--tnh-radius); padding: 18px;
    box-shadow: var(--tnh-shadow-sm);
}
.tnh-stat .label { font-size: 12px; color: var(--tnh-muted); text-transform: uppercase; letter-spacing: .6px; }
.tnh-stat .value { font-size: 26px; font-weight: 700; color: var(--tnh-text); margin-top: 4px; }
.tnh-stat .delta { font-size: 12px; color: var(--tnh-text-soft); margin-top: 2px; }

/* --------- Badges --------- */
.tnh-badge {
    display: inline-block; padding: 2px 10px;
    border-radius: 6px; font-size: 11px; font-weight: 700;
    letter-spacing: .3px; text-align: center;
}
.tnh-badge-success { background: var(--tnh-success); color: #fff; }
.tnh-badge-warning { background: #FFC107; color: #1a1a1a; }
.tnh-badge-danger  { background: var(--tnh-danger);  color: #fff; }
.tnh-badge-info    { background: var(--tnh-info);    color: #fff; }
.tnh-badge-muted   { background: #e2e8f0; color: #475569; }

/* --------- Forms --------- */
.tnh-form-label { font-size: 13px; color: var(--tnh-text-soft); font-weight: 600; margin-bottom: 4px; display: block; }
.tnh-form-control, .form-control, .form-select {
    border-radius: var(--tnh-radius-sm) !important;
    border: 1px solid var(--tnh-border) !important;
    font-size: 14px !important;
}
.tnh-form-control:focus, .form-control:focus, .form-select:focus {
    border-color: var(--brand-secondary) !important;
    box-shadow: 0 0 0 3px rgba(0,87,134,.1) !important;
}

/* --------- Buttons --------- */
.btn { border-radius: var(--tnh-radius-sm); font-weight: 600; font-size: 14px; }
.btn-tnh-primary {
    background: var(--brand-primary); color: #fff; border: 1px solid var(--brand-primary);
}
.btn-tnh-primary:hover { background: var(--brand-primary-d); color: #fff; border-color: var(--brand-primary-d); }
.btn-tnh-secondary {
    background: #fff; color: var(--tnh-text); border: 1px solid var(--tnh-border);
}
.btn-tnh-secondary:hover { background: var(--tnh-surface-2); }

/* --------- Auth pages (shared shell for login/invite/reset) --------- */
.tnh-auth-shell {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 32px 20px; background: linear-gradient(135deg,#fafbfd 0%,#eef2f7 100%);
      /* background-color: #f6f7f9; */
    background-image:
        radial-gradient(var(--brand-primary) 0.8px, transparent 0.8px),
        radial-gradient(var(--brand-secondary) 0.8px, transparent 0.8px);

    background-position: 0 0, 8px 8px;
    background-size: 16px 16px;
}
.tnh-auth-card {
    width: 100%; max-width: 440px;
    background: var(--tnh-surface); border: 1px solid var(--tnh-border);
    border-radius: var(--tnh-radius-lg);
    box-shadow: var(--tnh-shadow-lg);
    padding: 36px 32px;
}
.tnh-auth-card h1 { font-size: 22px; font-weight: 700; margin: 0 0 6px; color: var(--tnh-text); text-align: center; }
.tnh-auth-card p.sub { font-size: 14px; color: var(--tnh-text-soft); margin: 0 0 26px; text-align: center; }
.tnh-auth-logo {
    width: 54px; height: 54px; border-radius: 14px;
    background: var(--brand-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 22px; letter-spacing: .5px;
    margin: 0 auto 16px;
}
.tnh-auth-alert {
    background: #fde2dc; color: var(--tnh-danger);
    padding: 10px 14px; border-radius: var(--tnh-radius-sm);
    font-size: 13px; margin-bottom: 14px; display: none;
}
.tnh-auth-alert.success { background: #dcfce7; color: #166534; }
.tnh-auth-alert.show { display: block; }

/* --------- DataTables tweaks --------- */
div.dataTables_wrapper div.dataTables_length select,
div.dataTables_wrapper div.dataTables_filter input {
    border-radius: var(--tnh-radius-sm); border: 1px solid var(--tnh-border); padding: 4px 10px;
}
table.dataTable thead th {
    background: var(--tnh-surface-2); color: var(--tnh-text-soft);
    font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
    border-bottom: 2px solid var(--tnh-border);
}
table.dataTable tbody td { font-size: 14px; vertical-align: middle; }

/* --------- Toasts --------- */
.tnh-toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 100;
    background: var(--tnh-text); color: #fff; padding: 12px 18px;
    border-radius: var(--tnh-radius-sm); font-size: 13px;
    box-shadow: var(--tnh-shadow-lg); opacity: 0; transform: translateY(10px);
    transition: all .2s ease; pointer-events: none; max-width: 360px;
}
.tnh-toast.show { opacity: 1; transform: translateY(0); }
.tnh-toast.success { background: var(--tnh-success); }
.tnh-toast.error   { background: var(--tnh-danger);  }

/* --------- Footer --------- */
.tnh-footer {
    border-top: 1px solid var(--tnh-border);
    background: #fff; padding: 14px 0;
    font-size: 12px; color: var(--tnh-muted);
}
.tnh-footer-inner {
    max-width: 1280px; margin: 0 auto; padding: 0 20px;
    display: flex; justify-content: space-between; align-items: center;
}

/* --------- Empty state --------- */
.tnh-empty {
    text-align: center; padding: 42px 20px;
    color: var(--tnh-muted);
}
.tnh-empty i { font-size: 36px; color: var(--tnh-border); display: block; margin-bottom: 10px; }

/* --------- Search input with icon (DataTable filter) --------- */
.tnh-search-icon {
    position: absolute; height: 35px; z-index: 10;
    margin-top: 1px; padding: 6px 10px; color: var(--tnh-muted);
    background: transparent; border: 0;
}
