*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #1a1a1a; background: #f5f5f5; line-height: 1.5; }
.container { max-width: 640px; margin: 40px auto; padding: 0 20px; }
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.1); padding: 32px; margin-bottom: 24px; }
h1 { font-size: 1.5rem; margin-bottom: 8px; }
h2 { font-size: 1.15rem; margin-bottom: 16px; color: #333; }
p { margin-bottom: 12px; color: #555; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
.nav { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.nav-brand { font-weight: 700; font-size: 1.1rem; color: #1a1a1a; cursor: pointer; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-user { font-size: .85rem; color: #6b7280; }
.nav-link { font-size: .9rem; cursor: pointer; background: none; border: none; color: #2563eb; padding: 0; }
.nav-link:hover { text-decoration: underline; }

/* Template cards */
.template-card { display: block; padding: 16px; border: 1px solid #e5e5e5; border-radius: 6px; margin-bottom: 12px; cursor: pointer; transition: border-color .15s; }
.template-card:hover { border-color: #2563eb; }
.template-card .name { font-weight: 600; color: #1a1a1a; }
.template-card .desc { font-size: .85rem; color: #6b7280; margin-top: 2px; }

/* Forms */
.section-label { font-weight: 600; font-size: .95rem; margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px solid #e5e5e5; }
.section-label:first-of-type { margin-top: 0; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: 4px; color: #444; }
.field input { width: 100%; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: .95rem; }
.field input[type="checkbox"] { width: auto; margin-right: 8px; vertical-align: middle; }
.field input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.btn { display: inline-block; padding: 10px 24px; background: #2563eb; color: #fff; border: none; border-radius: 6px; font-size: .95rem; font-weight: 500; cursor: pointer; }
.btn:hover { background: #1d4ed8; }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: .9rem; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }

/* Success */
.check { display: inline-block; width: 48px; height: 48px; background: #22c55e; border-radius: 50%; color: #fff; font-size: 1.5rem; line-height: 48px; text-align: center; margin-bottom: 16px; }
.detail { font-size: .85rem; color: #6b7280; }
.detail dt { font-weight: 600; color: #444; }
.detail dd { margin: 0 0 8px; }
code { background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: .85rem; }

/* Login */
.login-card { text-align: center; padding: 48px 32px; }
.login-card h1 { margin-bottom: 16px; }
.login-card p { margin-bottom: 24px; }

/* Select fields */
.field-select { width: 100%; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: .95rem; background: #fff; }
.field-select:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.15); }

/* Signers management */
.signer-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border: 1px solid #e5e5e5; border-radius: 6px; margin-bottom: 8px; font-size: .9rem; }
.btn-remove { background: none; border: none; color: #dc2626; font-size: .85rem; cursor: pointer; padding: 4px 8px; }
.btn-remove:hover { text-decoration: underline; }

/* Pending NDAs */
.pending-card { padding: 16px; border: 1px solid #e5e5e5; border-radius: 6px; margin-bottom: 12px; }
.pending-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.pending-name { font-weight: 600; color: #1a1a1a; }
.pending-meta { font-size: .82rem; color: #6b7280; margin-top: 2px; }
.pending-actions { display: flex; gap: 8px; flex-shrink: 0; }
.pending-actions .btn { padding: 6px 14px; font-size: .85rem; }

/* Users table */
.table-wrap { overflow-x: auto; margin-top: 16px; }
.users-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.users-table th { text-align: left; padding: 8px 10px; border-bottom: 2px solid #e5e5e5; font-weight: 600; color: #444; white-space: nowrap; }
.users-table td { padding: 10px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.users-table tr:hover td { background: #fafafa; }
.users-table .cell-name { font-weight: 500; }
.users-table .cell-email { color: #6b7280; }
.role-select { padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 4px; font-size: .82rem; }
.role-select:disabled { opacity: .5; }
.signer-select { padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 4px; font-size: .82rem; width: 100%; max-width: 200px; }
.template-checks { display: flex; flex-direction: column; gap: 4px; }
.template-check { font-size: .82rem; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.template-check input { width: auto; margin: 0; }

/* Views */
.view { display: none; }
.view.active { display: block; }

/* Loading */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #d1d5db; border-top-color: #2563eb; border-radius: 50%; animation: spin .6s linear infinite; margin-right: 8px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
