/* =====================================================================
   Nexus Orb PM — Design Tokens & Base Styles
   Brand palette (base colours — tints/shades of these are permitted
   for cases needing more than 5 distinguishable colours, e.g. the
   calendar's per-project colour coding):
     --nx-blue    #0C61B2   primary / links / focus
     --nx-orange  #FF7300   accent / high-priority / CTAs
     --nx-yellow  #FDE428   accent / medium-priority / highlights
     --nx-navy    #002446   structural (headers, sidebar, body text)
     --nx-skyblue #30C5FF   accent / low-priority / info
   ===================================================================== */

:root {
    --nx-blue: #0C61B2;
    --nx-orange: #FF7300;
    --nx-yellow: #FDE428;
    --nx-navy: #002446;
    --nx-skyblue: #30C5FF;

    --nx-white: #FFFFFF;
    --nx-bg: #F5F8FB;              /* neutral off-white derived from navy, not a new brand colour */
    --nx-border: #DCE4EC;
    --nx-text: var(--nx-navy);
    --nx-text-muted: #5A7086;

    --nx-radius: 8px;
    --nx-shadow: 0 1px 3px rgba(0, 36, 70, 0.08), 0 1px 2px rgba(0, 36, 70, 0.06);
    --nx-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--nx-font);
    background: var(--nx-bg);
    color: var(--nx-text);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--nx-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header / Top Nav ---------- */
.nx-header {
    background: var(--nx-navy);
    color: var(--nx-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 60px;
}

.nx-header .nx-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.nx-header .nx-logo img { height: 28px; }

.nx-header nav { display: flex; gap: 4px; }

.nx-header nav a {
    color: rgba(255,255,255,0.75);
    padding: 8px 14px;
    border-radius: var(--nx-radius);
    font-weight: 600;
    font-size: 14px;
}

.nx-header nav a:hover,
.nx-header nav a.active {
    color: var(--nx-white);
    background: rgba(255,255,255,0.10);
    text-decoration: none;
}

/* ---------- Home icon (replaces the "Dashboard" text link) ---------- */
.nx-header nav a.nx-home-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    color: var(--nx-white);
    background: linear-gradient(135deg, var(--nx-orange) 0%, #FFB23A 55%, var(--nx-yellow) 100%);
    box-shadow: 0 0 10px rgba(255,115,0,0.6), 0 0 18px rgba(253,228,40,0.35);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.nx-header nav a.nx-home-icon svg { display: block; }
.nx-header nav a.nx-home-icon:hover,
.nx-header nav a.nx-home-icon.active {
    color: var(--nx-white);
    background: linear-gradient(135deg, var(--nx-orange) 0%, #FFB23A 55%, var(--nx-yellow) 100%);
    box-shadow: 0 0 14px rgba(255,115,0,0.9), 0 0 26px rgba(253,228,40,0.6);
    transform: translateY(-1px);
}

/* ---------- Generic header dropdown (used by gear menu + user menu) ---------- */
/* Scoped specifically so it wins over the general ".nx-header nav a" rule
   above (which is white-on-transparent, meant for the navy header bar —
   wrong for these white dropdown panels). */
.nx-dropdown { position: relative; display: inline-block; }

.nx-dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: inherit;
    padding: 8px 14px;
    border-radius: var(--nx-radius);
    color: rgba(255,255,255,0.75);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}
.nx-dropdown-toggle:hover,
.nx-dropdown-toggle.active {
    color: var(--nx-white);
    background: rgba(255,255,255,0.10);
}
.nx-dropdown-toggle .nx-dropdown-caret {
    font-size: 10px;
    transition: transform 0.15s ease;
}
.nx-dropdown.open .nx-dropdown-caret { transform: rotate(180deg); }

.nx-dropdown-toggle--icon { font-size: 20px; padding: 6px 8px; line-height: 1; }

/* ---------- Header user avatar (profile picture beside name) ---------- */
.nx-user-toggle { padding: 5px 10px; }
.nx-header-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255,255,255,0.35);
    flex-shrink: 0;
}

.nx-dropdown-panel {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 180px;
    background: var(--nx-white);
    border-radius: var(--nx-radius);
    border-top: 3px solid var(--nx-skyblue);
    box-shadow: var(--nx-shadow), 0 6px 20px rgba(0,36,70,0.18);
    overflow: hidden;
    z-index: 50;
}
.nx-dropdown.open .nx-dropdown-panel { display: block; }

.nx-header nav .nx-dropdown-panel a,
.nx-header .nx-dropdown-panel a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--nx-navy);
    background: transparent;
    border-left: 3px solid transparent;
    border-radius: 0; /* override the pill-shaped radius from the general nav-link rule */
}
.nx-header nav .nx-dropdown-panel a:hover,
.nx-header .nx-dropdown-panel a:hover {
    color: var(--nx-navy);
    background: rgba(253,228,40,0.30); /* nx-yellow tint, matches .nx-badge-yellow */
}
.nx-header nav .nx-dropdown-panel a.active,
.nx-header .nx-dropdown-panel a.active {
    color: var(--nx-navy);
    background: rgba(12,97,178,0.10);  /* nx-blue tint, matches .nx-badge-blue family */
    border-left-color: var(--nx-orange);
}
.nx-header .nx-dropdown-panel form.nx-logout-form {
    margin: 0;
    padding: 0;
}
.nx-header .nx-dropdown-panel .nx-logout-link {
    all: unset;
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--nx-font);
    color: var(--nx-navy);
    cursor: pointer;
    box-sizing: border-box;
    border-radius: 0;
}
.nx-header .nx-dropdown-panel .nx-logout-link:hover {
    background: rgba(255,115,0,0.14); /* nx-orange tint, matches .nx-badge-orange, signals a destructive/exit action */
}

/* ---------- Layout ---------- */
.nx-container { max-width: 1180px; margin: 0 auto; padding: 28px 24px; }

.nx-page-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.nx-page-title h1 { font-size: 22px; margin: 0; }
.nx-page-title p.nx-subtitle { color: var(--nx-text-muted); margin: 4px 0 0; font-size: 14px; }

/* ---------- Buttons ---------- */
.nx-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--nx-radius);
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.nx-btn:hover { text-decoration: none; filter: brightness(0.93); }

.nx-btn-primary { background: var(--nx-blue); color: var(--nx-white); }
.nx-btn-accent  { background: var(--nx-orange); color: var(--nx-white); }
.nx-btn-outline { background: transparent; border-color: var(--nx-border); color: var(--nx-navy); }
.nx-btn-danger  { background: var(--nx-white); border-color: var(--nx-orange); color: var(--nx-orange); }
/* One-time explicit off-palette exception (account suspension/ban only — see CLAUDE.md) */
.nx-btn-suspend { background: var(--nx-white); border-color: #C62828; color: #C62828; }
.nx-btn-suspend:hover { background: #C62828; color: var(--nx-white); }

/* ---------- Card / Table ---------- */
.nx-card {
    background: var(--nx-white);
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius);
    box-shadow: var(--nx-shadow);
}

table.nx-table { width: 100%; border-collapse: collapse; }
table.nx-table th, table.nx-table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--nx-border);
    font-size: 14px;
}
table.nx-table th {
    color: var(--nx-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.04em;
    background: var(--nx-bg);
}
table.nx-table tbody tr:hover { background: #FAFCFE; }

/* ---------- Badges (client type / status) ---------- */
.nx-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.nx-badge-blue    { background: rgba(12,97,178,0.12);  color: var(--nx-blue); }
.nx-badge-orange  { background: rgba(255,115,0,0.14);  color: #B85500; }
.nx-badge-yellow  { background: rgba(253,228,40,0.30); color: #7A6600; }
.nx-badge-sky     { background: rgba(48,197,255,0.16); color: #0A7EA6; }
.nx-badge-muted   { background: #EDF1F5; color: var(--nx-text-muted); }
/* One-time explicit off-palette exception (account suspension/ban only — see CLAUDE.md) */
.nx-badge-suspend { background: rgba(198,40,40,0.12); color: #C62828; }

/* ---------- Forms ---------- */
.nx-form-group { margin-bottom: 18px; }
.nx-form-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.nx-form-group .nx-hint { font-size: 12px; color: var(--nx-text-muted); margin-top: 4px; }

.nx-input, .nx-select, .nx-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--nx-border);
    border-radius: var(--nx-radius);
    font-size: 14px;
    font-family: var(--nx-font);
    background: var(--nx-white);
    color: var(--nx-text);
}
.nx-input:focus, .nx-select:focus, .nx-textarea:focus {
    outline: none;
    border-color: var(--nx-blue);
    box-shadow: 0 0 0 3px rgba(12,97,178,0.15);
}
.nx-textarea { resize: vertical; min-height: 90px; }

.nx-form-error { border-color: var(--nx-orange) !important; }
.nx-error-text { color: var(--nx-orange); font-size: 12px; margin-top: 4px; }

/* ---------- Alerts ---------- */
.nx-alert { padding: 12px 16px; border-radius: var(--nx-radius); font-size: 14px; margin-bottom: 18px; }
.nx-alert-success { background: rgba(48,197,255,0.14); color: #0A5C7A; border: 1px solid var(--nx-skyblue); }
.nx-alert-error   { background: rgba(255,115,0,0.10);  color: #B85500; border: 1px solid var(--nx-orange); }
.nx-alert-info    { background: rgba(12,97,178,0.08);  color: var(--nx-navy); border: 1px solid var(--nx-blue); }

/* ---------- Timer circular buttons ---------- */
.nx-timer-circle-btn {
    width:28px; height:28px; border-radius:50%; border:none; color:#fff;
    font-size:11px; cursor:pointer; display:inline-flex; align-items:center;
    justify-content:center; transition:filter 0.15s ease;
}
.nx-timer-circle-btn:hover { filter:brightness(0.9); }

/* ---------- Tabs (e.g. Cron Settings) ---------- */
.nx-tabs-list {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--nx-border);
    margin-bottom: 20px;
}

.nx-tab-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--nx-font);
    font-weight: 600;
    font-size: 14px;
    color: var(--nx-text-muted);
    padding: 10px 18px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.nx-tab-btn:hover { color: var(--nx-blue); }
.nx-tab-btn.active {
    color: var(--nx-blue);
    border-bottom-color: var(--nx-orange);
}

.nx-tab-panel { display: none; }
.nx-tab-panel.active { display: block; }

/* ---------- Discussion author signature + hover card ---------- */
.nx-signature {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: default;
}
.nx-signature-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--nx-border);
}
.nx-signature-name {
    font-weight: 600;
    color: var(--nx-navy);
}

.nx-hovercard {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    z-index: 100;
    width: 220px;
    background: var(--nx-white);
    border-radius: var(--nx-radius);
    border-top: 3px solid var(--nx-skyblue);
    box-shadow: var(--nx-shadow), 0 8px 24px rgba(0,36,70,0.20);
    padding: 16px;
    text-align: center;
}
.nx-signature:hover .nx-hovercard { display: block; }
.nx-hovercard-flip {
    bottom: auto;
    top: calc(100% + 8px);
}

.nx-hovercard-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--nx-border);
    margin-bottom: 8px;
}
.nx-hovercard-name {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: var(--nx-navy);
    margin-bottom: 6px;
}
.nx-hovercard .nx-badge { margin-bottom: 10px; }
.nx-hovercard-socials {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid var(--nx-border);
}
.nx-hovercard-social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(12,97,178,0.10);
    color: var(--nx-blue);
    transition: background 0.15s ease, color 0.15s ease;
}
.nx-hovercard-social-icon:hover {
    background: var(--nx-blue);
    color: var(--nx-white);
    text-decoration: none;
}
.nx-hovercard-no-social {
    font-size: 12px;
    color: var(--nx-text-muted);
    padding-top: 8px;
    border-top: 1px solid var(--nx-border);
    display: block;
}

/* ---------- Empty state ---------- */
.nx-empty { text-align: center; padding: 60px 20px; color: var(--nx-text-muted); }
.nx-empty h3 { color: var(--nx-navy); margin-bottom: 6px; }
