*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #1f2937; background: #f9fafb; line-height: 1.5; }

/* Navbar */
.navbar { background: white; border-bottom: 1px solid #e5e7eb; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.brand { font-size: 18px; font-weight: 700; color: #2563eb; text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-user { font-size: 14px; color: #6b7280; }

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }

/* Auth */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #f3f4f6; }
.auth-card { background: white; border-radius: 12px; padding: 40px; width: 100%; max-width: 420px; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
.auth-title { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.auth-sub { color: #6b7280; text-align: center; margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 20px; color: #6b7280; font-size: 14px; }
.auth-footer a { color: #2563eb; text-decoration: none; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 15px; outline: none; transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus { border-color: #2563eb; }
.required { color: #ef4444; }

/* Buttons */
.btn { display: inline-block; padding: 9px 18px; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; border: none; transition: background 0.15s, opacity 0.15s; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-outline { background: white; color: #374151; border: 1px solid #d1d5db; }
.btn-outline:hover { background: #f9fafb; }
.btn-full { width: 100%; text-align: center; }
.btn-sm { padding: 5px 10px; font-size: 13px; }

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

/* Card */
.card { background: white; border: 1px solid #e5e7eb; border-radius: 10px; padding: 24px; margin-bottom: 20px; }
.card h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

/* Page header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 10px; }
.page-header h2 { font-size: 22px; font-weight: 700; }

/* Dashboard table */
.contract-table-wrap { overflow-x: auto; }
.contract-table { width: 100%; border-collapse: collapse; background: white; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.contract-table th { background: #f3f4f6; padding: 12px 16px; text-align: left; font-size: 13px; color: #6b7280; font-weight: 600; }
.contract-table td { padding: 14px 16px; border-top: 1px solid #f3f4f6; font-size: 14px; }
.contract-table tr:hover td { background: #fafafa; }

/* Badge */
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge-lg { padding: 5px 14px; font-size: 14px; }
.badge-draft { background: #f3f4f6; color: #374151; }
.badge-sent { background: #eff6ff; color: #1d4ed8; }
.badge-completed { background: #f0fdf4; color: #15803d; }
.badge-archived { background: #fef3c7; color: #92400e; }
.badge-pending { background: #f3f4f6; color: #6b7280; }
.badge-signed { background: #f0fdf4; color: #15803d; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: #6b7280; }
.empty-state p { margin-bottom: 16px; }

/* Two-col layout */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; } }

/* Fields toolbar layout */
.fields-layout { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.fields-toolbar { background: white; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; position: sticky; top: 70px; }
.fields-toolbar p { font-size: 14px; margin-bottom: 12px; }
@media (max-width: 900px) { .fields-layout { grid-template-columns: 1fr; } }

/* File drop */
.file-drop { border: 2px dashed #d1d5db; border-radius: 8px; padding: 32px; text-align: center; cursor: pointer; transition: border-color 0.2s; }
.file-drop:hover, .file-drop.drag-over { border-color: #2563eb; background: #eff6ff; }
.file-drop input[type="file"] { display: none; }
.file-name { color: #2563eb; margin-top: 8px; font-size: 14px; }

/* Signer list */
.signer-list { list-style: none; }
.signer-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.signer-list li:last-child { border-bottom: none; }
.signer-order { width: 28px; height: 28px; background: #eff6ff; color: #2563eb; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.signer-info { flex: 1; font-size: 14px; line-height: 1.4; }
.signer-info small { color: #6b7280; }

/* Info table */
.info-table { width: 100%; font-size: 14px; }
.info-table th { text-align: left; padding: 8px 12px 8px 0; color: #6b7280; font-weight: 500; width: 80px; }
.info-table td { padding: 8px 0; }

/* Sign page */
.sign-header { background: white; border-bottom: 1px solid #e5e7eb; padding: 16px 24px; text-align: center; }
.sign-header h2 { font-size: 20px; font-weight: 700; }
.sign-header p { color: #6b7280; font-size: 14px; margin-top: 4px; }

.text-muted { color: #6b7280; font-size: 14px; }
hr { border: none; border-top: 1px solid #e5e7eb; margin: 16px 0; }
