/* LumaTech Signatures — Global Styles */
/* Brand: #3B82F6 primary, #2563EB dark, Inter font */

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

:root {
    --brand-50: #EFF6FF;
    --brand-100: #DBEAFE;
    --brand-200: #BFDBFE;
    --brand-300: #93C5FD;
    --brand-400: #60A5FA;
    --brand-500: #3B82F6;
    --brand-600: #2563EB;
    --brand-700: #1D4ED8;
    --brand-800: #1E40AF;
    --brand-900: #1E3A8A;

    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    --green-500: #22c55e;
    --green-100: #dcfce7;
    --amber-500: #f59e0b;
    --amber-100: #fef3c7;
    --red-500: #ef4444;
    --red-100: #fee2e2;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(31,38,135,0.08);
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--slate-800);
    background: var(--slate-50);
    line-height: 1.5;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--slate-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--slate-800);
    font-weight: 700;
    font-size: 17px;
}
.nav-logo { width: 32px; height: 32px; object-fit: contain; }
.nav-brand span {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-link {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--slate-600);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}
.nav-link:hover { color: var(--brand-600); background: var(--brand-50); }
.nav-link.active { color: var(--brand-600); background: var(--brand-50); }

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.15s;
    line-height: 1.2;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
    color: #fff;
    box-shadow: 0 1px 3px rgba(37,99,235,0.3);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 4px 12px rgba(37,99,235,0.35); transform: translateY(-1px); }
.btn-ghost {
    background: transparent;
    color: var(--slate-600);
    border: 1px solid var(--slate-200);
}
.btn-ghost:hover:not(:disabled) { background: var(--slate-50); border-color: var(--slate-300); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }
.btn-danger { color: var(--red-500); }
.btn-danger:hover { background: var(--red-100); border-color: var(--red-500); }
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--slate-400);
    padding: 4px;
    line-height: 1;
}
.btn-icon:hover { color: var(--slate-600); }

/* Cards */
.card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-header h1 { font-size: 24px; font-weight: 700; color: var(--slate-900); }
.header-actions { display: flex; gap: 8px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--slate-700);
    margin-bottom: 6px;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--slate-800);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* Upload */
.upload-form { max-width: 560px; }
.file-drop {
    position: relative;
    border: 2px dashed var(--slate-200);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
}
.file-drop:hover, .file-drop.dragover {
    border-color: var(--brand-400);
    background: var(--brand-50);
}
.file-drop.has-file { border-color: var(--green-500); background: var(--green-100); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop-icon { font-size: 32px; margin-bottom: 8px; }
.file-drop-content p { color: var(--slate-500); font-size: 14px; }
.file-drop-content .link { color: var(--brand-600); font-weight: 500; }
.file-info { margin-top: 8px; font-size: 13px; color: var(--slate-600); font-weight: 500; }

/* Table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--slate-500); background: var(--slate-50); border-bottom: 1px solid var(--slate-200); }
.table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--slate-100); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--slate-50); }
.doc-link { color: var(--brand-600); text-decoration: none; font-weight: 500; }
.doc-link:hover { text-decoration: underline; }
.actions-cell { display: flex; gap: 6px; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}
.badge-draft { background: var(--slate-100); color: var(--slate-600); }
.badge-sent { background: var(--brand-100); color: var(--brand-700); }
.badge-viewed { background: var(--amber-100); color: #92400e; }
.badge-completed { background: var(--green-100); color: #166534; }

/* Detail page */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.detail-list dt { color: var(--slate-500); font-weight: 500; }
.detail-list dd { color: var(--slate-800); }
.signer-form h4 { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--slate-700); }
.send-actions { display: flex; gap: 8px; }

/* Activity log */
.activity-list { display: flex; flex-direction: column; gap: 8px; }
.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--slate-100);
    font-size: 13px;
}
.activity-item:last-child { border-bottom: none; }
.activity-action { font-weight: 600; color: var(--slate-700); text-transform: capitalize; min-width: 80px; }
.activity-detail { color: var(--slate-500); flex: 1; }
.activity-time { color: var(--slate-400); font-size: 12px; white-space: nowrap; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { color: var(--slate-700); margin-bottom: 8px; }
.empty-state p { color: var(--slate-500); margin-bottom: 24px; }

/* Login */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--slate-50), var(--brand-50));
}
.login-card {
    background: #fff;
    border: 1px solid var(--slate-200);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}
.login-header { text-align: center; margin-bottom: 24px; }
.login-logo { width: 48px; height: 48px; margin-bottom: 16px; }
.login-header h1 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}
.login-header p { color: var(--slate-500); font-size: 14px; }
.login-error {
    background: var(--red-100);
    color: var(--red-500);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}
.login-card input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    margin-bottom: 16px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.login-card input:focus {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* Utility */
.text-muted { color: var(--slate-500); }
.text-sm { font-size: 13px; }
.loading { text-align: center; padding: 40px; color: var(--slate-400); }

/* Template grid */
.create-layout { max-width: 800px; margin: 0 auto; }
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.template-card {
    background: #fff;
    border: 2px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: var(--shadow);
}
.template-card:hover {
    border-color: var(--brand-400);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.template-card.template-upload { border-style: dashed; }
.template-icon { font-size: 36px; margin-bottom: 12px; }
.template-card h3 { font-size: 15px; font-weight: 600; color: var(--slate-800); margin-bottom: 4px; }
.template-card .template-delete { margin-top: 8px; font-size: 11px; }
.section-title { font-size: 16px; font-weight: 600; color: var(--slate-700); margin-bottom: 12px; }
.template-section { }
.upload-template-area {
    background: #fff;
    border: 2px dashed var(--slate-200);
    border-radius: var(--radius);
    padding: 20px 24px;
}
.upload-template-area:hover { border-color: var(--brand-300); }

/* Responsive */
@media (max-width: 768px) {
    .detail-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .nav-actions { gap: 4px; }
    .nav-link { padding: 6px 8px; font-size: 13px; }
}
