.template-page {
    background: #f8fafc;
    min-height: 100vh;
    margin: 0;
}

.page-topbar {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 18px;
    padding: 14px 18px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.page-topbar .back-link {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.page-topbar .back-link:hover {
    color: #0d6efd;
}

.page-topbar .current-page {
    color: #0f172a;
    font-weight: 600;
}

.section-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.section-card-header {
    padding: 0.35rem 0.75rem 0.3rem;
    border-bottom: 1px solid #eef2f7;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    text-align: center;
}

.section-card-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0d6efd;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    line-height: 1.2;
}

.section-card-header h2 i {
    font-size: 1.1rem;
}

.section-card-body {
    padding: 0.95rem 1.25rem 1.25rem;
}

.template-item {
    padding: 1.5rem;
    margin: 0 0 1rem 0;
    background: #fbfdff;
    border: 1px solid #e8eef5;
    border-radius: 18px;
    transition: all 0.25s ease;
}

.template-item:last-child {
    margin-bottom: 0;
}

.template-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.template-title {
    font-size: 1.12rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.template-title span {
    color: #0d6efd;
}

.template-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.template-meta-box {
    background: #ffffff;
    border: 1px solid #e9eef5;
    border-radius: 14px;
    padding: 0.9rem 1rem;
}

.template-meta-box.inline-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.template-meta-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #64748b;
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 0;
    white-space: nowrap;
}

.template-meta-value {
    color: #0f172a;
    font-weight: 600;
    line-height: 1.5;
}

.template-description {
    color: #334155;
    line-height: 1.75;
    font-size: 1rem;
    margin-bottom: 1.1rem;
}

.template-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-soft-primary {
    background: #eff6ff;
    color: #0d6efd;
    border: 1px solid #cfe2ff;
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-soft-primary:hover {
    background: #dbeafe;
    color: #0b5ed7;
}

.empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 1.2rem;
    text-align: center;
    background: #f8fafc;
    color: #475569;
}

.empty-state-icon {
    color: #94a3b8;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .template-page {
        padding-top: 1rem;
    }

    .page-topbar {
        padding: 12px 14px;
        border-radius: 16px;
    }

    .section-card-header {
        padding: 0.3rem 0.7rem 0.25rem;
    }

    .section-card-header h2 {
        font-size: 1.2rem;
    }

    .section-card-body {
        padding: 0.85rem 1rem 1rem;
    }

    .template-item {
        padding: 1rem;
    }

    .template-meta-grid {
        grid-template-columns: 1fr;
    }

    .template-actions {
        flex-direction: column;
    }

    .template-actions a {
        width: 100%;
        text-align: center;
    }
}