*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #0D2137;
  --navy-mid:    #1B3A52;
  --navy-light:  #D5E8F0;
  --teal:        #0F6E56;
  --teal-light:  #E1F5EE;
  --paper:       #F0F3F6;
  --white:       #FFFFFF;
  --border:      #CDD2DA;
  --gray:        #718096;
  --gray-light:  #EDF2F7;
  --text:        #1A202C;
  --text-muted:  #718096;
  --danger:      #C53030;
  --danger-light:#FFF5F5;
  --warning:     #B7791F;
  --warning-light:#FFFBEB;
  --success:     #276749;
  --success-light:#F0FFF4;
  --info:        #2B6CB0;
  --info-light:  #EBF8FF;
  --font:        'DM Sans', sans-serif;
  --font-serif:  'DM Serif Display', serif;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 16px rgba(13,33,55,0.10);
  --shadow-lg:   0 8px 40px rgba(13,33,55,0.12);
}

html, body, #root { height: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────── */
.app-shell      { display: flex; height: 100vh; overflow: hidden; }
.sidebar        { width: 230px; min-width: 230px; background: var(--white); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; }
.main-area      { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar         { height: 54px; background: var(--white); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; flex-shrink: 0; }
.page-content   { flex: 1; overflow-y: auto; padding: 24px; }

/* ── Sidebar ────────────────────────────────── */
.sidebar-logo   { padding: 18px 16px 14px; border-bottom: 1px solid var(--border); }
.sidebar-logo h1 { font-size: 13px; font-weight: 600; color: var(--navy); }
.sidebar-logo p  { font-size: 11px; color: var(--gray); margin-top: 1px; }
.sidebar-user   { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.sidebar-user-info p    { font-size: 13px; font-weight: 500; }
.sidebar-user-info span { font-size: 11px; color: var(--gray); }
.nav-section    { padding: 8px 0; }
.nav-label      { font-size: 10px; font-weight: 600; color: var(--gray); padding: 4px 16px 2px; text-transform: uppercase; letter-spacing: 0.6px; }
.nav-btn        { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 16px; background: none; border: none; font-family: var(--font); font-size: 13px; color: var(--text-muted); cursor: pointer; text-align: left; border-radius: 0; transition: background 0.12s, color 0.12s; }
.nav-btn:hover  { background: var(--paper); color: var(--text); }
.nav-btn.active { background: var(--navy-light); color: var(--navy); font-weight: 500; }
.nav-btn i      { font-size: 17px; width: 18px; flex-shrink: 0; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--border); padding: 8px 0; }

/* ── Avatar ─────────────────────────────────── */
.avatar         { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.av-navy        { background: var(--navy-light); color: var(--navy); }
.av-teal        { background: var(--teal-light); color: var(--teal); }
.av-amber       { background: #FEFCE8; color: #92400E; }

/* ── Badges ─────────────────────────────────── */
.badge          { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge-pending  { background: var(--warning-light); color: var(--warning); }
.badge-progress { background: var(--info-light);    color: var(--info); }
.badge-complete { background: var(--success-light); color: var(--success); }
.badge-rejected { background: var(--danger-light);  color: var(--danger); }
.badge-draft    { background: var(--gray-light);    color: var(--gray); }
.badge-submitted{ background: #EDE9FE;              color: #5B21B6; }
.badge-peer     { background: var(--warning-light); color: var(--warning); }
.badge-final    { background: var(--info-light);    color: var(--info); }
.badge-qualified{ background: var(--success-light); color: var(--success); }
.badge-open     { background: var(--teal-light);    color: var(--teal); }
.badge-closed   { background: var(--gray-light);    color: var(--gray); }
.badge-mandatory{ background: var(--danger-light);  color: var(--danger); }
.badge-advantage{ background: var(--info-light);    color: var(--info); }

/* ── Buttons ────────────────────────────────── */
.btn            { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--white); color: var(--text); font-size: 13px; font-family: var(--font); cursor: pointer; transition: background 0.12s; white-space: nowrap; }
.btn:hover      { background: var(--paper); }
.btn:disabled   { opacity: 0.5; cursor: not-allowed; }
.btn-primary    { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-mid); }
.btn-teal       { background: var(--teal); color: var(--white); border-color: var(--teal); }
.btn-teal:hover { background: #0A5240; }
.btn-danger     { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-sm         { padding: 4px 10px; font-size: 12px; }
.btn-icon       { padding: 6px; border-radius: var(--radius-sm); }

/* ── Cards ──────────────────────────────────── */
.card           { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.card + .card   { margin-top: 16px; }
.card-title     { font-size: 14px; font-weight: 500; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* ── Forms ──────────────────────────────────── */
.form-group     { margin-bottom: 14px; }
.form-label     { display: block; font-size: 12px; color: var(--gray); margin-bottom: 4px; }
.form-label .req { color: var(--danger); }
.form-input, select, textarea {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 13px; font-family: var(--font); color: var(--text);
  background: var(--white); transition: border-color 0.12s;
}
.form-input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--navy-mid);
}
textarea        { resize: vertical; min-height: 70px; }
.form-hint      { font-size: 11px; color: var(--gray); margin-top: 4px; }

.checkbox-item  { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 13px; cursor: pointer; }
.checkbox-item:hover { background: var(--paper); }
.checkbox-item input { width: 14px; height: 14px; cursor: pointer; accent-color: var(--navy); }

/* ── Grid ───────────────────────────────────── */
.grid-2         { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3         { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4         { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }

/* ── Table ──────────────────────────────────── */
.table-wrap     { overflow-x: auto; }
table           { width: 100%; border-collapse: collapse; font-size: 13px; }
th              { text-align: left; padding: 9px 12px; font-size: 11px; font-weight: 600; color: var(--gray); border-bottom: 1px solid var(--border); white-space: nowrap; }
td              { padding: 11px 12px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td     { background: var(--paper); }

/* ── Misc ───────────────────────────────────── */
.stat-card      { background: var(--paper); border-radius: var(--radius-md); padding: 16px; text-align: center; }
.stat-card .num { font-size: 26px; font-weight: 600; margin: 6px 0 2px; color: var(--navy); }
.stat-card .lbl { font-size: 12px; color: var(--gray); }
.stat-card i    { font-size: 22px; color: var(--gray); }

.section-divider { font-size: 12px; font-weight: 600; color: var(--gray); padding-bottom: 8px; margin: 18px 0 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }

.notice         { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: var(--radius-md); font-size: 13px; margin-bottom: 16px; }
.notice-info    { background: var(--info-light);    color: var(--info);    border: 1px solid #BEE3F8; }
.notice-warn    { background: var(--warning-light); color: var(--warning); border: 1px solid #FAF089; }
.notice-success { background: var(--success-light); color: var(--success); border: 1px solid #9AE6B4; }

.filter-bar     { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar .form-input, .filter-bar select { width: auto; }

.tabs           { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab            { padding: 8px 16px; font-size: 13px; cursor: pointer; color: var(--gray); border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; border-top: none; border-left: none; border-right: none; font-family: var(--font); }
.tab:hover      { color: var(--text); }
.tab.active     { color: var(--navy); font-weight: 500; border-bottom-color: var(--navy); }

.steps          { display: flex; align-items: center; margin-bottom: 24px; }
.step-circle    { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.step-done      { background: var(--success-light); color: var(--success); }
.step-active    { background: var(--navy); color: var(--white); }
.step-todo      { background: var(--paper); color: var(--gray); border: 1px solid var(--border); }
.step-line      { flex: 1; height: 1px; background: var(--border); min-width: 16px; }
.step-label     { font-size: 11px; color: var(--gray); margin-top: 4px; }

/* ── Score grid ─────────────────────────────── */
.score-row        { display: grid; grid-template-columns: 1fr repeat(4,80px); gap: 6px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.score-row:last-child { border-bottom: none; }
.score-select     { padding: 3px 4px; font-size: 12px; width: 100%; text-align: center; }

/* ── Modal ──────────────────────────────────── */
.modal-overlay  { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: flex-start; justify-content: center; padding-top: 48px; z-index: 200; overflow-y: auto; padding-bottom: 48px; }
.modal-box      { background: var(--white); border-radius: var(--radius-xl); border: 1px solid var(--border); width: 660px; max-width: 95vw; max-height: 82vh; overflow-y: auto; padding: 28px; box-shadow: var(--shadow-lg); }
.modal-box.wide { width: 860px; }
.modal-header   { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-size: 16px; font-weight: 500; }
.modal-close    { background: none; border: none; cursor: pointer; color: var(--gray); font-size: 22px; padding: 0; display: flex; }

/* ── Loading ────────────────────────────────── */
.loading-screen { position: fixed; inset: 0; background: rgba(240,243,246,0.96); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; z-index: 300; }
.spinner        { width: 40px; height: 40px; border: 3px solid rgba(13,33,55,0.12); border-top-color: var(--navy); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Notification bell ──────────────────────── */
.notif-btn      { position: relative; }
.notif-dot      { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid var(--white); }
.notif-dropdown { position: absolute; right: 0; top: calc(100% + 8px); width: 340px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 100; max-height: 400px; overflow-y: auto; }
.notif-item     { padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:hover { background: var(--paper); }
.notif-item.unread { border-left: 3px solid var(--navy); }
.notif-item p   { font-size: 13px; font-weight: 500; }
.notif-item span { font-size: 11px; color: var(--gray); }

/* ── Login page ─────────────────────────────── */
.login-page     { min-height: 100vh; background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; }
.login-wrap     { width: 100%; max-width: 420px; }
.login-org-header { text-align: center; margin-bottom: 1.75rem; display: flex; flex-direction: column; align-items: center; gap: 0.875rem; }
.login-org-logo { width: 100px; height: 100px; object-fit: contain; background: var(--navy); border-radius: 50%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.login-org-logo span { font-size: 28px; font-weight: 700; color: var(--white); }
.login-org-logo img { width: 100%; height: 100%; object-fit: contain; }
.login-org-name { color: var(--navy); font-size: 1.05rem; font-weight: 600; line-height: 1.5; }
.login-org-sub  { font-size: .75rem; color: var(--gray); letter-spacing: .08em; text-transform: uppercase; margin-top: .2rem; }
.login-card     { background: var(--white); border-radius: var(--radius-xl); padding: 2.5rem 2rem; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.login-card h2  { font-family: var(--font-serif); font-size: 1.5rem; color: var(--navy); margin-bottom: .25rem; text-align: center; }
.login-card-sub { font-size: .82rem; color: var(--gray); text-align: center; margin-bottom: 2rem; }
.ms-btn         { display: flex; align-items: center; justify-content: center; gap: .875rem; width: 100%; padding: 1rem 1.5rem; background: var(--navy); color: var(--white); border: none; border-radius: var(--radius-md); font-size: .95rem; font-weight: 500; font-family: var(--font); cursor: pointer; transition: all .2s; }
.ms-btn:hover   { background: var(--navy-mid); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(13,33,55,0.2); }
.ms-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.login-footer   { text-align: center; margin-top: 1.5rem; font-size: .72rem; color: var(--gray); }
.error-box      { background: var(--danger-light); border: 1px solid #FEB2B2; border-radius: var(--radius-sm); padding: .875rem 1rem; font-size: .82rem; color: var(--danger); margin-bottom: 1.25rem; text-align: center; }

/* ── Public job board ───────────────────────── */
.public-shell   { min-height: 100vh; background: var(--paper); }
.public-nav     { background: var(--navy); padding: 14px 32px; display: flex; align-items: center; gap: 16px; }
.public-nav h1  { color: var(--white); font-size: 16px; font-weight: 600; }
.public-nav p   { color: #7FB8D0; font-size: 13px; }
.public-content { max-width: 860px; margin: 0 auto; padding: 32px 20px; }
.job-card       { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.job-card-info h3 { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.job-card-info p  { font-size: 12px; color: var(--gray); }

/* ── Info rows ──────────────────────────────── */
.info-row       { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-row .lbl  { color: var(--gray); }

.empty-state    { text-align: center; padding: 48px 20px; color: var(--gray); }
.empty-state i  { font-size: 40px; display: block; margin-bottom: 12px; }

.hidden { display: none !important; }

/* Rich-text job descriptions (editor + public display).
   The global reset zeroes list padding, which pushed bullets outside the box. */
.rich-text { overflow-wrap: anywhere; word-break: break-word; max-width: 100%; line-height: 1.7; }
.rich-text p, .rich-text div { margin: 0 0 6px; }
.rich-text ul, .rich-text ol { margin: 6px 0 8px; padding-left: 24px; list-style-position: outside; }
.rich-text ul { list-style-type: disc; }
.rich-text ul ul { list-style-type: circle; }
.rich-text ol { list-style-type: decimal; }
.rich-text li { margin: 0 0 3px; padding-left: 2px; }
.rich-text h1, .rich-text h2, .rich-text h3, .rich-text h4 { font-size: 14px; font-weight: 600; margin: 10px 0 4px; }
.rich-text img, .rich-text table { max-width: 100%; }
