/* ==========================================================================
   The Wainers Data Room — styles
   Swap the brand values below for your exact colors, then everything updates.
   ========================================================================== */
:root {
    --brand-ink:      #14212e;   /* deep navy — headers, primary text */
    --brand-ink-2:    #22303f;
    --brand-accent:   #b7902f;   /* gold — buttons, highlights */
    --brand-accent-2: #9c7a22;
    --bg:             #f4f5f3;
    --card:           #ffffff;
    --line:           #e2e5e1;
    --text:           #1f2a33;
    --muted:          #728091;
    --danger:         #b23b3b;
    --ok:             #2f7d4f;
    --radius:         10px;
    --shadow:         0 1px 3px rgba(20,33,46,.08), 0 6px 20px rgba(20,33,46,.06);
    --font:           -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; color: var(--brand-ink); margin: 0 0 .25rem; }
h2 { color: var(--brand-ink); }
code { background: #eef0ec; padding: .1em .4em; border-radius: 4px; font-size: .9em; }

/* ---- top bar ---- */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--brand-ink);
    padding: .75rem 1.5rem;
    border-bottom: 3px solid var(--brand-accent);
}
.brand-logo { height: 38px; display: block; }
.topnav { display: flex; align-items: center; gap: 1rem; }
.topnav a { color: #dfe6ee; }
.topnav .who { color: #aebccb; font-size: .9rem; }
.topnav .who strong { color: #fff; }

/* ---- layout ---- */
.wrap { max-width: 1000px; margin: 0 auto; padding: 1.75rem 1.5rem 4rem; }
.page-head { margin-bottom: 1.25rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.section-h { font-size: 1.05rem; margin: 1.75rem 0 .75rem; }
.sitefoot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem; border-top: 1px solid var(--line); }

/* ---- cards / alerts ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 2.5rem; text-align: center; }
.alert { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .95rem; }
.alert-error { background: #fbeaea; color: var(--danger); border: 1px solid #eecccc; }
.alert-ok { background: #e9f5ee; color: var(--ok); border: 1px solid #cbe7d5; }

/* ---- buttons ---- */
.btn { display: inline-block; padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--brand-ink); font-size: .9rem; cursor: pointer; font-family: inherit; text-decoration: none; }
.btn:hover { border-color: #cfd4cd; text-decoration: none; }
.btn-primary { background: var(--brand-accent); border-color: var(--brand-accent); color: #fff; }
.btn-primary:hover { background: var(--brand-accent-2); border-color: var(--brand-accent-2); }
.btn-ghost { background: transparent; border-color: transparent; color: inherit; }
.btn-danger { background: #fff; border-color: #e6c6c6; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: .3rem .65rem; font-size: .82rem; }
.btn-block { width: 100%; padding: .7rem; font-size: 1rem; }

/* ---- forms ---- */
label { display: block; font-size: .9rem; color: var(--brand-ink); margin-bottom: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=file], select {
    display: block; width: 100%; margin-top: .3rem;
    padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 8px;
    font-size: .95rem; font-family: inherit; background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--brand-accent); outline-offset: 0; border-color: var(--brand-accent); }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.grid-form button { grid-column: 1 / -1; justify-self: start; }
.checkline { display: flex; align-items: center; gap: .5rem; grid-column: 1 / -1; }
.checkline input { width: auto; margin: 0; }
.inline { display: inline; }
.inline-form { display: inline-block; }
.mini { display: flex; gap: .4rem; margin-top: .4rem; }
.mini input { width: auto; margin: 0; }

/* ---- login ---- */
.login-body {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background:
        linear-gradient(rgba(20,33,46,.82), rgba(20,33,46,.92)),
        var(--brand-ink) url('background.jpg') center/cover no-repeat;
    padding: 1.5rem;
}
.login-card {
    width: 100%; max-width: 380px; background: var(--card);
    border-radius: 14px; padding: 2.25rem 2rem; box-shadow: 0 20px 60px rgba(0,0,0,.35);
    text-align: center;
}
.login-logo { height: 66px; margin-bottom: 1.5rem; }
.login-h1 { font-size: 1.35rem; font-weight: 700; color: var(--brand-ink); margin: 0 0 1.25rem; }
.login-form { text-align: left; }
.field-label { display: block; font-weight: 600; color: var(--brand-ink); font-size: .92rem; margin-bottom: 1rem; }
.field-label input { margin-top: .35rem; padding: .7rem .8rem; }
.pw-wrap { position: relative; display: block; margin-top: .35rem; }
.pw-wrap input { margin-top: 0; padding-right: 2.6rem; }
.pw-toggle { position: absolute; right: .45rem; top: 50%; transform: translateY(-50%); background: none; border: none; padding: .3rem; cursor: pointer; color: var(--muted); display: flex; align-items: center; }
.pw-toggle:hover { color: var(--brand-ink); }
.pw-toggle.is-on { color: var(--brand-accent-2); }
.login-form .btn-primary { background: var(--brand-ink); border-color: var(--brand-ink); margin-top: .25rem; }
.login-form .btn-primary:hover { background: var(--brand-ink-2); border-color: var(--brand-ink-2); }
.login-welcome { margin-top: 1.75rem; text-align: center; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.login-welcome p { margin: .6rem 0; }
.login-copyright { margin-top: 1.5rem; text-align: center; color: #9aa6b2; font-size: .78rem; }

/* ---- document list ---- */
.deal-group { margin-bottom: 1.75rem; }
.deal-title { font-size: 1.1rem; border-bottom: 2px solid var(--brand-accent); display: inline-block; padding-bottom: .2rem; margin-bottom: .75rem; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-row {
    display: flex; align-items: center; gap: 1rem;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: .8rem 1rem; margin-bottom: .6rem; box-shadow: var(--shadow);
}
.doc-kind {
    flex: 0 0 auto; font-size: .72rem; font-weight: 700; letter-spacing: .03em;
    background: var(--brand-ink); color: #fff; padding: .35rem .5rem; border-radius: 6px; min-width: 44px; text-align: center;
}
.doc-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.doc-title { font-weight: 600; color: var(--brand-ink); }
.doc-sub { font-size: .82rem; color: var(--muted); }
.doc-actions { flex: 0 0 auto; display: flex; align-items: center; gap: .5rem; }
.badge { background: #eef0ec; color: var(--muted); font-size: .75rem; padding: .3rem .55rem; border-radius: 6px; }
.badge-viewonly { border: 1px solid var(--line); }

/* ---- tables ---- */
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: top; }
.table th { background: #fafbfa; color: var(--brand-ink); font-weight: 600; }
.table tr:last-child td { border-bottom: none; }
.row-muted { opacity: .55; }
.ctr { text-align: center; }
.access-table input[type=checkbox] { width: 18px; height: 18px; }

/* ---- admin bits ---- */
.admin-tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.tab { padding: .55rem .9rem; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab:hover { text-decoration: none; color: var(--brand-ink); }
.tab.active { color: var(--brand-ink); border-bottom-color: var(--brand-accent); font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; text-align: center; box-shadow: var(--shadow); }
.stat-num { display: block; font-size: 1.8rem; font-weight: 700; color: var(--brand-ink); }
.stat-lbl { font-size: .8rem; color: var(--muted); }
.filters, .picker { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin-bottom: 1rem; }
.filters label, .picker label { margin: 0; }
.pager { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }

/* ---- activity tags ---- */
.tag { display: inline-block; font-size: .72rem; padding: .2rem .5rem; border-radius: 5px; font-weight: 600; background: #eef0ec; color: var(--brand-ink); }
.tag-login_success, .tag-view { background: #e5eef9; color: #1c4e86; }
.tag-download { background: #e9f5ee; color: var(--ok); }
.tag-login_failed, .tag-denied { background: #fbeaea; color: var(--danger); }
.tag-logout { background: #eef0ec; color: var(--muted); }
.tag-admin { background: #f3ecda; color: var(--brand-accent-2); }

/* ---- responsive ---- */
@media (max-width: 640px) {
    .grid-form { grid-template-columns: 1fr; }
    .doc-row { flex-wrap: wrap; }
    .doc-actions { width: 100%; justify-content: flex-end; }
    .table { display: block; overflow-x: auto; }
}
