/* AnswerPoint Partner Portal — style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy:   #1B3A6B;
  --blue:   #2E5FA3;
  --gold:   #B8860B;
  --light:  #EEF3FA;
  --mid:    #D8E4F3;
  --ink:    #1A1A2E;
  --muted:  #5A6480;
  --border: #D1DAE8;
  --bg:     #F5F7FB;
  --white:  #FFFFFF;
  --green:  #14532D;  --green-bg: #D1FAE5;
  --yellow: #92400E;  --yellow-bg: #FEF3C7;
  --red:    #991B1B;  --red-bg:   #FEE2E2;
  --gray:   #374151;  --gray-bg:  #F3F4F6;
}
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }

/* Nav */
.topnav { background: var(--navy); padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo-mark { background: var(--gold); color: #fff; font-weight: 800; font-size: 13px; width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; letter-spacing: .5px; }
.nav-brand-name { color: #fff; font-weight: 700; font-size: 15px; letter-spacing: .3px; }
.nav-brand-sep { color: rgba(255,255,255,.3); margin: 0 4px; }
.nav-section { color: var(--mid); font-size: 13px; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-user { color: rgba(255,255,255,.7); font-size: 13px; }
.btn-ghost-sm { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25); padding: 4px 12px; border-radius: 5px; cursor: pointer; font-size: 12px; text-decoration: none; }
.btn-ghost-sm:hover { background: rgba(255,255,255,.2); }

/* Page */
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; color: var(--navy); }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; border: none; transition: all .15s; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--blue); }
.btn-secondary { background: var(--white); color: var(--navy); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--light); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--light); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; padding: 11px; }
.btn-icon-del { background: none; border: none; cursor: pointer; font-size: 15px; opacity: .5; padding: 2px 6px; border-radius: 4px; }
.btn-icon-del:hover { opacity: 1; background: var(--red-bg); }

/* Alerts */
.alert { padding: 10px 16px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
.alert-error   { background: var(--red-bg);    color: var(--red);   border-left: 4px solid var(--red); }
.alert-success { background: var(--green-bg);  color: var(--green); border-left: 4px solid var(--green); }

/* Badges & Tags */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-red    { background: var(--red-bg);    color: var(--red); }
.badge-gray   { background: var(--gray-bg);   color: var(--gray); }
.tag { display: inline-block; background: var(--light); color: var(--blue); border: 1px solid var(--mid); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }

/* Partner Grid */
.partner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.partner-card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 18px; text-decoration: none; color: inherit; display: block; transition: all .15s; }
.partner-card:hover { border-color: var(--blue); box-shadow: 0 4px 16px rgba(27,58,107,.1); transform: translateY(-1px); }
.partner-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.partner-avatar { width: 40px; height: 40px; background: var(--navy); color: #fff; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.partner-avatar.large { width: 56px; height: 56px; font-size: 22px; border-radius: 10px; }
.partner-card-company { font-weight: 600; font-size: 14px; color: var(--navy); }
.partner-card-name { font-size: 12px; color: var(--muted); }
.partner-card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.partner-card-docs { font-size: 12px; color: var(--muted); }

/* Partner Hero */
.partner-hero { display: flex; align-items: flex-start; gap: 16px; }
.partner-hero-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; color: var(--muted); }
.partner-notes { font-size: 12px; color: var(--muted); margin-top: 6px; max-width: 500px; }

/* Sections */
.section { margin-bottom: 28px; background: var(--white); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 14px 18px 12px; background: var(--light); border-bottom: 1px solid var(--border); }

/* Doc table (admin) */
.doc-table { width: 100%; border-collapse: collapse; }
.doc-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 8px 14px; text-align: left; background: var(--light); border-bottom: 1px solid var(--border); }
.doc-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13px; }
.doc-table tr:last-child td { border-bottom: none; }
.doc-table tr:hover td { background: var(--light); }
.doc-link { color: var(--blue); text-decoration: none; font-weight: 500; }
.doc-link:hover { text-decoration: underline; }
.doc-title { max-width: 300px; }
.doc-date { white-space: nowrap; color: var(--muted); }
.doc-notes { font-size: 12px; color: var(--muted); max-width: 220px; }

/* Doc list (partner view) */
.doc-list { padding: 4px 0; }
.doc-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.doc-item:last-child { border-bottom: none; }
.doc-item:hover { background: var(--light); }
.doc-item-main { flex: 1; }
.doc-item-title { font-size: 14px; font-weight: 500; color: var(--ink); }
.doc-item-notes { font-size: 12px; color: var(--muted); margin-top: 3px; }
.doc-item-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* User rows */
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--border); font-size: 13px; }
.user-row:last-child { border-bottom: none; }
.user-name { font-weight: 500; min-width: 120px; }
.user-email { color: var(--muted); }
.empty-state { padding: 14px 18px; color: var(--muted); font-size: 13px; }

/* Welcome bar */
.welcome-bar { display: flex; align-items: center; gap: 14px; background: var(--navy); border-radius: 10px; padding: 18px 22px; margin-bottom: 24px; }
.welcome-avatar { width: 46px; height: 46px; background: var(--gold); color: #fff; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; flex-shrink: 0; }
.welcome-name { color: #fff; font-size: 16px; font-weight: 600; }
.welcome-company { color: var(--mid); font-size: 12px; margin-top: 2px; }

/* Empty page */
.empty-page { text-align: center; padding: 60px 24px; }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-title { font-size: 17px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.empty-sub { font-size: 13px; color: var(--muted); }

/* Portal footer */
.portal-footer { text-align: center; font-size: 12px; color: var(--muted); margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }
.portal-footer a { color: var(--blue); }

/* Fields */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: var(--navy); }
.field input, .field select, .field textarea { padding: 8px 11px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; color: var(--ink); background: var(--white); outline: none; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(46,95,163,.15); }
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--navy) 0%, #243F7A 60%, #2E5FA3 100%); }
.login-card { background: var(--white); border-radius: 14px; padding: 36px 32px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 20px; }
.login-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.login-logo-mark { background: var(--navy); color: #fff; font-weight: 800; font-size: 16px; width: 42px; height: 42px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.login-brand-name { font-size: 18px; font-weight: 700; color: var(--navy); }
.login-brand-sub { font-size: 12px; color: var(--muted); }
.login-footer { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.6; }
.login-footer a { color: var(--blue); }
.login-card form { display: flex; flex-direction: column; gap: 14px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal { background: var(--white); border-radius: 12px; width: 100%; max-width: 580px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 14px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 16px; font-weight: 700; color: var(--navy); }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal form { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }
