/* ============================================
   OrthoLubbeek Digital Signature Portal
   Brand colors from ortholubbeek.be
   ============================================ */

:root {
    --ortho-primary: #176B87;
    --ortho-primary-dark: #0f4f66;
    --ortho-primary-light: #1e8aad;
    --ortho-secondary: #64CCC5;
    --ortho-accent: #DAFFFB;
    --ortho-dark: #04364A;
    --ortho-text: #2c3e50;
    --ortho-text-light: #6c757d;
    --ortho-bg: #f8fafb;
    --ortho-surface: #ffffff;
    --ortho-border: #e2e8f0;
    --ortho-success: #28a745;
    --ortho-warning: #ffc107;
    --ortho-danger: #dc3545;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--ortho-text);
    background: var(--ortho-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

a { color: var(--ortho-primary); text-decoration: none; }
a:hover { color: var(--ortho-primary-dark); }

/* Navbar */
.ortho-nav {
    background: var(--ortho-surface);
    border-bottom: 2px solid var(--ortho-primary);
}
.navbar-logo { height: 40px; width: 40px; border-radius: 8px; }
.brand-text {
    font-weight: 700; font-size: 1.2rem;
    color: var(--ortho-dark); letter-spacing: -0.02em;
}
.ortho-nav .nav-link {
    color: var(--ortho-text-light); font-weight: 500;
    padding: 0.5rem 0.85rem; border-radius: 8px;
    transition: all 0.2s; font-size: 0.9rem;
}
.ortho-nav .nav-link:hover {
    color: var(--ortho-primary);
    background: rgba(23,107,135,0.06);
}
.ortho-nav .nav-link.active {
    color: var(--ortho-primary);
    background: rgba(23,107,135,0.1);
    font-weight: 600;
}
.ortho-nav .nav-link.text-danger:hover {
    color: var(--ortho-danger) !important;
    background: rgba(220,53,69,0.06);
}

/* Footer */
.ortho-footer {
    background: var(--ortho-surface);
    border-top: 1px solid var(--ortho-border);
    margin-top: auto;
}

/* Buttons */
.btn-primary {
    background: var(--ortho-primary); border-color: var(--ortho-primary);
    font-weight: 500; border-radius: 8px; padding: 0.5rem 1.25rem;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--ortho-primary-dark); border-color: var(--ortho-primary-dark);
}
.btn-outline-primary {
    color: var(--ortho-primary); border-color: var(--ortho-primary);
    border-radius: 8px; font-weight: 500;
}
.btn-outline-primary:hover {
    background: var(--ortho-primary); border-color: var(--ortho-primary);
}
.btn-success {
    background: var(--ortho-secondary); border-color: var(--ortho-secondary);
    color: var(--ortho-dark); font-weight: 500; border-radius: 8px;
}
.btn-success:hover {
    background: #54b8b2; border-color: #54b8b2; color: var(--ortho-dark);
}

/* Cards */
.card {
    border: 1px solid var(--ortho-border); border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04); background: var(--ortho-surface);
}
.card-header {
    background: transparent; border-bottom: 1px solid var(--ortho-border);
    padding: 1rem 1.25rem;
}

/* Stat cards */
.stat-card {
    border-radius: 12px; padding: 1.25rem; text-align: center;
    border: 1px solid var(--ortho-border); background: var(--ortho-surface);
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.stat-card .stat-number { font-size: 2rem; font-weight: 700; line-height: 1; margin-bottom: 0.25rem; }
.stat-card .stat-label { font-size: 0.85rem; color: var(--ortho-text-light); font-weight: 500; }
.stat-card.stat-draft { border-left: 4px solid var(--ortho-warning); }
.stat-card.stat-draft .stat-number { color: #b8860b; }
.stat-card.stat-sent { border-left: 4px solid var(--ortho-primary); }
.stat-card.stat-sent .stat-number { color: var(--ortho-primary); }
.stat-card.stat-signed { border-left: 4px solid var(--ortho-success); }
.stat-card.stat-signed .stat-number { color: var(--ortho-success); }
.stat-card.stat-total { border-left: 4px solid var(--ortho-dark); }
.stat-card.stat-total .stat-number { color: var(--ortho-dark); }

/* Tables */
.table { font-size: 0.9rem; }
.table thead th {
    background: var(--ortho-bg); font-weight: 600; color: var(--ortho-text);
    border-bottom: 2px solid var(--ortho-border); white-space: nowrap;
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em;
}

/* Badges */
.badge-draft { background: #fff3cd; color: #856404; font-weight: 500; font-size: 0.78rem; padding: 0.35em 0.65em; border-radius: 6px; }
.badge-sent { background: #cce5ff; color: #004085; font-weight: 500; font-size: 0.78rem; padding: 0.35em 0.65em; border-radius: 6px; }
.badge-signed { background: #d4edda; color: #155724; font-weight: 500; font-size: 0.78rem; padding: 0.35em 0.65em; border-radius: 6px; }

/* Forms */
.form-control:focus, .form-select:focus {
    border-color: var(--ortho-primary);
    box-shadow: 0 0 0 0.2rem rgba(23,107,135,0.15);
}
.form-label { font-weight: 500; font-size: 0.9rem; color: var(--ortho-text); }

/* Login */
.login-container {
    min-height: calc(100vh - 120px);
    display: flex; align-items: center; justify-content: center;
}
.login-card {
    width: 100%; max-width: 420px; border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    border: 1px solid var(--ortho-border); background: var(--ortho-surface);
}
.login-card .card-body { padding: 2.5rem; }
.login-logo { width: 80px; height: 80px; border-radius: 16px; margin-bottom: 1rem; }

/* Page header */
.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem;
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; margin: 0; color: var(--ortho-dark); }

/* Quill */
.ql-toolbar.ql-snow { border-radius: 8px 8px 0 0; border-color: var(--ortho-border); }
.ql-container.ql-snow {
    border-radius: 0 0 8px 8px; border-color: var(--ortho-border);
    font-family: 'Inter', sans-serif; font-size: 0.95rem; min-height: 300px;
}
.ql-editor { min-height: 300px; }

/* Signature pad */
.signature-pad-container {
    border: 2px dashed var(--ortho-border); border-radius: 12px;
    background: #fff; position: relative;
}
.signature-pad-container canvas { border-radius: 10px; cursor: crosshair; }
.signature-placeholder {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #ccc; font-size: 1.1rem; pointer-events: none;
}

/* Document preview */
.document-preview {
    background: white; border: 1px solid var(--ortho-border);
    border-radius: 12px; padding: 2rem; max-height: 600px; overflow-y: auto;
}
.document-preview img { max-width: 100%; height: auto; }

/* Alerts */
.alert { border-radius: 10px; font-size: 0.9rem; }

/* Email composer */
.email-composer {
    background: var(--ortho-surface); border-radius: 12px;
    border: 1px solid var(--ortho-border); padding: 1.5rem;
}

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--ortho-text-light); }
.empty-state i { font-size: 3rem; margin-bottom: 1rem; display: block; opacity: 0.4; }

/* Confirmation */
.confirmation-card {
    max-width: 550px; margin: 0 auto; border-radius: 16px;
    text-align: center; padding: 2.5rem;
}
.confirmation-card .check-icon {
    width: 80px; height: 80px; background: #d4edda;
    color: var(--ortho-success); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.5rem; font-size: 2.5rem;
}

/* Template card */
.template-card { transition: all 0.2s; cursor: pointer; }
.template-card:hover {
    border-color: var(--ortho-primary);
    box-shadow: 0 4px 12px rgba(23,107,135,0.12);
}

/* Actions */
.btn-action { padding: 0.25rem 0.5rem; font-size: 0.85rem; border-radius: 6px; }

/* Email body editor */
.email-body-editor .ql-container { min-height: 200px; }
.email-body-editor .ql-editor { min-height: 200px; }

/* Responsive */
@media (max-width: 768px) {
    .page-header { flex-direction: column; align-items: flex-start; }
    .stat-card { margin-bottom: 0.75rem; }
    .table-responsive { font-size: 0.85rem; }
}

/* Print */
@media print {
    .ortho-nav, .ortho-footer, .no-print { display: none !important; }
    main { padding: 0 !important; }
}
